summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--Rules.make4
1 files changed, 1 insertions, 3 deletions
diff --git a/Rules.make b/Rules.make
index d5c6b24..16c6455 100644
--- a/Rules.make
+++ b/Rules.make
@@ -1,108 +1,106 @@
1## targets ##
2
3$(configs) : 1$(configs) :
4 $(call makecfg,$@) 2 $(call makecfg,$@)
5 3
6$(TOPDIR)/gen.pro : $(TOPDIR)/.config 4$(TOPDIR)/gen.pro : $(TOPDIR)/.config
7 echo > $@ 5 echo > $@
8ifneq ($(CONFIG_DEBUG),) 6ifneq ($(CONFIG_DEBUG),)
9 echo CONFIG += debug >> $@ 7 echo CONFIG += debug >> $@
10 echo CONFIG -= release >> $@ 8 echo CONFIG -= release >> $@
11else 9else
12 echo CONFIG -= debug >> $@ 10 echo CONFIG -= debug >> $@
13 echo CONFIG += release >> $@ 11 echo CONFIG += release >> $@
14endif 12endif
15 13
16$(TOPDIR)/.depends : $(shell if [ -e $(TOPDIR)/config.in ]\; then echo $(TOPDIR)/config.in\; fi\;) $(TOPDIR)/.config $(TOPDIR)/packages 14$(TOPDIR)/.depends : $(shell if [ -e $(TOPDIR)/config.in ]\; then echo $(TOPDIR)/config.in\; fi\;) $(TOPDIR)/.config $(TOPDIR)/packages
17 @echo Generating dependency information... 15 @echo Generating dependency information...
18# add to subdir-y, and add descend rules 16# add to subdir-y, and add descend rules
19 @cat $(TOPDIR)/packages | grep -v '^#' | \ 17 @cat $(TOPDIR)/packages | grep -v '^#' | \
20 awk '{print \ 18 awk '{print \
21 ".PHONY : " $$2 "\n" \ 19 ".PHONY : " $$2 "\n" \
22 "subdir-$$(" $$1 ") += " $$2 "\n\n"; \ 20 "subdir-$$(" $$1 ") += " $$2 "\n\n"; \
23 print $$2 " : " $$2 "/Makefile\n\t$$(call descend,$$@,$(filter-out $$@,$$(filter-out $$@,$$(MAKECMDGOALS))))\n"; }' > $(TOPDIR)/.depends 21 print $$2 " : " $$2 "/Makefile\n\t$$(call descend,$$@,$(filter-out $$@,$$(filter-out $$@,$$(MAKECMDGOALS))))\n"; }' > $(TOPDIR)/.depends
24 cat $(TOPDIR)/packages | grep -v '^#' | \ 22 cat $(TOPDIR)/packages | grep -v '^#' | \
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"; }' \ 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"; }' \
26 >> $(TOPDIR)/.depends 24 >> $(TOPDIR)/.depends
27# interpackage dependency generation 25# interpackage dependency generation
28 @cat $(TOPDIR)/packages | \ 26 @cat $(TOPDIR)/packages | \
29 $(TOPDIR)/scripts/deps.pl >> $(TOPDIR)/.depends 27 $(TOPDIR)/scripts/deps.pl >> $(TOPDIR)/.depends
30 28
31$(TOPDIR)/.depends.cfgs: 29$(TOPDIR)/.depends.cfgs:
32# config.in interdependencies 30# config.in interdependencies
33 @echo $(configs) | sed -e 's,/config.in,,g' | ( for i in `cat`; do echo $$i; done ) > dirs 31 @echo $(configs) | sed -e 's,/config.in,,g' | ( for i in `cat`; do echo $$i; done ) > dirs
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 ) >> $@ 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 ) >> $@
35 @-rm -f dirs 33 @-rm -f dirs
36 34
37$(QTDIR)/stamp-headers : 35$(QTDIR)/stamp-headers :
38 @-rm -f $(QTDIR)/stamp-headers* 36 @-rm -f $(QTDIR)/stamp-headers*
39 ( cd $(QTDIR)/include; \ 37 ( cd $(QTDIR)/include; \
40 $(patsubst %,ln -sf ../src/kernel/%;,qgfx_qws.h qwsmouse_qws.h \ 38 $(patsubst %,ln -sf ../src/kernel/%;,qgfx_qws.h qwsmouse_qws.h \
41 qcopchannel_qws.h qwindowsystem_qws.h \ 39 qcopchannel_qws.h qwindowsystem_qws.h \
42 qfontmanager_qws.h qwsdefaultdecoration_qws.h)) 40 qfontmanager_qws.h qwsdefaultdecoration_qws.h))
43 touch $@ 41 touch $@
44 42
45$(QTDIR)/stamp-headers-x11 : 43$(QTDIR)/stamp-headers-x11 :
46 @-rm -f $(QTDIR)/stamp-headers* 44 @-rm -f $(QTDIR)/stamp-headers*
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) 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)
48 touch $@ 46 touch $@
49 47
50$(OPIEDIR)/stamp-headers : 48$(OPIEDIR)/stamp-headers :
51 @-rm -f $(OPIEDIR)/stamp-headers* 49 @-rm -f $(OPIEDIR)/stamp-headers*
52 mkdir -p $(TOPDIR)/include/qpe $(TOPDIR)/include/qtopia \ 50 mkdir -p $(TOPDIR)/include/qpe $(TOPDIR)/include/qtopia \
53 $(TOPDIR)/include/opie $(TOPDIR)/include/qtopia/private 51 $(TOPDIR)/include/opie $(TOPDIR)/include/qtopia/private
54 ( cd include/qpe && rm -f *.h; ln -sf ../../library/*.h .; ln -sf ../../library/backend/*.h .; rm -f *_p.h; ) 52 ( cd include/qpe && rm -f *.h; ln -sf ../../library/*.h .; ln -sf ../../library/backend/*.h .; rm -f *_p.h; )
55 ( cd include/qtopia && rm -f *.h; ln -sf ../../library/*.h .; ) 53 ( cd include/qtopia && rm -f *.h; ln -sf ../../library/*.h .; )
56 ( cd include/qtopia/private && rm -f *.h; ln -sf ../../../library/backend/*.h .; ) 54 ( cd include/qtopia/private && rm -f *.h; ln -sf ../../../library/backend/*.h .; )
57 ( cd include/opie && rm -f *.h; ln -sf ../../libopie/*.h .; rm -f *_p.h; ) 55 ( cd include/opie && rm -f *.h; ln -sf ../../libopie/*.h .; rm -f *_p.h; )
58 ( cd include/opie && ln -sf ../../libsql/*.h .; ) 56 ( cd include/opie && ln -sf ../../libsql/*.h .; )
59 ( cd include/opie && ln -sf ../../libopie/pim/*.h .; ) 57 ( cd include/opie && ln -sf ../../libopie/pim/*.h .; )
60 ( cd include/opie; for generatedHeader in `cd ../../libopie; ls *.ui | sed -e "s,\.ui,\.h,g"`; do \ 58 ( cd include/opie; for generatedHeader in `cd ../../libopie; ls *.ui | sed -e "s,\.ui,\.h,g"`; do \
61 ln -sf ../../libopie/$$generatedHeader $$generatedHeader; done ) 59 ln -sf ../../libopie/$$generatedHeader $$generatedHeader; done )
62 ln -sf ../../library/custom.h $(TOPDIR)/include/qpe/custom.h 60 ln -sf ../../library/custom.h $(TOPDIR)/include/qpe/custom.h
63 touch $@ 61 touch $@
64 62
65$(OPIEDIR)/stamp-headers-x11 : 63$(OPIEDIR)/stamp-headers-x11 :
66 @-rm -f $(OPIEDIR)/stamp-headers* 64 @-rm -f $(OPIEDIR)/stamp-headers*
67 mkdir -p $(TOPDIR)/include/qpe $(TOPDIR)/include/qtopia \ 65 mkdir -p $(TOPDIR)/include/qpe $(TOPDIR)/include/qtopia \
68 $(TOPDIR)/include/opie $(TOPDIR)/include/qtopia/private 66 $(TOPDIR)/include/opie $(TOPDIR)/include/qtopia/private
69 ( cd include/qpe && rm -f *.h; ln -sf ../../library/*.h .; ln -sf ../../library/backend/*.h .; rm -f *_p.h; ) 67 ( cd include/qpe && rm -f *.h; ln -sf ../../library/*.h .; ln -sf ../../library/backend/*.h .; rm -f *_p.h; )
70 ( cd include/qtopia && rm -f *.h; ln -sf ../../library/*.h .; ) 68 ( cd include/qtopia && rm -f *.h; ln -sf ../../library/*.h .; )
71 ( cd include/qtopia/private && rm -f *.h; ln -sf ../../../library/backend/*.h .; ) 69 ( cd include/qtopia/private && rm -f *.h; ln -sf ../../../library/backend/*.h .; )
72 ( cd include/opie && rm -f *.h; ln -sf ../../libopie/*.h .; rm -f *_p.h; ) 70 ( cd include/opie && rm -f *.h; ln -sf ../../libopie/*.h .; rm -f *_p.h; )
73 ( cd include/opie && ln -sf ../../libsql/*.h .; ) 71 ( cd include/opie && ln -sf ../../libsql/*.h .; )
74 ( cd include/opie && ln -sf ../../libopie/pim/*.h .; ) 72 ( cd include/opie && ln -sf ../../libopie/pim/*.h .; )
75 ( cd include/opie; for generatedHeader in `cd ../../libopie; ls *.ui | sed -e "s,\.ui,\.h,g"`; do \ 73 ( cd include/opie; for generatedHeader in `cd ../../libopie; ls *.ui | sed -e "s,\.ui,\.h,g"`; do \
76 ln -sf ../../libopie/$$generatedHeader $$generatedHeader; done ) 74 ln -sf ../../libopie/$$generatedHeader $$generatedHeader; done )
77 ln -sf ../../library/custom.h $(TOPDIR)/include/qpe/custom.h 75 ln -sf ../../library/custom.h $(TOPDIR)/include/qpe/custom.h
78 ( cd include/qpe; ln -sf ../../x11/libqpe-x11/qpe/*.h .; ) 76 ( cd include/qpe; ln -sf ../../x11/libqpe-x11/qpe/*.h .; )
79 touch $@ 77 touch $@
80 78
81$(TOPDIR)/library/custom.h : $(TOPDIR)/.config 79$(TOPDIR)/library/custom.h : $(TOPDIR)/.config
82 @-rm -f $@ 80 @-rm -f $@
83 @$(if $(patsubst "%",%,$(CONFIG_CUSTOMFILE)),\ 81 @$(if $(patsubst "%",%,$(CONFIG_CUSTOMFILE)),\
84 ln -sf $(patsubst "%",%,$(CONFIG_CUSTOMFILE)) $@) 82 ln -sf $(patsubst "%",%,$(CONFIG_CUSTOMFILE)) $@)
85 @touch $@ 83 @touch $@
86 84
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 : 85$(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 :
88 $(call descend,$(shell dirname $@),$(shell basename $@)) 86 $(call descend,$(shell dirname $@),$(shell basename $@))
89 87
90$(TOPDIR)/qmake/qmake : $(TOPDIR)/mkspecs/default 88$(TOPDIR)/qmake/qmake : $(TOPDIR)/mkspecs/default
91 89
92$(TOPDIR)/mkspecs/default : 90$(TOPDIR)/mkspecs/default :
93 ln -sf linux-g++ $@ 91 ln -sf linux-g++ $@
94 92
95## general rules ## 93## general rules ##
96 94
97define descend 95define descend
98 $(MAKE) $(if $(QMAKE),QMAKE=$(QMAKE)) -C $(1) $(2) 96 $(MAKE) $(if $(QMAKE),QMAKE=$(QMAKE)) -C $(1) $(2)
99endef 97endef
100 98
101define makefilegen 99define makefilegen
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$$,,'\`" | \ 100 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$$,,'\`" | \
103 head -1 | awk '{print $$3}'` 101 head -1 | awk '{print $$3}'`
104endef 102endef
105 103
106define makecfg 104define makecfg
107 $(TOPDIR)/scripts/makecfg.pl $1 $(OPIEDIR) 105 $(TOPDIR)/scripts/makecfg.pl $1 $(OPIEDIR)
108endef 106endef