summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--Rules.make20
1 files changed, 20 insertions, 0 deletions
diff --git a/Rules.make b/Rules.make
index a707751..85d7d87 100644
--- a/Rules.make
+++ b/Rules.make
@@ -1,114 +1,134 @@
1.PHONY: FORCE
2
1$(configs) : 3$(configs) :
2 $(call makecfg,$@) 4 $(call makecfg,$@)
3 5
4$(TOPDIR)/gen.pro : $(TOPDIR)/.config 6$(TOPDIR)/gen.pro : $(TOPDIR)/.config
5 echo > $@ 7 echo > $@
6ifneq ($(CONFIG_DEBUG),) 8ifneq ($(CONFIG_DEBUG),)
7 echo CONFIG += debug >> $@ 9 echo CONFIG += debug >> $@
8 echo CONFIG -= release >> $@ 10 echo CONFIG -= release >> $@
9else 11else
10 echo CONFIG -= debug >> $@ 12 echo CONFIG -= debug >> $@
11 echo CONFIG += release >> $@ 13 echo CONFIG += release >> $@
12endif 14endif
13 15
14$(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
15 @echo Generating dependency information... 17 @echo Generating dependency information...
16# add to subdir-y, and add descend rules 18# add to subdir-y, and add descend rules
17 @cat $(TOPDIR)/packages | grep -v '^#' | \ 19 @cat $(TOPDIR)/packages | grep -v '^#' | \
18 awk '{print \ 20 awk '{print \
19 ".PHONY : " $$2 "\n" \ 21 ".PHONY : " $$2 "\n" \
20 "subdir-$$(" $$1 ") += " $$2 "\n\n"; \ 22 "subdir-$$(" $$1 ") += " $$2 "\n\n"; \
21 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
22 cat $(TOPDIR)/packages | grep -v '^#' | \ 24 cat $(TOPDIR)/packages | grep -v '^#' | \
23 perl -ne '($$cfg, $$dir, $$pro) = $$_ =~ /^(\S+)\s+(\S+)\s+(\S+)/; if ( -e "$$dir/$$pro" ) { print "$$dir/Makefile : $$dir/$$pro \$$(QMAKE) \$$(OPIEDIR)/gen.pro \$$(OPIEDIR)/.config\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 \$$(OPIEDIR)/.config\n\t\$$(call makefilegen,\$$@)\n\n"; }' \
24 >> $(TOPDIR)/.depends 26 >> $(TOPDIR)/.depends
25# interpackage dependency generation 27# interpackage dependency generation
26 @cat $(TOPDIR)/packages | \ 28 @cat $(TOPDIR)/packages | \
27 $(TOPDIR)/scripts/deps.pl >> $(TOPDIR)/.depends 29 $(TOPDIR)/scripts/deps.pl >> $(TOPDIR)/.depends
28 30
29$(TOPDIR)/.depends.cfgs: 31$(TOPDIR)/.depends.cfgs:
30# config.in interdependencies 32# config.in interdependencies
31 @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
32 @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 ) >> $@
33 @-rm -f dirs 35 @-rm -f dirs
34 36
35$(QTDIR)/stamp-headers : 37$(QTDIR)/stamp-headers :
36 @-rm -f $(QTDIR)/stamp-headers* 38 @-rm -f $(QTDIR)/stamp-headers*
37 ( cd $(QTDIR)/include; \ 39 ( cd $(QTDIR)/include; \
38 $(patsubst %,ln -sf ../src/kernel/%;,qgfx_qws.h qwsmouse_qws.h \ 40 $(patsubst %,ln -sf ../src/kernel/%;,qgfx_qws.h qwsmouse_qws.h \
39 qcopchannel_qws.h qwindowsystem_qws.h \ 41 qcopchannel_qws.h qwindowsystem_qws.h \
40 qfontmanager_qws.h qwsdefaultdecoration_qws.h)) 42 qfontmanager_qws.h qwsdefaultdecoration_qws.h))
41 touch $@ 43 touch $@
42 44
43$(QTDIR)/stamp-headers-x11 : 45$(QTDIR)/stamp-headers-x11 :
44 @-rm -f $(QTDIR)/stamp-headers* 46 @-rm -f $(QTDIR)/stamp-headers*
45 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)
46 touch $@ 48 touch $@
47 49
48$(OPIEDIR)/stamp-headers : 50$(OPIEDIR)/stamp-headers :
49 @-rm -f $(OPIEDIR)/stamp-headers* 51 @-rm -f $(OPIEDIR)/stamp-headers*
50 mkdir -p $(TOPDIR)/include/qpe \ 52 mkdir -p $(TOPDIR)/include/qpe \
51 $(TOPDIR)/include/qtopia \ 53 $(TOPDIR)/include/qtopia \
52 $(TOPDIR)/include/opie \ 54 $(TOPDIR)/include/opie \
53 $(TOPDIR)/include/qtopia/private \ 55 $(TOPDIR)/include/qtopia/private \
54 $(TOPDIR)/include/opie2 56 $(TOPDIR)/include/opie2
55 ( cd include/qpe && rm -f *.h; ln -sf ../../library/*.h .; ln -sf ../../library/backend/*.h .; rm -f *_p.h; ) 57 ( cd include/qpe && rm -f *.h; ln -sf ../../library/*.h .; ln -sf ../../library/backend/*.h .; rm -f *_p.h; )
56 ( cd include/qtopia && rm -f *.h; ln -sf ../../library/*.h .; ) 58 ( cd include/qtopia && rm -f *.h; ln -sf ../../library/*.h .; )
57 ( cd include/qtopia/private && rm -f *.h; ln -sf ../../../library/backend/*.h .; ) 59 ( cd include/qtopia/private && rm -f *.h; ln -sf ../../../library/backend/*.h .; )
58 ( cd include/opie && rm -f *.h; ln -sf ../../libopie/*.h .; rm -f *_p.h; ) 60 ( cd include/opie && rm -f *.h; ln -sf ../../libopie/*.h .; rm -f *_p.h; )
59 ( cd include/opie && ln -sf ../../libsql/*.h .; ) 61 ( cd include/opie && ln -sf ../../libsql/*.h .; )
60 ( cd include/opie && ln -sf ../../libopie/pim/*.h .; ) 62 ( cd include/opie && ln -sf ../../libopie/pim/*.h .; )
61 ( cd include/opie2 && ln -sf ../../libopie2/opiecore/*.h .; ) 63 ( cd include/opie2 && ln -sf ../../libopie2/opiecore/*.h .; )
62 #( cd include/opie2 && ln -sf ../../libopie2/opiedb/*.h .; ) 64 #( cd include/opie2 && ln -sf ../../libopie2/opiedb/*.h .; )
63 ( cd include/opie2 && ln -sf ../../libopie2/opienet/*.h .; ) 65 ( cd include/opie2 && ln -sf ../../libopie2/opienet/*.h .; )
64 #( cd include/opie2 && ln -sf ../../libopie2/opiepim/*.h .; ) 66 #( cd include/opie2 && ln -sf ../../libopie2/opiepim/*.h .; )
65 ( cd include/opie2 && ln -sf ../../libopie2/opieui/*.h .; ) 67 ( cd include/opie2 && ln -sf ../../libopie2/opieui/*.h .; )
66 ( cd include/opie; for generatedHeader in `cd ../../libopie; ls *.ui | sed -e "s,\.ui,\.h,g"`; do \ 68 ( cd include/opie; for generatedHeader in `cd ../../libopie; ls *.ui | sed -e "s,\.ui,\.h,g"`; do \
67 ln -sf ../../libopie/$$generatedHeader $$generatedHeader; done ) 69 ln -sf ../../libopie/$$generatedHeader $$generatedHeader; done )
68 ln -sf ../../library/custom.h $(TOPDIR)/include/qpe/custom.h 70 ln -sf ../../library/custom.h $(TOPDIR)/include/qpe/custom.h
69 touch $@ 71 touch $@
70 72
71$(OPIEDIR)/stamp-headers-x11 : 73$(OPIEDIR)/stamp-headers-x11 :
72 @-rm -f $(OPIEDIR)/stamp-headers* 74 @-rm -f $(OPIEDIR)/stamp-headers*
73 mkdir -p $(TOPDIR)/include/qpe $(TOPDIR)/include/qtopia \ 75 mkdir -p $(TOPDIR)/include/qpe $(TOPDIR)/include/qtopia \
74 $(TOPDIR)/include/opie $(TOPDIR)/include/qtopia/private 76 $(TOPDIR)/include/opie $(TOPDIR)/include/qtopia/private
75 ( cd include/qpe && rm -f *.h; ln -sf ../../library/*.h .; ln -sf ../../library/backend/*.h .; rm -f *_p.h; ) 77 ( cd include/qpe && rm -f *.h; ln -sf ../../library/*.h .; ln -sf ../../library/backend/*.h .; rm -f *_p.h; )
76 ( cd include/qtopia && rm -f *.h; ln -sf ../../library/*.h .; ) 78 ( cd include/qtopia && rm -f *.h; ln -sf ../../library/*.h .; )
77 ( cd include/qtopia/private && rm -f *.h; ln -sf ../../../library/backend/*.h .; ) 79 ( cd include/qtopia/private && rm -f *.h; ln -sf ../../../library/backend/*.h .; )
78 ( cd include/opie && rm -f *.h; ln -sf ../../libopie/*.h .; rm -f *_p.h; ) 80 ( cd include/opie && rm -f *.h; ln -sf ../../libopie/*.h .; rm -f *_p.h; )
79 ( cd include/opie && ln -sf ../../libsql/*.h .; ) 81 ( cd include/opie && ln -sf ../../libsql/*.h .; )
80 ( cd include/opie && ln -sf ../../libopie/pim/*.h .; ) 82 ( cd include/opie && ln -sf ../../libopie/pim/*.h .; )
81 ( cd include/opie; for generatedHeader in `cd ../../libopie; ls *.ui | sed -e "s,\.ui,\.h,g"`; do \ 83 ( cd include/opie; for generatedHeader in `cd ../../libopie; ls *.ui | sed -e "s,\.ui,\.h,g"`; do \
82 ln -sf ../../libopie/$$generatedHeader $$generatedHeader; done ) 84 ln -sf ../../libopie/$$generatedHeader $$generatedHeader; done )
83 ln -sf ../../library/custom.h $(TOPDIR)/include/qpe/custom.h 85 ln -sf ../../library/custom.h $(TOPDIR)/include/qpe/custom.h
84 ( cd include/qpe; ln -sf ../../x11/libqpe-x11/qpe/*.h .; ) 86 ( cd include/qpe; ln -sf ../../x11/libqpe-x11/qpe/*.h .; )
85 touch $@ 87 touch $@
86 88
87$(TOPDIR)/library/custom.h : $(TOPDIR)/.config 89$(TOPDIR)/library/custom.h : $(TOPDIR)/.config
88 @-rm -f $@ 90 @-rm -f $@
89 @$(if $(patsubst "%",%,$(CONFIG_CUSTOMFILE)),\ 91 @$(if $(patsubst "%",%,$(CONFIG_CUSTOMFILE)),\
90 ln -sf $(patsubst "%",%,$(CONFIG_CUSTOMFILE)) $@) 92 ln -sf $(patsubst "%",%,$(CONFIG_CUSTOMFILE)) $@)
91 @touch $@ 93 @touch $@
92 94
93$(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 : 95$(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 :
94 $(call descend,$(shell dirname $@),$(shell basename $@)) 96 $(call descend,$(shell dirname $@),$(shell basename $@))
95 97
96$(TOPDIR)/qmake/qmake : $(TOPDIR)/mkspecs/default 98$(TOPDIR)/qmake/qmake : $(TOPDIR)/mkspecs/default
97 99
98$(TOPDIR)/mkspecs/default : 100$(TOPDIR)/mkspecs/default :
99 ln -sf linux-g++ $@ 101 ln -sf linux-g++ $@
100 102
103$(TOPDIR)/scripts/subst : FORCE
104 @( \
105 echo 's,\$$QPE_VERSION,$(QPE_VERSION),g'; \
106 echo 's,\$$QTE_VERSION,$(QTE_VERSION),g'; \
107 echo 's,\$$QTE_REVISION,$(QTE_REVISION),g'; \
108 echo 's,\$$SUB_VERSION,$(SUB_VERSION),g'; \
109 echo 's,\$$QTE_BASEVERSION,$(QTE_BASEVERSION),g'; \
110 ) > $@ || ( rm -f $@; exit 1 )
111
112$(TOPDIR)/scripts/filesubst : FORCE
113 @( \
114 echo 's,\$$OPIEDIR,$(prefix),g'; \
115 echo 's,\$$QTDIR,$(prefix),g'; \
116 echo 's,^root/,/,g'; \
117 echo 's,^etc/,/etc/,g'; \
118 echo 's,^lib/,$(prefix)/lib/,g'; \
119 ) > $@ || ( rm -f $@; exit 1 )
120
101## general rules ## 121## general rules ##
102 122
103define descend 123define descend
104 $(MAKE) $(if $(QMAKE),QMAKE=$(QMAKE)) -C $(1) $(2) 124 $(MAKE) $(if $(QMAKE),QMAKE=$(QMAKE)) -C $(1) $(2)
105endef 125endef
106 126
107define makefilegen 127define makefilegen
108 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$$,,'\`" | \ 128 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$$,,'\`" | \
109 head -1 | awk '{print $$3}'` 129 head -1 | awk '{print $$3}'`
110endef 130endef
111 131
112define makecfg 132define makecfg
113 $(TOPDIR)/scripts/makecfg.pl $1 $(OPIEDIR) 133 $(TOPDIR)/scripts/makecfg.pl $1 $(OPIEDIR)
114endef 134endef