patch: make *outfile extern
[platform/upstream/cdrkit.git] / Makefile
1 ifneq ($(CFLAGS),)
2 CMAKETWEAKS += ( cd build ; cmake .. -DCMAKE_C_FLAGS="$(CFLAGS)" ) || exit 1; 
3 endif
4
5 ifneq ($(LDFLAGS),)
6 CMAKETWEAKS += (cd build ; cmake .. -DCMAKE_EXE_LINKER_FLAGS:STRING="$(LDFLAGS)" -DCMAKE_MODULE_LINKER_FLAGS:STRING="$(LDFLAGS)" -DCMAKE_SHARED_LINKER_FLAGS:STRING="$(LDFLAGS)" ) || exit 1; 
7 endif
8
9 ifneq ($(PREFIX),)
10 CMAKETWEAKS += ( cd build ;  cmake .. -DCMAKE_INSTALL_PREFIX="$(PREFIX)") || exit 1; 
11 endif
12
13 ifneq ($(MANSUBDIR),)
14 CMAKETWEAKS += ( cd build ;  cmake .. -DMANSUBDIR="$(MANSUBDIR)" ) || exit 1; 
15 endif
16
17 default_target: all
18
19 DISTNAME=cdrkit-$(shell cat VERSION)
20 DEBSRCNAME=cdrkit_$(shell cat VERSION | sed -e "s,pre,~pre,").orig.tar.gz
21
22 build/Makefile:
23         @-mkdir build 2>/dev/null
24         cd build && cmake ..
25
26 cmakepurge:
27         rm -rf install_manifest.txt progress.make CMakeFiles CMakeCache.txt cmake_install.cmake 
28         rm -rf */install_manifest.txt */progress.make */CMakeFiles */CMakeCache.txt */cmake_install.cmake 
29         rm -rf */*/install_manifest.txt */*/progress.make */*/CMakeFiles */*/CMakeCache.txt */*/cmake_install.cmake 
30         rm */Makefile */*/Makefile
31
32 clean:
33         rm -rf build
34
35 tarball:
36 #       if test "$(shell svn status | grep -v -i make)" ; then echo Uncommited files found. Run \"svn status\" to display them. ; exit 1 ; fi
37         @if test -f ../$(DISTNAME).tar.gz ; then echo ../$(DISTNAME).tar.gz exists, not overwritting ; exit 1; fi
38         -svn up
39         rm -rf tmp
40         mkdir tmp
41         svn export . tmp/$(DISTNAME)
42         rm -rf tmp/$(DISTNAME)/debian
43         tar -f - -c -C tmp $(DISTNAME) | gzip -9 > ../$(DISTNAME).tar.gz
44         rm -rf tmp
45         test -e /etc/debian_version && ln -f ../$(DISTNAME).tar.gz ../$(DEBSRCNAME) || true
46         test -e ../tarballs && ln -f ../$(DISTNAME).tar.gz ../tarballs/$(DEBSRCNAME) || true
47
48 tarball-remove:
49         rm -f ../$(DISTNAME).tar.gz ../tarballs/$(DEBSRCNAME) ../$(DEBSRCNAME)
50
51 SVNBASE=$(shell svn info | grep URL: | cut -f2 -d' ' | xargs dirname)
52 release: tarball
53         svn ci
54         svn cp $(SVNBASE)/trunk $(SVNBASE)/tags/release_$(shell cat VERSION)
55
56 #%::
57 #       $(MAKE) $(MAKE_FLAGS) build/Makefile
58 #       $(CMAKETWEAKS)
59 #       $(MAKE) -C build $(MAKE_FLAGS) $@
60
61 # needs to be explicite, for PHONY and install (AKA INSTALL) file on cygwin
62 install: build/Makefile
63         $(CMAKETWEAKS)
64         $(MAKE) -C build $(MAKE_FLAGS) $@
65
66 all: build/Makefile
67         $(CMAKETWEAKS)
68         $(MAKE) -C build $(MAKE_FLAGS) $@
69
70 .PHONY: install all
71
72