Diffstat (limited to 'scripts/kconfig/Makefile.kernel') (more/less context) (show whitespace changes)
-rw-r--r-- | scripts/kconfig/Makefile.kernel | 85 |
1 files changed, 85 insertions, 0 deletions
diff --git a/scripts/kconfig/Makefile.kernel b/scripts/kconfig/Makefile.kernel new file mode 100644 index 0000000..beb4dcf --- a/dev/null +++ b/scripts/kconfig/Makefile.kernel | |||
@@ -0,0 +1,85 @@ | |||
1 | ################# | ||
2 | # | ||
3 | # Shared Makefile for the various lkc executables: | ||
4 | # conf: Used for defconfig, oldconfig and related targets | ||
5 | # mconf: Used for the mconfig target. | ||
6 | # Utilizes the lxdialog package | ||
7 | # qconf: Used for the xconfig target | ||
8 | # Based on QT which needs to be installed to compile it | ||
9 | # | ||
10 | |||
11 | # object files used by all lkc flavours | ||
12 | libkconfig-objs := zconf.tab.o | ||
13 | |||
14 | host-progs:= conf mconf qconf | ||
15 | conf-objs:= conf.o libkconfig.so | ||
16 | mconf-objs:= mconf.o libkconfig.so | ||
17 | |||
18 | qconf-objs:= kconfig_load.o | ||
19 | qconf-cxxobjs:= qconf.o | ||
20 | |||
21 | clean-files:= libkconfig.so lkc_defs.h qconf.moc .tmp_qtcheck \ | ||
22 | zconf.tab.c zconf.tab.h lex.zconf.c | ||
23 | |||
24 | include $(TOPDIR)/Rules.make | ||
25 | |||
26 | # QT needs some extra effort... | ||
27 | ifndef QTDIR | ||
28 | QTDIR := /usr/share/qt | ||
29 | endif | ||
30 | |||
31 | # Executable to generate the .moc file | ||
32 | MOC=$(wildcard $(QTDIR)/bin/moc) | ||
33 | |||
34 | # generated files seem to need this to find local include files | ||
35 | HOSTCFLAGS_lex.zconf.o:= -I$(src) | ||
36 | HOSTCFLAGS_zconf.tab.o:= -I$(src) | ||
37 | |||
38 | HOSTLOADLIBES_qconf:= -L$(QTDIR)/lib -Wl,-rpath,$(QTDIR)/lib -lqt -ldl | ||
39 | HOSTCXXFLAGS_qconf.o:= -I$(QTDIR)/include | ||
40 | |||
41 | $(obj)/conf.o $(obj)/mconf.o $(obj)/qconf.o: $(obj)/zconf.tab.h | ||
42 | |||
43 | $(obj)/qconf.o: $(obj)/.tmp_qtcheck | ||
44 | |||
45 | $(obj)/.tmp_qtcheck: | ||
46 | ifeq ($(MOC),) | ||
47 | @echo Unable to find the QT installation. Please make sure that the | ||
48 | @echo QT development package is correctly installed and the QTDIR | ||
49 | @echo environment variable is set to the correct location. | ||
50 | @false | ||
51 | else | ||
52 | @touch $@ | ||
53 | endif | ||
54 | |||
55 | $(obj)/zconf.tab.o: $(obj)/lex.zconf.c | ||
56 | |||
57 | $(obj)/kconfig_load.o: $(obj)/lkc_defs.h | ||
58 | |||
59 | $(obj)/qconf.o: $(obj)/qconf.moc $(obj)/lkc_defs.h | ||
60 | |||
61 | $(obj)/%.moc: $(src)/%.h | ||
62 | $(MOC) -i $< -o $@ | ||
63 | |||
64 | $(obj)/lkc_defs.h: $(src)/lkc_proto.h | ||
65 | sed < $< > $@ 's/P(\([^,]*\),.*/#define \1 (\*\1_p)/' | ||
66 | |||
67 | |||
68 | ### | ||
69 | # The following requires flex/bison | ||
70 | # By default we use the _shipped versions, uncomment the following line if | ||
71 | # you are modifying the flex/bison src. | ||
72 | # LKC_GENPARSER := 1 | ||
73 | |||
74 | ifdef LKC_GENPARSER | ||
75 | |||
76 | $(obj)/zconf.tab.c: $(obj)/zconf.y | ||
77 | $(obj)/zconf.tab.h: $(obj)/zconf.tab.c | ||
78 | |||
79 | %.tab.c: %.y | ||
80 | bison -t -d -v -b $* -p $(notdir $*) $< | ||
81 | |||
82 | lex.%.c: %.l | ||
83 | flex -P$(notdir $*) -o$@ $< | ||
84 | |||
85 | endif | ||