-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,25 +1,45 @@ | |||
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 |
@@ -102,25 +122,25 @@ mconf: $(mconf_OBJ) | |||
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: |