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