6cdab2e0e6df7aa00d548372136324b1c9875b71
[openwrt/staging/dedeckeh.git] / openwrt / scripts / config / Makefile
1 # ===========================================================================
2 # OpenWrt configuration targets
3 # These targets are used from top-level makefile
4
5 # ===========================================================================
6 # Shared Makefile for the various kconfig executables:
7 # conf: Used for defconfig, oldconfig and related targets
8 # mconf: Used for the mconfig target.
9 # Utilizes the lxdialog package
10 # object files used by all kconfig flavours
11
12
13 # Platform specific fixes
14 #
15 # FreeBSD
16 ifeq ($(shell uname -s),FreeBSD)
17 export CFLAGS+=-I/usr/local/include
18 export LDFLAGS+=-L/usr/local/lib -lintl
19 endif
20
21 conf-objs := conf.o zconf.tab.o
22 mconf-objs := mconf.o zconf.tab.o
23
24 clean-files := lkc_defs.h qconf.moc .tmp_qtcheck \
25 .tmp_gtkcheck zconf.tab.c lex.zconf.c zconf.hash.c
26
27 all: conf mconf lxdialog
28
29 .PHONY: lxdialog
30 lxdialog:
31 $(MAKE) -C lxdialog
32
33 conf: $(conf-objs)
34 mconf: $(mconf-objs)
35
36 clean:
37 rm -f *.o $(clean-files) conf mconf
38 $(MAKE) -C lxdialog clean
39
40 zconf.tab.o: lex.zconf.c zconf.hash.c
41
42 kconfig_load.o: lkc_defs.h
43
44 lkc_defs.h: $(src)/lkc_proto.h
45 sed < $< > $@ 's/P(\([^,]*\),.*/#define \1 (\*\1_p)/'
46
47 zconf.tab.c: zconf.y
48 lex.zconf.c: zconf.l
49 zconf.hash.c: zconf.gperf
50
51 %.tab.c: %.y
52 cp $@_shipped $@ || bison -l -b $* -p $(notdir $*) $<
53
54 lex.%.c: %.l
55 cp $@_shipped $@ || flex -L -P$(notdir $*) -o$@ $<
56
57 %.hash.c: %.gperf
58 cp $@_shipped $@ || gperf < $< > $@