1 # ===========================================================================
2 # OpenWrt configuration targets
3 # These targets are used from top-level makefile
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 # qconf: Used for the xconfig target
11 # Based on Qt which needs to be installed to compile it
12 # object files used by all kconfig flavours
15 # Platform specific fixes
19 check_lxdialog
= $(shell $(SHELL
) $(CURDIR
)/lxdialog
/check-lxdialog.sh
-$(1))
20 export CFLAGS
+= -DKBUILD_NO_NLS
-I.
$(call check_lxdialog
,ccflags
)
21 export CXXFLAGS
+= -DKBUILD_NO_NLS
23 conf-objs
:= conf.o zconf.tab.o
24 mconf-objs
:= mconf.o zconf.tab.o
25 qconf-cxxobjs
:= qconf.o
26 qconf-objs
:= zconf.tab.o
29 lxdialog
/checklist.o lxdialog
/util.o lxdialog
/inputbox.o \
30 lxdialog
/textbox.o lxdialog
/yesno.o lxdialog
/menubox.o
32 clean-files
:= zconf.tab.c zconf.
lex.c zconf.hash.c
33 # Remove qconf junk files
34 clean-files
+= $(qconf-cxxobjs
) qconf.moc .tmp_qtcheck qconf
39 mconf
: $(mconf-objs
) $(lxdialog-objs
)
40 $(CC
) -o
$@
$^
$(call check_lxdialog
,ldflags $(CC
))
41 qconf
: $(qconf-cxxobjs
) $(qconf-objs
)
42 $(CXX
) -o
$@
$^
$(HOSTLOADLIBES_qconf
)
45 rm -f
*.o lxdialog
/*.o
$(clean-files
) conf mconf
47 zconf.tab.o
: zconf.
lex.c zconf.hash.c confdata.c
49 kconfig_load.o
: lkc_defs.h
51 zconf.tab.c
: zconf.y
$(wildcard zconf.tab.c_shipped
)
52 zconf.
lex.c
: zconf.l
$(wildcard zconf.
lex.c_shipped
)
53 zconf.hash.c
: zconf.gperf
$(wildcard zconf.hash.c_shipped
)
56 cp
$@_shipped
$@ || bison
-l
-b
$* -p
$(notdir $*) $<
59 cp
$@_shipped
$@ || flex
-L
-P
$(notdir $*) -o
$@
$<
62 cp
$@_shipped
$@ || gperf
< $< > $@
64 ifeq ($(MAKECMDGOALS
),qconf
)
66 .tmp_qtcheck
: Makefile
69 # Qt needs some extra effort...
71 @set
-e
; echo
" CHECK qt"; \
72 if pkg-config
--exists Qt5Core
; then \
73 cflags="-std=c++11 -fPIC `pkg-config --cflags Qt5Core Qt5Gui Qt5Widgets`"; \
74 libs
=`pkg-config --libs Qt5Core Qt5Gui Qt5Widgets`; \
75 moc
=`pkg-config --variable=host_bins Qt5Core`/moc
; \
76 elif pkg-config
--exists QtCore
; then \
77 cflags=`pkg-config --cflags QtCore QtGui`; \
78 libs
=`pkg-config --libs QtCore QtGui`; \
79 moc
=`pkg-config --variable=moc_location QtCore`; \
82 echo
>&2 "* Could not find Qt via pkg-config."; \
83 echo
>&2 "* Please install either Qt 4.8 or 5.x. and make sure it's in PKG_CONFIG_PATH"; \
87 echo
"KC_QT_CFLAGS=$$cflags" > $@
; \
88 echo
"KC_QT_LIBS=$$libs" >> $@
; \
89 echo
"KC_QT_MOC=$$moc" >> $@
92 #Define compiler flags to build qconf
93 HOSTLOADLIBES_qconf
= $(KC_QT_LIBS
)
94 HOSTCXXFLAGS_qconf.o
= $(KC_QT_CFLAGS
)
97 qconf.o
: CXXFLAGS
+=$(HOSTCXXFLAGS_qconf.o
)
99 moc
= $(KC_QT_MOC
) -i
$< -o
$@
101 %.moc
: %.h .tmp_qtcheck