author | kergoth <kergoth> | 2002-11-05 23:26:33 (UTC) |
---|---|---|
committer | kergoth <kergoth> | 2002-11-05 23:26:33 (UTC) |
commit | 76f38e36b7a875a1763d1e6ce5e00cc8dd736263 (patch) (unidiff) | |
tree | 758e4858912d3ef391200d312a188fc9bffa91d9 | |
parent | b14da9c14c5f1968fb4ba07c3fa0b3888e57ff2f (diff) | |
download | opie-76f38e36b7a875a1763d1e6ce5e00cc8dd736263.zip opie-76f38e36b7a875a1763d1e6ce5e00cc8dd736263.tar.gz opie-76f38e36b7a875a1763d1e6ce5e00cc8dd736263.tar.bz2 |
Adjust makefile to check both /usr/share/qt and /usr/lib/qt for QTDIR, and to check for the existance of qt-mt and qt both
-rw-r--r-- | scripts/kconfig/Makefile | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile index 7553311..caad231 100644 --- a/scripts/kconfig/Makefile +++ b/scripts/kconfig/Makefile | |||
@@ -1,178 +1,198 @@ | |||
1 | VERSION=1.2 | 1 | VERSION=1.2 |
2 | CC=gcc | 2 | CC=gcc |
3 | CXX=g++ | 3 | CXX=g++ |
4 | CFLAGS=-O2 -Wall -g -fPIC | 4 | CFLAGS=-O2 -Wall -g -fPIC |
5 | CXXFLAGS=$(CFLAGS) -I$(HOSTQTDIR)/include | 5 | CXXFLAGS=$(CFLAGS) -I$(HOSTQTDIR)/include |
6 | LDFLAGS= | 6 | LDFLAGS= |
7 | LXXFLAGS=$(LDFLAGS) -L$(HOSTQTDIR)/lib -Wl,-rpath,$(HOSTQTDIR)/lib | 7 | LXXFLAGS=$(LDFLAGS) -L$(HOSTQTDIR)/lib -Wl,-rpath,$(HOSTQTDIR)/lib |
8 | LEX=flex | 8 | LEX=flex |
9 | YACC=bison | 9 | YACC=bison |
10 | YFLAGS=-d -t -v | 10 | YFLAGS=-d -t -v |
11 | ifndef HOSTQTDIR | 11 | ifndef HOSTQTDIR |
12 | ifeq ($(shell if [ -e /usr/share/qt ]; then echo foundit; fi),foundit) | ||
12 | HOSTQTDIR=/usr/share/qt | 13 | HOSTQTDIR=/usr/share/qt |
14 | else | ||
15 | ifeq ($(shell if [ -e /usr/lib/qt ]; then echo foundit; fi),foundit) | ||
16 | HOSTQTDIR=/usr/lib/qt | ||
17 | endif | ||
18 | endif | ||
19 | endif | ||
20 | |||
21 | ifndef QTLIB | ||
22 | ifeq ($(shell if [ -e $(HOSTQTDIR)/lib/libqt.so ]; then echo foundit; fi),foundit) | ||
23 | QTLIB=-lqt | ||
24 | else | ||
25 | ifeq ($(shell if [ -e $(HOSTQTDIR)/lib/libqt-mt.so ]; then echo foundit; fi),foundit) | ||
26 | QTLIB=-lqt-mt | ||
27 | else | ||
28 | QTLIB=-lqt | ||
29 | $(warning Unable to locate libqt.so!) | ||
30 | endif | ||
13 | endif | 31 | endif |
32 | endif | ||
33 | |||
14 | MOC=$(wildcard $(HOSTQTDIR)/bin/moc) | 34 | MOC=$(wildcard $(HOSTQTDIR)/bin/moc) |
15 | 35 | ||
16 | parse_SRC=zconf.y | 36 | parse_SRC=zconf.y |
17 | conf_SRC=conf.c $(parse_SRC) | 37 | conf_SRC=conf.c $(parse_SRC) |
18 | mconf_SRC=mconf.c $(parse_SRC) | 38 | mconf_SRC=mconf.c $(parse_SRC) |
19 | qconf_SRC=qconf.cc | 39 | qconf_SRC=qconf.cc |
20 | lkcc_SRC=cml1.y cml1.l help.l cml1.h expr1.c | 40 | lkcc_SRC=cml1.y cml1.l help.l cml1.h expr1.c |
21 | HDR=expr.h lkc.h lkc_proto.h qconf.h | 41 | HDR=expr.h lkc.h lkc_proto.h qconf.h |
22 | OTHER=README lkc_spec lkc_overview Makefile.kernel convert-all prepare-all.diff fixup-all.diff \ | 42 | OTHER=README lkc_spec lkc_overview Makefile.kernel convert-all prepare-all.diff fixup-all.diff \ |
23 | kconfig.i extconf.rb example | 43 | kconfig.i extconf.rb example |
24 | INST=zconf.y zconf.l confdata.c expr.c symbol.c menu.c conf.c mconf.c qconf.cc kconfig_load.c images.c $(parse_SRC) $(HDR) | 44 | INST=zconf.y zconf.l confdata.c expr.c symbol.c menu.c conf.c mconf.c qconf.cc kconfig_load.c images.c $(parse_SRC) $(HDR) |
25 | INSTGEN=lex.zconf.c zconf.tab.c zconf.tab.h | 45 | INSTGEN=lex.zconf.c zconf.tab.c zconf.tab.h |
26 | 46 | ||
27 | #DEBUG=1 | 47 | #DEBUG=1 |
28 | ifdef DEBUG | 48 | ifdef DEBUG |
29 | CFLAGS+=-DLKC_DIRECT_LINK | 49 | CFLAGS+=-DLKC_DIRECT_LINK |
30 | qconf_SRC+=$(parse_SRC) | 50 | qconf_SRC+=$(parse_SRC) |
31 | else | 51 | else |
32 | qconf_SRC+=kconfig_load.c | 52 | qconf_SRC+=kconfig_load.c |
33 | endif | 53 | endif |
34 | 54 | ||
35 | SRC=$(conf_SRC) $(mconf_SRC) $(qconf_SRC) $(lkcc_SRC) | 55 | SRC=$(conf_SRC) $(mconf_SRC) $(qconf_SRC) $(lkcc_SRC) |
36 | CSRC=$(filter %.c, $(SRC)) | 56 | CSRC=$(filter %.c, $(SRC)) |
37 | YSRC=$(filter %.y, $(SRC)) | 57 | YSRC=$(filter %.y, $(SRC)) |
38 | LSRC=$(filter %.l, $(SRC)) | 58 | LSRC=$(filter %.l, $(SRC)) |
39 | 59 | ||
40 | parse_OBJ=$(filter %.o, \ | 60 | parse_OBJ=$(filter %.o, \ |
41 | $(patsubst %.c,%.o, \ | 61 | $(patsubst %.c,%.o, \ |
42 | $(patsubst %.y,%.tab.o, \ | 62 | $(patsubst %.y,%.tab.o, \ |
43 | $(patsubst %.l,lex.%.o, \ | 63 | $(patsubst %.l,lex.%.o, \ |
44 | $(parse_SRC))))) | 64 | $(parse_SRC))))) |
45 | conf_OBJ=$(filter %.o, \ | 65 | conf_OBJ=$(filter %.o, \ |
46 | $(patsubst %.c,%.o, \ | 66 | $(patsubst %.c,%.o, \ |
47 | $(patsubst %.y,%.tab.o, \ | 67 | $(patsubst %.y,%.tab.o, \ |
48 | $(patsubst %.l,lex.%.o, \ | 68 | $(patsubst %.l,lex.%.o, \ |
49 | $(conf_SRC))))) | 69 | $(conf_SRC))))) |
50 | mconf_OBJ=$(filter %.o, \ | 70 | mconf_OBJ=$(filter %.o, \ |
51 | $(patsubst %.c,%.o, \ | 71 | $(patsubst %.c,%.o, \ |
52 | $(patsubst %.y,%.tab.o, \ | 72 | $(patsubst %.y,%.tab.o, \ |
53 | $(patsubst %.l,lex.%.o, \ | 73 | $(patsubst %.l,lex.%.o, \ |
54 | $(mconf_SRC))))) | 74 | $(mconf_SRC))))) |
55 | qconf_OBJ=$(filter %.o, \ | 75 | qconf_OBJ=$(filter %.o, \ |
56 | $(patsubst %.c,%.o, \ | 76 | $(patsubst %.c,%.o, \ |
57 | $(patsubst %.cc,%.o, \ | 77 | $(patsubst %.cc,%.o, \ |
58 | $(patsubst %.y,%.tab.o, \ | 78 | $(patsubst %.y,%.tab.o, \ |
59 | $(patsubst %.l,lex.%.o, \ | 79 | $(patsubst %.l,lex.%.o, \ |
60 | $(qconf_SRC)))))) | 80 | $(qconf_SRC)))))) |
61 | lkcc_OBJ=$(filter %.o, \ | 81 | lkcc_OBJ=$(filter %.o, \ |
62 | $(patsubst %.c,%.o, \ | 82 | $(patsubst %.c,%.o, \ |
63 | $(patsubst %.y,%.tab.o, \ | 83 | $(patsubst %.y,%.tab.o, \ |
64 | $(patsubst %.l,lex.%.o, \ | 84 | $(patsubst %.l,lex.%.o, \ |
65 | $(lkcc_SRC))))) | 85 | $(lkcc_SRC))))) |
66 | OBJ=$(conf_OBJ) $(mconf_OBJ) $(qconf_OBJ) $(lkcc_OBJ) | 86 | OBJ=$(conf_OBJ) $(mconf_OBJ) $(qconf_OBJ) $(lkcc_OBJ) |
67 | 87 | ||
68 | ifeq ($(MOC),) | 88 | ifeq ($(MOC),) |
69 | all: lkcc conf mconf | 89 | all: lkcc conf mconf |
70 | else | 90 | else |
71 | all: lkcc conf mconf qconf libkconfig.so | 91 | all: lkcc conf mconf qconf libkconfig.so |
72 | endif | 92 | endif |
73 | 93 | ||
74 | lex.help.c: help.l | 94 | lex.help.c: help.l |
75 | lex.help.o: lex.help.c cml1.h expr.h | 95 | lex.help.o: lex.help.c cml1.h expr.h |
76 | lex.cml1.c: cml1.l | 96 | lex.cml1.c: cml1.l |
77 | lex.cml1.o: lex.cml1.c cml1.tab.h cml1.h expr.h | 97 | lex.cml1.o: lex.cml1.c cml1.tab.h cml1.h expr.h |
78 | cml1.tab.c: cml1.y | 98 | cml1.tab.c: cml1.y |
79 | cml1.tab.h: cml1.y | 99 | cml1.tab.h: cml1.y |
80 | cml1.tab.o: cml1.tab.c cml1.h expr.h | 100 | cml1.tab.o: cml1.tab.c cml1.h expr.h |
81 | expr1.o: expr1.c expr.h | 101 | expr1.o: expr1.c expr.h |
82 | 102 | ||
83 | lkc_deps := lkc.h lkc_proto.h lkc_defs.h expr.h | 103 | lkc_deps := lkc.h lkc_proto.h lkc_defs.h expr.h |
84 | 104 | ||
85 | zconf.tab.c: zconf.y | 105 | zconf.tab.c: zconf.y |
86 | zconf.tab.h: zconf.y | 106 | zconf.tab.h: zconf.y |
87 | lex.zconf.c: zconf.l | 107 | lex.zconf.c: zconf.l |
88 | zconf.tab.o: zconf.tab.c lex.zconf.c confdata.c expr.c symbol.c menu.c $(lkc_deps) | 108 | zconf.tab.o: zconf.tab.c lex.zconf.c confdata.c expr.c symbol.c menu.c $(lkc_deps) |
89 | #lex.zconf.o: lex.zconf.c zconf.tab.h $(lkc_deps) | 109 | #lex.zconf.o: lex.zconf.c zconf.tab.h $(lkc_deps) |
90 | #confdata.o: confdata.c $(lkc_deps) | 110 | #confdata.o: confdata.c $(lkc_deps) |
91 | #expr.o: expr.c $(lkc_deps) | 111 | #expr.o: expr.c $(lkc_deps) |
92 | #symbol.o: symbol.c $(lkc_deps) | 112 | #symbol.o: symbol.c $(lkc_deps) |
93 | #menu.o: menu.c $(lkc_deps) | 113 | #menu.o: menu.c $(lkc_deps) |
94 | kconfig_load.o: kconfig_load.c $(lkc_deps) | 114 | kconfig_load.o: kconfig_load.c $(lkc_deps) |
95 | conf.o: conf.c $(lkc_deps) | 115 | conf.o: conf.c $(lkc_deps) |
96 | mconf.o: mconf.c $(lkc_deps) | 116 | mconf.o: mconf.c $(lkc_deps) |
97 | qconf.moc: qconf.h | 117 | qconf.moc: qconf.h |
98 | qconf.o: qconf.cc qconf.moc images.c $(lkc_deps) | 118 | qconf.o: qconf.cc qconf.moc images.c $(lkc_deps) |
99 | 119 | ||
100 | mconf: $(mconf_OBJ) | 120 | mconf: $(mconf_OBJ) |
101 | $(CC) $(LDFLAGS) $^ -o $@ | 121 | $(CC) $(LDFLAGS) $^ -o $@ |
102 | 122 | ||
103 | conf: $(conf_OBJ) | 123 | conf: $(conf_OBJ) |
104 | $(CC) $(LDFLAGS) $^ -o $@ | 124 | $(CC) $(LDFLAGS) $^ -o $@ |
105 | 125 | ||
106 | ifeq ($(MOC),) | 126 | ifeq ($(MOC),) |
107 | qconf: | 127 | qconf: |
108 | @echo Unable to find the QT installation. Please make sure that the | 128 | @echo Unable to find the QT installation. Please make sure that the |
109 | @echo QT development package is correctly installed and the HOSTQTDIR | 129 | @echo QT development package is correctly installed and the HOSTQTDIR |
110 | @echo environment variable is set to the correct location. | 130 | @echo environment variable is set to the correct location. |
111 | @false | 131 | @false |
112 | else | 132 | else |
113 | qconf: $(qconf_OBJ) libkconfig.so | 133 | qconf: $(qconf_OBJ) libkconfig.so |
114 | $(CXX) $(LXXFLAGS) $^ -lqt -o $@ | 134 | $(CXX) $(LXXFLAGS) $^ $(QTLIB) -o $@ |
115 | endif | 135 | endif |
116 | 136 | ||
117 | lkcc: $(lkcc_OBJ) | 137 | lkcc: $(lkcc_OBJ) |
118 | $(CC) $(LDFLAGS) $^ -o $@ | 138 | $(CC) $(LDFLAGS) $^ -o $@ |
119 | 139 | ||
120 | libkconfig.so: $(parse_OBJ) | 140 | libkconfig.so: $(parse_OBJ) |
121 | $(CC) -shared $^ -o $@ | 141 | $(CC) -shared $^ -o $@ |
122 | 142 | ||
123 | lkc_defs.h: lkc_proto.h | 143 | lkc_defs.h: lkc_proto.h |
124 | sed < $< > $@ 's/P(\([^,]*\),.*/#define \1 (\*\1_p)/' | 144 | sed < $< > $@ 's/P(\([^,]*\),.*/#define \1 (\*\1_p)/' |
125 | 145 | ||
126 | clean: | 146 | clean: |
127 | rm -f $(OBJ) lkcc conf qconf mconf *.moc lex.* *.tab.? *.output | 147 | rm -f $(OBJ) lkcc conf qconf mconf *.moc lex.* *.tab.? *.output |
128 | 148 | ||
129 | tgz: | 149 | tgz: |
130 | mkdir tmp | 150 | mkdir tmp |
131 | mkdir tmp/lkc-$(VERSION) | 151 | mkdir tmp/lkc-$(VERSION) |
132 | cp -ra Makefile $(sort $(SRC) $(HDR) $(OTHER) $(INST)) tmp/lkc-$(VERSION) | 152 | cp -ra Makefile $(sort $(SRC) $(HDR) $(OTHER) $(INST)) tmp/lkc-$(VERSION) |
133 | tar -cpvz -C tmp -f lkc-$(VERSION).tar.gz lkc-$(VERSION) | 153 | tar -cpvz -C tmp -f lkc-$(VERSION).tar.gz lkc-$(VERSION) |
134 | rm -rf tmp | 154 | rm -rf tmp |
135 | 155 | ||
136 | %.tab.c %.tab.h: %.y | 156 | %.tab.c %.tab.h: %.y |
137 | $(YACC) $(YFLAGS) -b $* -p $* $< | 157 | $(YACC) $(YFLAGS) -b $* -p $* $< |
138 | 158 | ||
139 | lex.%.c: %.l | 159 | lex.%.c: %.l |
140 | $(LEX) $(LFLAGS) -P$* $< | 160 | $(LEX) $(LFLAGS) -P$* $< |
141 | 161 | ||
142 | %.moc: %.h | 162 | %.moc: %.h |
143 | $(HOSTQTDIR)/bin/moc -i $< -o $@ | 163 | $(HOSTQTDIR)/bin/moc -i $< -o $@ |
144 | 164 | ||
145 | %.o: %.c | 165 | %.o: %.c |
146 | $(CC) $(CFLAGS) -c $< -o $@ | 166 | $(CC) $(CFLAGS) -c $< -o $@ |
147 | 167 | ||
148 | %.o: %.cc | 168 | %.o: %.cc |
149 | $(CXX) $(CXXFLAGS) -c $< -o $@ | 169 | $(CXX) $(CXXFLAGS) -c $< -o $@ |
150 | 170 | ||
151 | ifdef KERNELSRC | 171 | ifdef KERNELSRC |
152 | install: lkcc $(INSTGEN) | 172 | install: lkcc $(INSTGEN) |
153 | set -x; mkdir $(KERNELSRC)/scripts/kconfig; \ | 173 | set -x; mkdir $(KERNELSRC)/scripts/kconfig; \ |
154 | cp $(sort $(INST)) $(KERNELSRC)/scripts/kconfig; \ | 174 | cp $(sort $(INST)) $(KERNELSRC)/scripts/kconfig; \ |
155 | for f in $(INSTGEN); do cp $$f $(KERNELSRC)/scripts/kconfig/$${f}_shipped; done; \ | 175 | for f in $(INSTGEN); do cp $$f $(KERNELSRC)/scripts/kconfig/$${f}_shipped; done; \ |
156 | cp Makefile.kernel $(KERNELSRC)/scripts/kconfig/Makefile; \ | 176 | cp Makefile.kernel $(KERNELSRC)/scripts/kconfig/Makefile; \ |
157 | LKCSRC=$$PWD; export LKCSRC; \ | 177 | LKCSRC=$$PWD; export LKCSRC; \ |
158 | cd $(KERNELSRC); \ | 178 | cd $(KERNELSRC); \ |
159 | patch -p0 -N < $$LKCSRC/prepare-all.diff; \ | 179 | patch -p0 -N < $$LKCSRC/prepare-all.diff; \ |
160 | sh $$LKCSRC/convert-all; \ | 180 | sh $$LKCSRC/convert-all; \ |
161 | patch -p0 -N < $$LKCSRC/fixup-all.diff | 181 | patch -p0 -N < $$LKCSRC/fixup-all.diff |
162 | 182 | ||
163 | #cp Makefile $(KERNELSRC)/scripts/kconfig/Makefile; \ | 183 | #cp Makefile $(KERNELSRC)/scripts/kconfig/Makefile; \ |
164 | 184 | ||
165 | uninstall: | 185 | uninstall: |
166 | patch -p0 -N -R -d $(KERNELSRC) < prepare-all.diff; \ | 186 | patch -p0 -N -R -d $(KERNELSRC) < prepare-all.diff; \ |
167 | cd $(KERNELSRC); \ | 187 | cd $(KERNELSRC); \ |
168 | find -name "Kconfig*" | xargs rm; \ | 188 | find -name "Kconfig*" | xargs rm; \ |
169 | rm -rf scripts/kconfig log.* | 189 | rm -rf scripts/kconfig log.* |
170 | else | 190 | else |
171 | install: | 191 | install: |
172 | @echo "Please use KERNELSRC=<path/to/linux-kernel> to install" | 192 | @echo "Please use KERNELSRC=<path/to/linux-kernel> to install" |
173 | endif | 193 | endif |
174 | 194 | ||
175 | ruby: .ruby libkconfig.so .ruby/kconfig.so | 195 | ruby: .ruby libkconfig.so .ruby/kconfig.so |
176 | 196 | ||
177 | .ruby: | 197 | .ruby: |
178 | mkdir .ruby | 198 | mkdir .ruby |