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