author | kergoth <kergoth> | 2003-01-24 01:09:11 (UTC) |
---|---|---|
committer | kergoth <kergoth> | 2003-01-24 01:09:11 (UTC) |
commit | fdf29b4b01231c746f7697365fcd7bd57d154365 (patch) (unidiff) | |
tree | 309306f501beb67a0267fa2b925a3fdaadbd6f2a /Rules.make | |
parent | 3de1877c4c39c3cc99848204da8e32fc6e3d9efb (diff) | |
download | opie-fdf29b4b01231c746f7697365fcd7bd57d154365.zip opie-fdf29b4b01231c746f7697365fcd7bd57d154365.tar.gz opie-fdf29b4b01231c746f7697365fcd7bd57d154365.tar.bz2 |
Add debug to config system. enabling/disabling this option alters a toplevel gen.pro file, which alters the CONFIG parameter in the .pro files. In this way you can enable/disable debug builds globally via the config system.
-rw-r--r-- | Rules.make | 12 |
1 files changed, 11 insertions, 1 deletions
@@ -1,47 +1,57 @@ | |||
1 | ## targets ## | 1 | ## targets ## |
2 | 2 | ||
3 | $(configs) : | 3 | $(configs) : |
4 | $(call makecfg,$@) | 4 | $(call makecfg,$@) |
5 | 5 | ||
6 | $(TOPDIR)/gen.pro : $(TOPDIR)/.config | ||
7 | echo > $@ | ||
8 | ifneq ($(CONFIG_DEBUG),) | ||
9 | echo CONFIG += debug >> $@ | ||
10 | echo CONFIG -= release >> $@ | ||
11 | else | ||
12 | echo CONFIG -= debug >> $@ | ||
13 | echo CONFIG += release >> $@ | ||
14 | endif | ||
15 | |||
6 | $(TOPDIR)/.depends : $(shell if [ -e $(TOPDIR)/config.in ]\; then echo $(TOPDIR)/config.in\; fi\;) $(TOPDIR)/.config $(TOPDIR)/packages | 16 | $(TOPDIR)/.depends : $(shell if [ -e $(TOPDIR)/config.in ]\; then echo $(TOPDIR)/config.in\; fi\;) $(TOPDIR)/.config $(TOPDIR)/packages |
7 | @echo Generating dependency information... | 17 | @echo Generating dependency information... |
8 | # add to subdir-y, and add descend rules | 18 | # add to subdir-y, and add descend rules |
9 | @cat $(TOPDIR)/packages | grep -v '^#' | \ | 19 | @cat $(TOPDIR)/packages | grep -v '^#' | \ |
10 | awk '{print \ | 20 | awk '{print \ |
11 | ".PHONY : " $$2 "\n" \ | 21 | ".PHONY : " $$2 "\n" \ |
12 | "subdir-$$(" $$1 ") += " $$2 "\n\n"; \ | 22 | "subdir-$$(" $$1 ") += " $$2 "\n\n"; \ |
13 | print $$2 " : " $$2 "/Makefile\n\t$$(call descend,$$@,$(filter-out $$@,$$(filter-out $$@,$$(MAKECMDGOALS))))\n"; }' > $(TOPDIR)/.depends | 23 | print $$2 " : " $$2 "/Makefile\n\t$$(call descend,$$@,$(filter-out $$@,$$(filter-out $$@,$$(MAKECMDGOALS))))\n"; }' > $(TOPDIR)/.depends |
14 | cat $(TOPDIR)/packages | grep -v '^#' | \ | 24 | cat $(TOPDIR)/packages | grep -v '^#' | \ |
15 | perl -ne '($$cfg, $$dir, $$pro) = $$_ =~ /^(\S+)\s+(\S+)\s+(\S+)/; if ( -e "$$dir/$$pro" ) { print "$$dir/Makefile : $$dir/$$pro \$$(QMAKE)\n\t\$$(call makefilegen,\$$@)\n\n"; }' \ | 25 | perl -ne '($$cfg, $$dir, $$pro) = $$_ =~ /^(\S+)\s+(\S+)\s+(\S+)/; if ( -e "$$dir/$$pro" ) { print "$$dir/Makefile : $$dir/$$pro \$$(QMAKE) \$$(OPIEDIR)/gen.pro\n\t\$$(call makefilegen,\$$@)\n\n"; }' \ |
16 | >> $(TOPDIR)/.depends | 26 | >> $(TOPDIR)/.depends |
17 | # interpackage dependency generation | 27 | # interpackage dependency generation |
18 | @cat $(TOPDIR)/packages | \ | 28 | @cat $(TOPDIR)/packages | \ |
19 | $(TOPDIR)/scripts/deps.pl >> $(TOPDIR)/.depends | 29 | $(TOPDIR)/scripts/deps.pl >> $(TOPDIR)/.depends |
20 | 30 | ||
21 | $(TOPDIR)/.depends.cfgs: | 31 | $(TOPDIR)/.depends.cfgs: |
22 | # config.in interdependencies | 32 | # config.in interdependencies |
23 | @echo $(configs) | sed -e 's,/config.in,,g' | ( for i in `cat`; do echo $$i; done ) > dirs | 33 | @echo $(configs) | sed -e 's,/config.in,,g' | ( for i in `cat`; do echo $$i; done ) > dirs |
24 | @cat dirs | ( for i in `cat`; do if [ "`cat dirs|grep $$i 2>/dev/null|wc -l`" -ne "1" ]; then deps=`cat dirs|grep $$i| grep -v "^$$i$$"|for i in \`cat|sed -e's,^$(TOPDIR)/,$$(TOPDIR)/,g'\`; do echo $$i/config.in; done`; echo `echo $$i/config.in|sed -e 's,^$(TOPDIR)/,$$(TOPDIR)/,'` : $$deps; fi; done ) >> $@ | 34 | @cat dirs | ( for i in `cat`; do if [ "`cat dirs|grep $$i 2>/dev/null|wc -l`" -ne "1" ]; then deps=`cat dirs|grep $$i| grep -v "^$$i$$"|for i in \`cat|sed -e's,^$(TOPDIR)/,$$(TOPDIR)/,g'\`; do echo $$i/config.in; done`; echo `echo $$i/config.in|sed -e 's,^$(TOPDIR)/,$$(TOPDIR)/,'` : $$deps; fi; done ) >> $@ |
25 | @-rm -f dirs | 35 | @-rm -f dirs |
26 | 36 | ||
27 | $(QTDIR)/stamp-headers : | 37 | $(QTDIR)/stamp-headers : |
28 | @-rm -f $@* | 38 | @-rm -f $@* |
29 | ( cd $(QTDIR)/include; \ | 39 | ( cd $(QTDIR)/include; \ |
30 | $(patsubst %,ln -sf ../src/kernel/%;,qgfx_qws.h qwsmouse_qws.h \ | 40 | $(patsubst %,ln -sf ../src/kernel/%;,qgfx_qws.h qwsmouse_qws.h \ |
31 | qcopchannel_qws.h qwindowsystem_qws.h \ | 41 | qcopchannel_qws.h qwindowsystem_qws.h \ |
32 | qfontmanager_qws.h qwsdefaultdecoration_qws.h)) | 42 | qfontmanager_qws.h qwsdefaultdecoration_qws.h)) |
33 | touch $@ | 43 | touch $@ |
34 | 44 | ||
35 | $(QTDIR)/stamp-headers-x11 : | 45 | $(QTDIR)/stamp-headers-x11 : |
36 | @-rm -f $@* | 46 | @-rm -f $@* |
37 | cd $(QTDIR)/include; $(patsubst %,ln -sf $(OPIEDIR)/x11/libqpe-x11/qt/%;,qgfx_qws.h qwsmouse_qws.h qcopchannel_qws.h qwindowsystem_qws.h qfontmanager_qws.h qwsdefaultdecoration_qws.h) | 47 | cd $(QTDIR)/include; $(patsubst %,ln -sf $(OPIEDIR)/x11/libqpe-x11/qt/%;,qgfx_qws.h qwsmouse_qws.h qcopchannel_qws.h qwindowsystem_qws.h qfontmanager_qws.h qwsdefaultdecoration_qws.h) |
38 | touch $@ | 48 | touch $@ |
39 | 49 | ||
40 | $(OPIEDIR)/stamp-headers : | 50 | $(OPIEDIR)/stamp-headers : |
41 | @-rm -f $@* | 51 | @-rm -f $@* |
42 | mkdir -p $(TOPDIR)/include/qpe $(TOPDIR)/include/qtopia \ | 52 | mkdir -p $(TOPDIR)/include/qpe $(TOPDIR)/include/qtopia \ |
43 | $(TOPDIR)/include/opie $(TOPDIR)/include/qtopia/private | 53 | $(TOPDIR)/include/opie $(TOPDIR)/include/qtopia/private |
44 | ( cd include/qpe && rm -f *.h; ln -sf ../../library/*.h .; ln -sf ../../library/backend/*.h .; rm -f *_p.h; ) | 54 | ( cd include/qpe && rm -f *.h; ln -sf ../../library/*.h .; ln -sf ../../library/backend/*.h .; rm -f *_p.h; ) |
45 | ( cd include/qtopia && rm -f *.h; ln -sf ../../library/*.h .; ) | 55 | ( cd include/qtopia && rm -f *.h; ln -sf ../../library/*.h .; ) |
46 | ( cd include/qtopia/private && rm -f *.h; ln -sf ../../../library/backend/*.h .; ) | 56 | ( cd include/qtopia/private && rm -f *.h; ln -sf ../../../library/backend/*.h .; ) |
47 | ( cd include/opie && rm -f *.h; ln -sf ../../libopie/*.h .; rm -f *_p.h; ) | 57 | ( cd include/opie && rm -f *.h; ln -sf ../../libopie/*.h .; rm -f *_p.h; ) |