summaryrefslogtreecommitdiff
path: root/Rules.make
Unidiff
Diffstat (limited to 'Rules.make') (more/less context) (ignore whitespace changes)
-rw-r--r--Rules.make12
1 files changed, 11 insertions, 1 deletions
diff --git a/Rules.make b/Rules.make
index 1e4b205..11bfa55 100644
--- a/Rules.make
+++ b/Rules.make
@@ -1,98 +1,108 @@
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 > $@
8ifneq ($(CONFIG_DEBUG),)
9 echo CONFIG += debug >> $@
10 echo CONFIG -= release >> $@
11else
12 echo CONFIG -= debug >> $@
13 echo CONFIG += release >> $@
14endif
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; )
48 ( cd include/opie && ln -sf ../../libsql/*.h .; ) 58 ( cd include/opie && ln -sf ../../libsql/*.h .; )
49 ( cd include/opie && ln -sf ../../libopie/pim/*.h .; ) 59 ( cd include/opie && ln -sf ../../libopie/pim/*.h .; )
50 ( cd include/opie; for generatedHeader in `cd ../../libopie; ls *.ui | sed -e "s,\.ui,\.h,g"`; do \ 60 ( cd include/opie; for generatedHeader in `cd ../../libopie; ls *.ui | sed -e "s,\.ui,\.h,g"`; do \
51 ln -sf ../../libopie/$$generatedHeader $$generatedHeader; done ) 61 ln -sf ../../libopie/$$generatedHeader $$generatedHeader; done )
52 ln -sf ../../library/custom.h $(TOPDIR)/include/qpe/custom.h 62 ln -sf ../../library/custom.h $(TOPDIR)/include/qpe/custom.h
53 touch $@ 63 touch $@
54 64
55$(OPIEDIR)/stamp-headers-x11 : 65$(OPIEDIR)/stamp-headers-x11 :
56 @-rm -f $@* 66 @-rm -f $@*
57 mkdir -p $(TOPDIR)/include/qpe $(TOPDIR)/include/qtopia \ 67 mkdir -p $(TOPDIR)/include/qpe $(TOPDIR)/include/qtopia \
58 $(TOPDIR)/include/opie $(TOPDIR)/include/qtopia/private 68 $(TOPDIR)/include/opie $(TOPDIR)/include/qtopia/private
59 ( cd include/qpe && rm -f *.h; ln -sf ../../library/*.h .; ln -sf ../../library/backend/*.h .; rm -f *_p.h; ) 69 ( cd include/qpe && rm -f *.h; ln -sf ../../library/*.h .; ln -sf ../../library/backend/*.h .; rm -f *_p.h; )
60 ( cd include/qtopia && rm -f *.h; ln -sf ../../library/*.h .; ) 70 ( cd include/qtopia && rm -f *.h; ln -sf ../../library/*.h .; )
61 ( cd include/qtopia/private && rm -f *.h; ln -sf ../../../library/backend/*.h .; ) 71 ( cd include/qtopia/private && rm -f *.h; ln -sf ../../../library/backend/*.h .; )
62 ( cd include/opie && rm -f *.h; ln -sf ../../libopie/*.h .; rm -f *_p.h; ) 72 ( cd include/opie && rm -f *.h; ln -sf ../../libopie/*.h .; rm -f *_p.h; )
63 ( cd include/opie && ln -sf ../../libsql/*.h .; ) 73 ( cd include/opie && ln -sf ../../libsql/*.h .; )
64 ( cd include/opie && ln -sf ../../libopie/pim/*.h .; ) 74 ( cd include/opie && ln -sf ../../libopie/pim/*.h .; )
65 ( cd include/opie; for generatedHeader in `cd ../../libopie; ls *.ui | sed -e "s,\.ui,\.h,g"`; do \ 75 ( cd include/opie; for generatedHeader in `cd ../../libopie; ls *.ui | sed -e "s,\.ui,\.h,g"`; do \
66 ln -sf ../../libopie/$$generatedHeader $$generatedHeader; done ) 76 ln -sf ../../libopie/$$generatedHeader $$generatedHeader; done )
67 ln -sf ../../library/custom.h $(TOPDIR)/include/qpe/custom.h 77 ln -sf ../../library/custom.h $(TOPDIR)/include/qpe/custom.h
68 ( cd include/qpe; ln -sf ../../x11/libqpe-x11/qpe/*.h .; ) 78 ( cd include/qpe; ln -sf ../../x11/libqpe-x11/qpe/*.h .; )
69 touch $@ 79 touch $@
70 80
71$(TOPDIR)/library/custom.h : $(TOPDIR)/.config 81$(TOPDIR)/library/custom.h : $(TOPDIR)/.config
72 @-rm -f $@ 82 @-rm -f $@
73 @$(if $(patsubst "%",%,$(CONFIG_CUSTOMFILE)),\ 83 @$(if $(patsubst "%",%,$(CONFIG_CUSTOMFILE)),\
74 ln -sf $(patsubst "%",%,$(CONFIG_CUSTOMFILE)) $@) 84 ln -sf $(patsubst "%",%,$(CONFIG_CUSTOMFILE)) $@)
75 @touch $@ 85 @touch $@
76 86
77$(TOPDIR)/scripts/lxdialog/lxdialog $(TOPDIR)/scripts/kconfig/conf scripts/kconfig/conf $(TOPDIR)/scripts/kconfig/mconf scripts/kconfig/mconf $(TOPDIR)/scripts/kconfig/qconf scripts/kconfig/qconf $(TOPDIR)/qmake/qmake : 87$(TOPDIR)/scripts/lxdialog/lxdialog $(TOPDIR)/scripts/kconfig/conf scripts/kconfig/conf $(TOPDIR)/scripts/kconfig/mconf scripts/kconfig/mconf $(TOPDIR)/scripts/kconfig/qconf scripts/kconfig/qconf $(TOPDIR)/qmake/qmake :
78 $(call descend,$(shell dirname $@),$(shell basename $@)) 88 $(call descend,$(shell dirname $@),$(shell basename $@))
79 89
80$(TOPDIR)/qmake/qmake : $(TOPDIR)/mkspecs/default 90$(TOPDIR)/qmake/qmake : $(TOPDIR)/mkspecs/default
81 91
82$(TOPDIR)/mkspecs/default : 92$(TOPDIR)/mkspecs/default :
83 ln -sf linux-g++ $@ 93 ln -sf linux-g++ $@
84 94
85## general rules ## 95## general rules ##
86 96
87define descend 97define descend
88 $(MAKE) $(if $(QMAKE),QMAKE=$(QMAKE)) -C $(1) $(2) 98 $(MAKE) $(if $(QMAKE),QMAKE=$(QMAKE)) -C $(1) $(2)
89endef 99endef
90 100
91define makefilegen 101define makefilegen
92 cd $(if $(1),$(shell dirname $(1))); $(TOPDIR)/qmake/qmake $(3) -o $(if $(1),$(shell basename $(1))) `cat $(OPIEDIR)/packages | grep " \`echo $(1)|sed -e 's,/Makefile$$,,'\`" | \ 102 cd $(if $(1),$(shell dirname $(1))); $(TOPDIR)/qmake/qmake $(3) -o $(if $(1),$(shell basename $(1))) `cat $(OPIEDIR)/packages | grep " \`echo $(1)|sed -e 's,/Makefile$$,,'\`" | \
93 head -1 | awk '{print $$3}'` 103 head -1 | awk '{print $$3}'`
94endef 104endef
95 105
96define makecfg 106define makecfg
97 $(TOPDIR)/scripts/makecfg.pl $1 $(OPIEDIR) 107 $(TOPDIR)/scripts/makecfg.pl $1 $(OPIEDIR)
98endef 108endef