scripts/config: add -DKBUILD_NO_NLS to CXXFLAGS
[openwrt/openwrt.git] / 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
17 check_lxdialog = $(shell $(SHELL) $(CURDIR)/lxdialog/check-lxdialog.sh -$(1))
18 export CFLAGS += -DKBUILD_NO_NLS -I. $(call check_lxdialog,ccflags)
19 export CXXFLAGS += -DKBUILD_NO_NLS
20
21 conf-objs := conf.o zconf.tab.o
22 mconf-objs := mconf.o zconf.tab.o
23 lxdialog-objs := \
24 lxdialog/checklist.o lxdialog/util.o lxdialog/inputbox.o \
25 lxdialog/textbox.o lxdialog/yesno.o lxdialog/menubox.o
26
27 clean-files := zconf.tab.c lex.zconf.c zconf.hash.c
28
29 all: conf mconf
30
31 conf: $(conf-objs)
32 mconf: $(mconf-objs) $(lxdialog-objs)
33 $(CC) -o $@ $^ $(call check_lxdialog,ldflags $(CC))
34
35 clean:
36 rm -f *.o lxdialog/*.o $(clean-files) conf mconf
37
38 zconf.tab.o: zconf.lex.c zconf.hash.c confdata.c
39
40 kconfig_load.o: lkc_defs.h
41
42 zconf.tab.c: zconf.y
43 zconf.lex.c: zconf.l
44 zconf.hash.c: zconf.gperf
45
46 %.tab.c: %.y
47 cp $@_shipped $@ || bison -l -b $* -p $(notdir $*) $<
48
49 %.lex.c: %.l
50 cp $@_shipped $@ || flex -L -P$(notdir $*) -o$@ $<
51
52 %.hash.c: %.gperf
53 cp $@_shipped $@ || gperf < $< > $@