2006-04-20 20:17:34 +00:00
|
|
|
# ===========================================================================
|
2006-04-20 21:00:14 +00:00
|
|
|
# OpenWrt configuration targets
|
2006-04-20 20:17:34 +00:00
|
|
|
# These targets are used from top-level makefile
|
|
|
|
|
|
|
|
# ===========================================================================
|
|
|
|
# Shared Makefile for the various kconfig executables:
|
|
|
|
# conf: Used for defconfig, oldconfig and related targets
|
|
|
|
# mconf: Used for the mconfig target.
|
|
|
|
# Utilizes the lxdialog package
|
2017-07-23 03:08:17 +00:00
|
|
|
# qconf: Used for the xconfig target
|
|
|
|
# Based on Qt which needs to be installed to compile it
|
2006-04-20 20:17:34 +00:00
|
|
|
# object files used by all kconfig flavours
|
|
|
|
|
2006-08-02 13:36:20 +00:00
|
|
|
|
|
|
|
# Platform specific fixes
|
|
|
|
#
|
|
|
|
# FreeBSD
|
2013-04-18 12:05:16 +00:00
|
|
|
|
|
|
|
check_lxdialog = $(shell $(SHELL) $(CURDIR)/lxdialog/check-lxdialog.sh -$(1))
|
|
|
|
export CFLAGS += -DKBUILD_NO_NLS -I. $(call check_lxdialog,ccflags)
|
2017-10-29 16:15:49 +00:00
|
|
|
export CXXFLAGS += -DKBUILD_NO_NLS
|
2006-08-02 13:36:20 +00:00
|
|
|
|
2006-04-20 20:17:34 +00:00
|
|
|
conf-objs := conf.o zconf.tab.o
|
|
|
|
mconf-objs := mconf.o zconf.tab.o
|
2017-07-23 03:08:17 +00:00
|
|
|
qconf-cxxobjs := qconf.o
|
|
|
|
qconf-objs := zconf.tab.o
|
|
|
|
|
2013-04-18 12:05:16 +00:00
|
|
|
lxdialog-objs := \
|
|
|
|
lxdialog/checklist.o lxdialog/util.o lxdialog/inputbox.o \
|
|
|
|
lxdialog/textbox.o lxdialog/yesno.o lxdialog/menubox.o
|
2006-04-20 20:17:34 +00:00
|
|
|
|
2019-06-20 15:02:30 +00:00
|
|
|
clean-files := zconf.tab.c zconf.lex.c zconf.hash.c
|
2017-07-23 03:08:17 +00:00
|
|
|
# Remove qconf junk files
|
2018-01-12 08:55:48 +00:00
|
|
|
clean-files += $(qconf-cxxobjs) qconf.moc .tmp_qtcheck qconf
|
2006-04-20 20:17:34 +00:00
|
|
|
|
2013-04-18 12:05:16 +00:00
|
|
|
all: conf mconf
|
2006-04-20 20:17:34 +00:00
|
|
|
|
|
|
|
conf: $(conf-objs)
|
2013-04-18 12:05:16 +00:00
|
|
|
mconf: $(mconf-objs) $(lxdialog-objs)
|
|
|
|
$(CC) -o $@ $^ $(call check_lxdialog,ldflags $(CC))
|
2017-07-23 03:08:17 +00:00
|
|
|
qconf: $(qconf-cxxobjs) $(qconf-objs)
|
|
|
|
ifneq ($(DISTRO-PKG-CONFIG),)
|
2019-09-20 05:33:58 +00:00
|
|
|
$(CXX) -o $@ $^ $(HOSTLOADLIBES_qconf)
|
2017-07-23 03:08:17 +00:00
|
|
|
else
|
|
|
|
echo "You don't have 'pkg-config' installed. Cannot continue"
|
|
|
|
echo "For now, you may use 'make menuconfig' instead of 'make xconfig'"
|
|
|
|
endif
|
2006-04-20 20:17:34 +00:00
|
|
|
|
|
|
|
clean:
|
2013-04-18 12:05:16 +00:00
|
|
|
rm -f *.o lxdialog/*.o $(clean-files) conf mconf
|
2006-04-20 20:17:34 +00:00
|
|
|
|
2013-04-18 12:05:16 +00:00
|
|
|
zconf.tab.o: zconf.lex.c zconf.hash.c confdata.c
|
2006-04-20 20:17:34 +00:00
|
|
|
|
|
|
|
kconfig_load.o: lkc_defs.h
|
|
|
|
|
2019-06-20 15:02:30 +00:00
|
|
|
zconf.tab.c: zconf.y $(wildcard zconf.tab.c_shipped)
|
|
|
|
zconf.lex.c: zconf.l $(wildcard zconf.lex.c_shipped)
|
|
|
|
zconf.hash.c: zconf.gperf $(wildcard zconf.hash.c_shipped)
|
2006-04-20 20:17:34 +00:00
|
|
|
|
|
|
|
%.tab.c: %.y
|
2006-04-20 21:00:14 +00:00
|
|
|
cp $@_shipped $@ || bison -l -b $* -p $(notdir $*) $<
|
2006-04-20 20:17:34 +00:00
|
|
|
|
2013-04-18 12:05:16 +00:00
|
|
|
%.lex.c: %.l
|
2006-04-20 21:00:14 +00:00
|
|
|
cp $@_shipped $@ || flex -L -P$(notdir $*) -o$@ $<
|
2006-04-20 20:17:34 +00:00
|
|
|
|
|
|
|
%.hash.c: %.gperf
|
2006-04-20 21:00:14 +00:00
|
|
|
cp $@_shipped $@ || gperf < $< > $@
|
2017-07-23 03:08:17 +00:00
|
|
|
|
|
|
|
ifeq ($(MAKECMDGOALS),qconf)
|
|
|
|
qconf.o: .tmp_qtcheck
|
|
|
|
.tmp_qtcheck: Makefile
|
|
|
|
-include .tmp_qtcheck
|
|
|
|
|
|
|
|
# Qt needs some extra effort...
|
|
|
|
.tmp_qtcheck:
|
|
|
|
@set -e; echo " CHECK qt"; \
|
|
|
|
if $(DISTRO-PKG-CONFIG) --exists Qt5Core; then \
|
|
|
|
cflags="-std=c++11 -fPIC `$(DISTRO-PKG-CONFIG) --cflags Qt5Core Qt5Gui Qt5Widgets`"; \
|
|
|
|
libs=`$(DISTRO-PKG-CONFIG) --libs Qt5Core Qt5Gui Qt5Widgets`; \
|
|
|
|
moc=`$(DISTRO-PKG-CONFIG) --variable=host_bins Qt5Core`/moc; \
|
|
|
|
elif $(DISTRO-PKG-CONFIG) --exists QtCore; then \
|
|
|
|
cflags=`$(DISTRO-PKG-CONFIG) --cflags QtCore QtGui`; \
|
|
|
|
libs=`$(DISTRO-PKG-CONFIG) --libs QtCore QtGui`; \
|
|
|
|
moc=`$(DISTRO-PKG-CONFIG) --variable=moc_location QtCore`; \
|
|
|
|
else \
|
|
|
|
echo >&2 "*"; \
|
|
|
|
echo >&2 "* Could not find Qt via $(DISTRO-PKG-CONFIG)."; \
|
|
|
|
echo >&2 "* Please install either Qt 4.8 or 5.x. and make sure it's in PKG_CONFIG_PATH"; \
|
|
|
|
echo >&2 "*"; \
|
|
|
|
exit 1; \
|
|
|
|
fi; \
|
|
|
|
echo "KC_QT_CFLAGS=$$cflags" > $@; \
|
|
|
|
echo "KC_QT_LIBS=$$libs" >> $@; \
|
|
|
|
echo "KC_QT_MOC=$$moc" >> $@
|
|
|
|
endif
|
|
|
|
|
|
|
|
#Define compiler flags to build qconf
|
|
|
|
HOSTLOADLIBES_qconf = $(KC_QT_LIBS)
|
|
|
|
HOSTCXXFLAGS_qconf.o = $(KC_QT_CFLAGS)
|
|
|
|
|
|
|
|
qconf.o: qconf.moc
|
|
|
|
qconf.o: CXXFLAGS+=$(HOSTCXXFLAGS_qconf.o)
|
|
|
|
|
|
|
|
moc = $(KC_QT_MOC) -i $< -o $@
|
|
|
|
|
|
|
|
%.moc: %.h .tmp_qtcheck
|
|
|
|
$(call moc)
|