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