blob: 405eac678e172cde294a05928f787c5c88cd5093 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
|
# ===========================================================================
# Makefile for the various kconfig executables:
# conf: Used for defconfig, oldconfig and related targets
# mconf: Used for the mconfig target.
# Utilizes the lxdialog package
# qconf: Used for the xconfig target
# Based on QT which needs to be installed to compile it
# gconf: Used for the gconfig target
# Based on GTK which needs to be installed to compile it
# object files used by all kconfig flavours
ifndef CURSES_LOC
CURSES_LOC := <ncurses.h>
endif
CFLAGS += "-DCURSES_LOC=$(CURSES_LOC)"
ifndef CURSES_LIB
CURSES_LIB := ncurses
endif
ifdef REGEX_LIB
conf-libs := -l$(REGEX_LIB)
else
conf-libs :=
endif
mconf-libs := -l$(CURSES_LIB)
mconf-libs += $(conf-libs)
lkc-deps := lkc.h lkc_defs.h expr.h
lxdialog-objs := \
lxdialog/checklist.o \
lxdialog/inputbox.o \
lxdialog/menubox.o \
lxdialog/textbox.o \
lxdialog/util.o \
lxdialog/yesno.o \
conf-objs := \
conf.o \
zconf.tab.o
mconf-objs := \
mconf.o \
zconf.tab.o \
$(lxdialog-objs)
conf: $(conf-objs)
$(CC) $^ -o $@ $(conf-libs)
mconf: $(mconf-objs)
$(CC) $^ -o $@ $(mconf-libs)
%.moc: %.h
$(MOC) -i $< -o $@
%.o: %.c
$(CC) $(CFLAGS) -c $< -o $@
%.o: %.cc
$(CXX) $(CXXFLAGS) -c $< -o $@
%.moc: %.h
$(KC_QT_MOC) -i $< -o $@
lkc_defs.h: lkc_proto.h
sed < $< > $@ 's/P(\([^,]*\),.*/#define \1 (\*\1_p)/'
zconf.tab.o: lex.zconf.c zconf.hash.c zconf.tab.c confdata.c expr.c symbol.c menu.c $(lkc-deps)
kconfig_load.o: $(lkc-deps)
qconf.o: qconf.moc $(lkc-deps)
gconf.o: $(lkc-deps)
###
# The following requires flex/bison/gperf
# By default we use the _shipped versions, uncomment the following line if
# you are modifying the flex/bison src.
# LKC_GENPARSER := 1
ifdef LKC_GENPARSER
zconf.tab.c: zconf.y
lex.zconf.c: zconf.l
zconf.hash.c: zconf.gperf
%.tab.c: %.y
bison -l -b $* -p $(notdir $*) $<
cp $@ $@_shipped
lex.%.c: %.l
flex -L -P$(notdir $*) -o$@ $<
cp $@ $@_shipped
%.hash.c: %.gperf
gperf < $< > $@
cp $@ $@_shipped
else
%.tab.c: %.y
cp $@_shipped $@
lex.%.c: %.l
cp $@_shipped $@
%.hash.c: %.gperf
cp $@_shipped $@
endif
clean:
rm -f $(conf-objs) $(mconf-objs) conf mconf gconf qconf
rm -f lkc_defs.h zconf.tab.o zconf.tab.c zconf.hash.c lex.zconf.c
|