-rw-r--r-- | scripts/kconfig/Makefile | 51 |
1 files changed, 34 insertions, 17 deletions
diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile index 5a0d7e5..b918300 100644 --- a/scripts/kconfig/Makefile +++ b/scripts/kconfig/Makefile | |||
@@ -1,29 +1,32 @@ | |||
1 | VERSION=1.3 | 1 | VERSION=1.4 |
2 | CC=gcc | 2 | CC=gcc |
3 | CXX=g++ | 3 | CXX=g++ |
4 | CFLAGS=-O0 -Wall -g -fPIC | 4 | CFLAGS=-O0 -Wall -g -fPIC |
5 | CXXFLAGS=$(CFLAGS) -I$(HOSTQTDIR)/include | 5 | CXXFLAGS=$(CFLAGS) -I$(QTDIR)/include |
6 | LDFLAGS= | 6 | LDFLAGS= |
7 | LXXFLAGS=$(LDFLAGS) -L$(HOSTQTDIR)/lib -Wl,-rpath,$(HOSTQTDIR)/lib | 7 | LXXFLAGS=$(LDFLAGS) -L$(QTDIR)/lib -Wl,-rpath,$(QTDIR)/lib |
8 | LEX=flex | 8 | LEX=flex |
9 | LFLAGS=-L | 9 | LFLAGS=-L |
10 | YACC=bison | 10 | YACC=bison |
11 | YFLAGS=-l | 11 | YFLAGS=-l |
12 | #YFLAGS=-d -t -v -l | 12 | #YFLAGS=-t -v -l |
13 | ifndef HOSTQTDIR | 13 | ifndef QTDIR |
14 | HOSTQTDIR=/usr/share/qt | 14 | QTDIR=/usr/share/qt3 |
15 | endif | 15 | endif |
16 | MOC=$(wildcard $(HOSTQTDIR)/bin/moc) | 16 | MOC=$(wildcard $(QTDIR)/bin/moc) |
17 | GTKCFLAGS=`pkg-config gtk+-2.0 gmodule-2.0 libglade-2.0 --cflags` | ||
18 | GTKLDFLAGS=`pkg-config gtk+-2.0 gmodule-2.0 libglade-2.0 --libs` | ||
17 | 19 | ||
18 | parse_SRC=zconf.y | 20 | parse_SRC=zconf.y |
19 | conf_SRC=conf.c $(parse_SRC) | 21 | conf_SRC=conf.c $(parse_SRC) |
20 | mconf_SRC=mconf.c $(parse_SRC) | 22 | mconf_SRC=mconf.c $(parse_SRC) |
21 | qconf_SRC=qconf.cc | 23 | qconf_SRC=qconf.cc |
24 | gconf_SRC=gconf.c kconfig_load.c | ||
22 | HDR=expr.h lkc.h lkc_proto.h qconf.h | 25 | HDR=expr.h lkc.h lkc_proto.h qconf.h |
23 | OTHER=README lkc-language.txt Makefile.kernel \ | 26 | OTHER=README lkc-language.txt Makefile.kernel \ |
24 | kconfig.i extconf.rb example | 27 | kconfig.i extconf.rb example |
25 | INST=zconf.y zconf.l confdata.c expr.c symbol.c menu.c \ | 28 | INST=zconf.y zconf.l confdata.c expr.c symbol.c menu.c \ |
26 | conf.c mconf.c qconf.cc kconfig_load.c images.c $(HDR) | 29 | conf.c mconf.c qconf.cc gconf.c gconf.glade kconfig_load.c images.c $(HDR) |
27 | INSTGEN=lex.zconf.c zconf.tab.c | 30 | INSTGEN=lex.zconf.c zconf.tab.c |
28 | 31 | ||
29 | #DEBUG=1 | 32 | #DEBUG=1 |
@@ -60,6 +63,11 @@ qconf_OBJ=$(filter %.o, \ | |||
60 | $(patsubst %.y,%.tab.o, \ | 63 | $(patsubst %.y,%.tab.o, \ |
61 | $(patsubst %.l,lex.%.o, \ | 64 | $(patsubst %.l,lex.%.o, \ |
62 | $(qconf_SRC)))))) | 65 | $(qconf_SRC)))))) |
66 | gconf_OBJ=$(filter %.o, \ | ||
67 | $(patsubst %.c,%.o, \ | ||
68 | $(patsubst %.y,%.tab.o, \ | ||
69 | $(patsubst %.l,lex.%.o, \ | ||
70 | $(gconf_SRC))))) | ||
63 | OBJ=$(conf_OBJ) $(mconf_OBJ) $(qconf_OBJ) | 71 | OBJ=$(conf_OBJ) $(mconf_OBJ) $(qconf_OBJ) |
64 | 72 | ||
65 | ifeq ($(MOC),) | 73 | ifeq ($(MOC),) |
@@ -84,6 +92,7 @@ conf.o: conf.c $(lkc_deps) | |||
84 | mconf.o: mconf.c $(lkc_deps) | 92 | mconf.o: mconf.c $(lkc_deps) |
85 | qconf.moc: qconf.h | 93 | qconf.moc: qconf.h |
86 | qconf.o: qconf.cc qconf.moc images.c $(lkc_deps) | 94 | qconf.o: qconf.cc qconf.moc images.c $(lkc_deps) |
95 | gconf.o: gconf.c $(lkc_deps) | ||
87 | 96 | ||
88 | mconf: $(mconf_OBJ) | 97 | mconf: $(mconf_OBJ) |
89 | $(CC) $(LDFLAGS) $^ -o $@ | 98 | $(CC) $(LDFLAGS) $^ -o $@ |
@@ -94,14 +103,20 @@ conf: $(conf_OBJ) | |||
94 | ifeq ($(MOC),) | 103 | ifeq ($(MOC),) |
95 | qconf: | 104 | qconf: |
96 | @echo Unable to find the QT installation. Please make sure that the | 105 | @echo Unable to find the QT installation. Please make sure that the |
97 | @echo QT development package is correctly installed and the HOSTQTDIR | 106 | @echo QT development package is correctly installed and the QTDIR |
98 | @echo environment variable is set to the correct location. | 107 | @echo environment variable is set to the correct location. |
99 | @false | 108 | @false |
100 | else | 109 | else |
101 | qconf: $(qconf_OBJ) | 110 | qconf: $(qconf_OBJ) |
102 | $(CXX) $(LXXFLAGS) $^ -lqt -o $@ | 111 | $(CXX) $(LXXFLAGS) $^ -lqt-mt -o $@ |
103 | endif | 112 | endif |
104 | 113 | ||
114 | gconf.o: gconf.c | ||
115 | $(CC) $(CFLAGS) $(GTKCFLAGS) -c $< -o $@ | ||
116 | |||
117 | gconf: $(gconf_OBJ) | ||
118 | $(CC) $(LDFLAGS) $(GTKLDFLAGS) $^ -o $@ | ||
119 | |||
105 | libkconfig.so: $(parse_OBJ) | 120 | libkconfig.so: $(parse_OBJ) |
106 | $(CC) -shared $^ -o $@ | 121 | $(CC) -shared $^ -o $@ |
107 | 122 | ||
@@ -126,7 +141,7 @@ lex.%.c: %.l | |||
126 | $(LEX) $(LFLAGS) -P$* $< | 141 | $(LEX) $(LFLAGS) -P$* $< |
127 | 142 | ||
128 | %.moc: %.h | 143 | %.moc: %.h |
129 | $(HOSTQTDIR)/bin/moc -i $< -o $@ | 144 | $(QTDIR)/bin/moc -i $< -o $@ |
130 | 145 | ||
131 | %.o: %.c | 146 | %.o: %.c |
132 | $(CC) $(CFLAGS) -c $< -o $@ | 147 | $(CC) $(CFLAGS) -c $< -o $@ |
@@ -136,14 +151,16 @@ lex.%.c: %.l | |||
136 | 151 | ||
137 | ifdef KERNELSRC | 152 | ifdef KERNELSRC |
138 | install: $(INSTGEN) | 153 | install: $(INSTGEN) |
139 | set -x; cp $(sort $(INST)) $(KERNELSRC)/scripts/kconfig; \ | 154 | set -x; cp --remove-destination $(sort $(INST)) $(KERNELSRC)/scripts/kconfig; \ |
140 | for f in $(INSTGEN); do cp $$f $(KERNELSRC)/scripts/kconfig/$${f}_shipped; done; \ | 155 | for f in $(INSTGEN); do cp --remove-destination $$f $(KERNELSRC)/scripts/kconfig/$${f}_shipped; done; \ |
141 | cp Makefile.kernel $(KERNELSRC)/scripts/kconfig/Makefile | 156 | cp --remove-destination Makefile.kernel $(KERNELSRC)/scripts/kconfig/Makefile; \ |
157 | cp --remove-destination lkc-language.txt $(KERNELSRC)/Documentation/kbuild/kconfig-language.txt | ||
142 | 158 | ||
143 | diff: $(INSTGEN) | 159 | diff: $(INSTGEN) |
144 | for f in $(sort $(INST)); do diff -u $(KERNELSRC)/scripts/kconfig/$$f $$f; done; \ | 160 | for f in $(sort $(INST)); do diff -Nu $(KERNELSRC)/scripts/kconfig/$$f $$f; done; \ |
145 | for f in $(INSTGEN); do diff -u $(KERNELSRC)/scripts/kconfig/$${f}_shipped $$f; done; \ | 161 | for f in $(INSTGEN); do diff -Nu $(KERNELSRC)/scripts/kconfig/$${f}_shipped $$f; done; \ |
146 | diff -u $(KERNELSRC)/scripts/kconfig/Makefile Makefile.kernel | 162 | diff -Nu $(KERNELSRC)/scripts/kconfig/Makefile Makefile.kernel; \ |
163 | diff -Nu lkc-language.txt $(KERNELSRC)/Documentation/kbuild/kconfig-language.txt | ||
147 | else | 164 | else |
148 | install: | 165 | install: |
149 | @echo "Please use KERNELSRC=<path/to/linux-kernel> to install" | 166 | @echo "Please use KERNELSRC=<path/to/linux-kernel> to install" |