aboutsummaryrefslogtreecommitdiff
path: root/tools/osx/osx-depends/dpkg/Makefile
blob: 5ec273a631e7804526eb4fb0119ab60022864577 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#  A quick and dirty Makefile to download/build and install
#
#  Usage:
#    make
#    sudo make install

# lib name, version
APPNAME=dpkg
VERSION=1.14.30
SOURCE=$(APPNAME)_$(VERSION)
SOURCE_DEBIAN=$(APPNAME)-$(VERSION)
# download location and format
BASE_URL=http://mirrors.xbmc.org/build-deps/darwin-libs
ARCHIVE=$(SOURCE).tar.gz
TARBALLS_LOCATION=/Users/Shared/xbmc-depends/tarballs
RETRIEVE_TOOL=/usr/bin/curl
RETRIEVE_TOOL_FLAGS=-Ls --create-dirs --output $(TARBALLS_LOCATION)/$(ARCHIVE)
ARCHIVE_TOOL=tar
ARCHIVE_TOOL_FLAGS=xf

export LIBTOOL=builds/unix/libtool
PREFIX:=/Users/Shared/xbmc-depends/osx-10.4_i386
export PATH:=$(PREFIX)/bin:$(PATH)
CONFIGURE=./configure --prefix=$(PREFIX) --enable-static --disable-shared

CLEAN_FILES=$(ARCHIVE) $(SOURCE_DEBIAN)

all: $(APPNAME) .installed

$(TARBALLS_LOCATION)/$(ARCHIVE):
	$(RETRIEVE_TOOL) $(RETRIEVE_TOOL_FLAGS) $(BASE_URL)/$(ARCHIVE)

$(SOURCE_DEBIAN): $(TARBALLS_LOCATION)/$(ARCHIVE)
	-rm -rf $(SOURCE_DEBIAN)
	$(ARCHIVE_TOOL) $(ARCHIVE_TOOL_FLAGS) $(TARBALLS_LOCATION)/$(ARCHIVE)
	echo $(SOURCE_DEBIAN) > .gitignore
	cd $(SOURCE_DEBIAN); $(CONFIGURE)

$(APPNAME): $(SOURCE_DEBIAN)
	make -C $(SOURCE_DEBIAN)/lib CFLAGS="" LDFLAGS=""
	make -C $(SOURCE_DEBIAN)/libcompat CFLAGS="" LDFLAGS=""
	make -C $(SOURCE_DEBIAN)/src CFLAGS="" LDFLAGS=""
	make -C $(SOURCE_DEBIAN)/dpkg-deb CFLAGS="" LDFLAGS=""

.installed:
	make -C $(SOURCE_DEBIAN)/dpkg-deb install
	touch $@

clean:
	make -C $(SOURCE_DEBIAN) clean
	rm  .installed

distclean::
	rm -rf $(SOURCE_DEBIAN) .installed