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