mirror of
https://github.com/motioneye-project/motioneyeos.git
synced 2025-07-27 21:26:36 +00:00
config: Add support for xconfig
It involved: * Modifying the top-level Makefile to create the xconfig target, and the $(CONFIG)/qconf target to compile the qconf utility * Modifying the package/config/Makefile magic so that C++ files and binaries gets linked properly, re-using the package/config/Makefile.kconfig logic inherited from the kernel * Hacking a little bit package/config/Makefile.kconfig in a way similar to the modifications done for the mconf (menuconfig interface) Signed-off-by: Alper Yildirim <ayildirim@aselsan.com>
This commit is contained in:
parent
4b3e11b3e7
commit
b0df9df39a
22
Makefile
22
Makefile
@ -28,7 +28,7 @@ CONFIG_DEFCONFIG=.defconfig
|
|||||||
CONFIG=package/config
|
CONFIG=package/config
|
||||||
DATE:=$(shell date +%Y%m%d)
|
DATE:=$(shell date +%Y%m%d)
|
||||||
|
|
||||||
noconfig_targets:=menuconfig config oldconfig randconfig \
|
noconfig_targets:=menuconfig xconfig config oldconfig randconfig \
|
||||||
defconfig allyesconfig allnoconfig release tags \
|
defconfig allyesconfig allnoconfig release tags \
|
||||||
source-check help
|
source-check help
|
||||||
|
|
||||||
@ -431,13 +431,29 @@ $(CONFIG)/conf:
|
|||||||
-@if [ ! -f .config ]; then \
|
-@if [ ! -f .config ]; then \
|
||||||
cp $(CONFIG_DEFCONFIG) .config; \
|
cp $(CONFIG_DEFCONFIG) .config; \
|
||||||
fi
|
fi
|
||||||
|
|
||||||
$(CONFIG)/mconf:
|
$(CONFIG)/mconf:
|
||||||
@mkdir -p $(CONFIG)/buildroot-config
|
@mkdir -p $(CONFIG)/buildroot-config
|
||||||
$(MAKE) CC="$(HOSTCC)" -C $(CONFIG) conf mconf
|
$(MAKE) CC="$(HOSTCC)" -C $(CONFIG) mconf
|
||||||
-@if [ ! -f .config ]; then \
|
-@if [ ! -f .config ]; then \
|
||||||
cp $(CONFIG_DEFCONFIG) .config; \
|
cp $(CONFIG_DEFCONFIG) .config; \
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
$(CONFIG)/qconf:
|
||||||
|
@mkdir -p $(CONFIG)/buildroot-config
|
||||||
|
$(MAKE) CC="$(HOSTCC)" -C $(CONFIG) qconf
|
||||||
|
-@if [ ! -f .config ]; then \
|
||||||
|
cp $(CONFIG_DEFCONFIG) .config; \
|
||||||
|
fi
|
||||||
|
|
||||||
|
xconfig: $(CONFIG)/qconf
|
||||||
|
@mkdir -p $(CONFIG)/buildroot-config
|
||||||
|
@if ! KCONFIG_AUTOCONFIG=$(CONFIG)/buildroot-config/auto.conf \
|
||||||
|
KCONFIG_AUTOHEADER=$(CONFIG)/buildroot-config/autoconf.h \
|
||||||
|
$(CONFIG)/qconf $(CONFIG_CONFIG_IN); then \
|
||||||
|
test -f .config.cmd || rm -f .config; \
|
||||||
|
fi
|
||||||
|
|
||||||
menuconfig: $(CONFIG)/mconf
|
menuconfig: $(CONFIG)/mconf
|
||||||
@mkdir -p $(CONFIG)/buildroot-config
|
@mkdir -p $(CONFIG)/buildroot-config
|
||||||
@if ! KCONFIG_AUTOCONFIG=$(CONFIG)/buildroot-config/auto.conf \
|
@if ! KCONFIG_AUTOCONFIG=$(CONFIG)/buildroot-config/auto.conf \
|
||||||
@ -559,5 +575,5 @@ release: distclean
|
|||||||
rm -rf $$OUT
|
rm -rf $$OUT
|
||||||
|
|
||||||
.PHONY: dummy subdirs release distclean clean config oldconfig \
|
.PHONY: dummy subdirs release distclean clean config oldconfig \
|
||||||
menuconfig tags check test depend defconfig help
|
menuconfig xconfig tags check test depend defconfig help
|
||||||
|
|
||||||
|
@ -14,7 +14,10 @@ __hostprogs := $(sort $(hostprogs-y) $(hostprogs-m))
|
|||||||
host-csingle := $(foreach m,$(__hostprogs),$(if $($(m)-objs),,$(m)))
|
host-csingle := $(foreach m,$(__hostprogs),$(if $($(m)-objs),,$(m)))
|
||||||
host-cmulti := $(foreach m,$(__hostprogs),\
|
host-cmulti := $(foreach m,$(__hostprogs),\
|
||||||
$(if $($(m)-cxxobjs),,$(if $($(m)-objs),$(m))))
|
$(if $($(m)-cxxobjs),,$(if $($(m)-objs),$(m))))
|
||||||
|
host-cxxmulti := $(foreach m,$(__hostprogs),\
|
||||||
|
$(if $($(m)-cxxobjs),$(m),$(if $($(m)-objs),)))
|
||||||
host-cobjs := $(sort $(foreach m,$(__hostprogs),$($(m)-objs)))
|
host-cobjs := $(sort $(foreach m,$(__hostprogs),$($(m)-objs)))
|
||||||
|
host-cxxobjs := $(sort $(foreach m,$(__hostprogs),$($(m)-cxxobjs)))
|
||||||
|
|
||||||
$(host-csingle): %: %.c
|
$(host-csingle): %: %.c
|
||||||
$(HOSTCC) $(HOST_EXTRACFLAGS) $(HOSTCFLAGS) $(HOSTCFLAGS_$@) $< $(HOST_LOADLIBES) -o $@
|
$(HOSTCC) $(HOST_EXTRACFLAGS) $(HOSTCFLAGS) $(HOSTCFLAGS_$@) $< $(HOST_LOADLIBES) -o $@
|
||||||
@ -22,9 +25,15 @@ $(host-csingle): %: %.c
|
|||||||
$(host-cmulti): %: $(host-cobjs) $(host-cshlib)
|
$(host-cmulti): %: $(host-cobjs) $(host-cshlib)
|
||||||
$(HOSTCC) $(HOST_EXTRACFLAGS) $(HOSTCFLAGS) $(HOSTCFLAGS_$@) $($@-objs) $(HOST_LOADLIBES) -o $@
|
$(HOSTCC) $(HOST_EXTRACFLAGS) $(HOSTCFLAGS) $(HOSTCFLAGS_$@) $($@-objs) $(HOST_LOADLIBES) -o $@
|
||||||
|
|
||||||
|
$(host-cxxmulti): %: $(host-cxxobjs) $(host-cobjs) $(host-cshlib)
|
||||||
|
$(HOSTCC) $(HOST_EXTRACFLAGS) $(HOSTCFLAGS) $(HOSTCFLAGS_$@) $($@-objs) $($@-cxxobjs) $(HOSTLOADLIBES_$@) -o $@
|
||||||
|
|
||||||
$(host-cobjs): %.o: %.c
|
$(host-cobjs): %.o: %.c
|
||||||
$(HOSTCC) $(HOST_EXTRACFLAGS) $(HOSTCFLAGS) $(HOSTCFLAGS_$@) -c $< -o $@
|
$(HOSTCC) $(HOST_EXTRACFLAGS) $(HOSTCFLAGS) $(HOSTCFLAGS_$@) -c $< -o $@
|
||||||
|
|
||||||
|
$(host-cxxobjs): %.o: %.cc
|
||||||
|
$(HOSTCC) $(HOST_EXTRACFLAGS) $(HOSTCFLAGS) $(HOSTCXXFLAGS_$@) -c $< -o $@
|
||||||
|
|
||||||
$(obj)/%:: $(src)/%_shipped
|
$(obj)/%:: $(src)/%_shipped
|
||||||
$(Q)cat $< > $@
|
$(Q)cat $< > $@
|
||||||
|
|
||||||
|
@ -131,6 +131,10 @@ endif
|
|||||||
ifeq ($(MAKECMDGOALS),xconfig)
|
ifeq ($(MAKECMDGOALS),xconfig)
|
||||||
qconf-target := 1
|
qconf-target := 1
|
||||||
endif
|
endif
|
||||||
|
ifeq ($(findstring qconf,$(MAKECMDGOALS)),qconf)
|
||||||
|
qconf-target := 1
|
||||||
|
endif
|
||||||
|
|
||||||
ifeq ($(MAKECMDGOALS),gconfig)
|
ifeq ($(MAKECMDGOALS),gconfig)
|
||||||
gconf-target := 1
|
gconf-target := 1
|
||||||
endif
|
endif
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
---
|
---
|
||||||
Makefile | 3 +
|
Makefile | 7 +++
|
||||||
README.buildroot2 | 22 ++++++++++
|
README.buildroot2 | 22 ++++++++++
|
||||||
conf.c | 13 ++----
|
conf.c | 13 ++----
|
||||||
confdata.c | 101 ++++++++++++++++++++++++++------------------------
|
confdata.c | 101 ++++++++++++++++++++++++++------------------------
|
||||||
@ -10,13 +10,13 @@
|
|||||||
util.c | 105 +++++++++++++++++++++++++++++++++++++++++++++++++++-
|
util.c | 105 +++++++++++++++++++++++++++++++++++++++++++++++++++-
|
||||||
zconf.tab.c_shipped | 2
|
zconf.tab.c_shipped | 2
|
||||||
zconf.y | 2
|
zconf.y | 2
|
||||||
11 files changed, 234 insertions(+), 101 deletions(-)
|
11 files changed, 238 insertions(+), 101 deletions(-)
|
||||||
|
|
||||||
Index: config/Makefile
|
Index: config/Makefile
|
||||||
===================================================================
|
===================================================================
|
||||||
--- config.orig/Makefile
|
--- config.orig/Makefile
|
||||||
+++ config/Makefile
|
+++ config/Makefile
|
||||||
@@ -124,6 +124,9 @@
|
@@ -124,10 +124,17 @@
|
||||||
ifeq ($(MAKECMDGOALS),menuconfig)
|
ifeq ($(MAKECMDGOALS),menuconfig)
|
||||||
hostprogs-y += mconf
|
hostprogs-y += mconf
|
||||||
endif
|
endif
|
||||||
@ -26,6 +26,14 @@ Index: config/Makefile
|
|||||||
|
|
||||||
ifeq ($(MAKECMDGOALS),xconfig)
|
ifeq ($(MAKECMDGOALS),xconfig)
|
||||||
qconf-target := 1
|
qconf-target := 1
|
||||||
|
endif
|
||||||
|
+ifeq ($(findstring qconf,$(MAKECMDGOALS)),qconf)
|
||||||
|
+ qconf-target := 1
|
||||||
|
+endif
|
||||||
|
+
|
||||||
|
ifeq ($(MAKECMDGOALS),gconfig)
|
||||||
|
gconf-target := 1
|
||||||
|
endif
|
||||||
Index: config/README.buildroot2
|
Index: config/README.buildroot2
|
||||||
===================================================================
|
===================================================================
|
||||||
--- /dev/null
|
--- /dev/null
|
||||||
|
Loading…
x
Reference in New Issue
Block a user