summaryrefslogtreecommitdiff
path: root/mk
diff options
context:
space:
mode:
authorWaldemar Brodkorb <wbx@openadk.org>2009-12-24 10:30:20 (GMT)
committerWaldemar Brodkorb <wbx@openadk.org>2009-12-24 10:30:20 (GMT)
commit537a2c4eaa446e52c6ba07007eb9ae75998b5580 (patch)
treeb48cc775042b4274dce470527826007de7a7fa84 /mk
parent18b3987c6d890f02c80b976b6cf6835053ef1fe9 (diff)
parentce621815fecece2b4d8a4cb7115eb82c1cb7ed44 (diff)
Merge commit 'origin/confgen'
finally autogenerate menu Config.in files and Depends.mk for packages. thx mirabilos Conflicts: .gitignore Makefile mk/build.mk package/eglibc/Config.in package/glibc/Config.in package/uclibc++/Config.in package/uclibc/Config.in rules.mk
Diffstat (limited to 'mk')
-rw-r--r--mk/build.mk56
-rw-r--r--mk/package.mk13
-rw-r--r--mk/split-cfg.mk2
3 files changed, 51 insertions, 20 deletions
diff --git a/mk/build.mk b/mk/build.mk
index 08e2b81..2fb5bb3 100644
--- a/mk/build.mk
+++ b/mk/build.mk
@@ -40,6 +40,7 @@ DEFCONFIG= ADK_DEVELSYSTEM=n \
noconfig_targets:= menuconfig \
_config \
_mconfig \
+ distclean \
tags
MAKECLEAN_SYMBOLS= ADK_TARGET_LIB_UCLIBC \
@@ -82,6 +83,9 @@ all: world
allcopy: all
$(CP) $(BIN_DIR) $(TOPDIR)/bulkdir/${d}/
+${TOPDIR}/package/Depends.mk: ${TOPDIR}/.config
+ mksh ${TOPDIR}/package/depmaker
+
.NOTPARALLEL:
.PHONY: all world clean cleantarget cleandir distclean image_clean
@@ -123,7 +127,7 @@ ${STAGING_DIR}/etc/ipkg.conf: ${STAGING_DIR}/etc
echo "dest root /" >${STAGING_DIR}/etc/ipkg.conf
echo "option offline_root ${TARGET_DIR}" >>$(STAGING_DIR)/etc/ipkg.conf
-package/%: ${TOPDIR}/.cfg/ADK_HAVE_DOT_CONFIG ${STAGING_DIR}/etc/ipkg.conf
+package/%: ${TOPDIR}/.cfg/ADK_HAVE_DOT_CONFIG ${STAGING_DIR}/etc/ipkg.conf ${TOPDIR}/package/Depends.mk
$(MAKE) -C package $(patsubst package/%,%,$@)
target/%: ${TOPDIR}/.cfg/ADK_HAVE_DOT_CONFIG
@@ -177,8 +181,9 @@ clean:
rm $$f ; \
done \
done
- rm -rf $(BUILD_DIR) $(BIN_DIR) $(TARGET_DIR) ${TOPDIR}/.cfg
- rm -f ${TOPDIR}/package/*/info.mk
+ rm -rf $(BUILD_DIR) $(BIN_DIR) $(TARGET_DIR) ${TOPDIR}/.cfg \
+ ${TOPDIR}/package/pkglist.d
+ rm -f ${TOPDIR}/package/*/info.mk ${TOPDIR}/package/Depends.mk
cleankernel:
@$(TRACE) cleankernel
@@ -188,9 +193,11 @@ cleandir:
@$(TRACE) cleandir
@$(MAKE) -C $(CONFIG) clean $(MAKE_TRACE)
rm -rf $(BUILD_DIR_PFX) $(BIN_DIR_PFX) $(TARGET_DIR_PFX) \
- ${TOPDIR}/.cfg*
- rm -rf $(TOOLCHAIN_BUILD_DIR_PFX) $(STAGING_PARENT_PFX) $(TOOLS_BUILD_DIR)
- rm -f .tmpconfig.h ${TOPDIR}/package/*/info.mk
+ ${TOPDIR}/.cfg* ${TOPDIR}/package/pkglist.d
+ rm -rf $(TOOLCHAIN_BUILD_DIR_PFX) $(STAGING_PARENT_PFX) \
+ $(TOOLS_BUILD_DIR)
+ rm -f .menu .tmpconfig.h ${TOPDIR}/package/*/info.mk \
+ ${TOPDIR}/package/Depends.mk ${TOPDIR}/prereq.mk
cleantarget:
@$(TRACE) cleantarget
@@ -202,15 +209,20 @@ cleantarget:
distclean:
@$(TRACE) distclean
@$(MAKE) -C $(CONFIG) clean $(MAKE_TRACE)
- rm -rf $(BUILD_DIR_PFX) $(BIN_DIR_PFX) $(TARGET_DIR_PFX) $(DISTDIR) \
- ${TOPDIR}/.cfg* $(TOPDIR)/bulkdir
- rm -rf $(TOOLCHAIN_BUILD_DIR_PFX) $(STAGING_PARENT_PFX) $(TOOLS_BUILD_DIR)
- rm -f .config* .defconfig .tmpconfig.h all.config \
- ${TOPDIR}/package/*/info.mk
+ @rm -rf $(BUILD_DIR_PFX) $(BIN_DIR_PFX) $(TARGET_DIR_PFX) $(DISTDIR) \
+ ${TOPDIR}/.cfg* ${TOPDIR}/package/pkglist.d $(TOPDIR)/bulkdir
+ @rm -rf $(TOOLCHAIN_BUILD_DIR_PFX) $(STAGING_PARENT_PFX) $(TOOLS_BUILD_DIR)
+ @rm -f .config* .defconfig .tmpconfig.h all.config ${TOPDIR}/prereq.mk \
+ .menu ${TOPDIR}/package/*/info.mk ${TOPDIR}/package/Depends.mk
-else # ifeq ($(strip $(ADK_HAVE_DOT_CONFIG)),y)
+else # ! ifeq ($(strip $(ADK_HAVE_DOT_CONFIG)),y)
+ifeq ($(filter-out distclean,${MAKECMDGOALS}),)
+include ${TOPDIR}/mk/vars.mk
+else
include $(TOPDIR)/prereq.mk
+export BASH HOSTCC HOSTCFLAGS MAKE LANGUAGE LC_ALL OStype PATH
+endif
all: menuconfig
@echo "Start the build with \"make\" or with \"make v\" to be verbose"
@@ -227,7 +239,7 @@ $(CONFIG)/conf:
$(CONFIG)/mconf:
@$(MAKE) -C $(CONFIG)
-defconfig: $(CONFIG)/conf
+defconfig: .menu $(CONFIG)/conf
ifeq (${OStype},Linux)
@echo ADK_HOST_LINUX=y > $(TOPDIR)/.defconfig
endif
@@ -321,30 +333,30 @@ ifneq (,$(filter rb%,${TARGET}))
@echo ADK_LINUX_MIKROTIK=y >> $(TOPDIR)/all.config
endif
-menuconfig: $(CONFIG)/mconf defconfig
+menuconfig: $(CONFIG)/mconf defconfig .menu
@if [ ! -f .config ];then \
$(CONFIG)/conf -D .defconfig $(CONFIG_CONFIG_IN); \
fi
@$(CONFIG)/mconf $(CONFIG_CONFIG_IN)
${POSTCONFIG}
-_config: $(CONFIG)/conf
+_config: $(CONFIG)/conf .menu
-@touch .config
@$(CONFIG)/conf ${W} $(CONFIG_CONFIG_IN) >/dev/null
${POSTCONFIG}
.NOTPARALLEL: _mconfig
_mconfig: ${CONFIG}/conf _mconfig2 _config
-_mconfig2: ${CONFIG}/conf modconfig
+_mconfig2: ${CONFIG}/conf modconfig .menu
@${CONFIG}/conf -m ${RCONFIG} >/dev/null
distclean:
@$(MAKE) -C $(CONFIG) clean
@rm -rf $(BUILD_DIR) $(TOOLS_BUILD_DIR) $(BIN_DIR) $(DISTDIR) \
- ${TOPDIR}/.cfg* $(TOPDIR)/bulkdir
+ ${TOPDIR}/.cfg* ${TOPDIR}/package/pkglist.d
@rm -rf $(TOOLCHAIN_BUILD_DIR) $(STAGING_PARENT) $(TARGET_DIR)
- @rm -f .config* .defconfig all.config .tmpconfig.h \
- ${TOPDIR}/package/*/info.mk
+ @rm -f .config* .defconfig all.config .tmpconfig.h ${TOPDIR}/prereq.mk \
+ .menu ${TOPDIR}/package/*/info.mk ${TOPDIR}/package/Depends.mk
endif # ! ifeq ($(strip $(ADK_HAVE_DOT_CONFIG)),y)
@@ -368,3 +380,9 @@ bulk:
rm .*config; \
) 2>&1 | tee $(TOPDIR)/bulkdir/$$target-$$libc-$$fs/log; \
done <${TOPDIR}/target/bulk.lst
+
+.menu menu:
+ mksh $(TOPDIR)/package/pkgmaker
+ @:>.menu
+
+.PHONY: menu
diff --git a/mk/package.mk b/mk/package.mk
index cd57a20..f5a48db 100644
--- a/mk/package.mk
+++ b/mk/package.mk
@@ -3,6 +3,15 @@
all: build-all-pkgs
+ifneq (${PKG_CXX},)
+ifeq (${ADK_COMPILE_${PKG_CXX}_WITH_UCLIBCXX},y)
+PKG_BUILDDEP+= uclibc++
+PKG_DEPENDS+= uclibc++
+else
+PKG_DEPENDS+= libstdcxx
+endif
+endif
+
TCFLAGS:= ${TARGET_CFLAGS}
TCXXFLAGS:= ${TARGET_CFLAGS}
TCPPFLAGS:= ${TARGET_CPPFLAGS}
@@ -137,6 +146,10 @@ build-all-pkgs: ${_IPKGS_COOKIE}
# cleaning (needed for toolchain packages like glibc/eglibc)
# should be package format independent and modular in the future
define PKG_template
+ALL_PKGOPTS+= $(1)
+PKGNAME_$(1)= $(2)
+PKGDEPS_$(1)= $(4)
+PKGDESC_$(1)= $(5)
IPKG_$(1)= $(PACKAGE_DIR)/$(2)_$(3)_${CPU_ARCH}.${PKG_SUFFIX}
IDIR_$(1)= $(WRKDIR)/fake-${CPU_ARCH}/pkg-$(2)
ifneq (${ADK_PACKAGE_$(1)}${DEVELOPER},)
diff --git a/mk/split-cfg.mk b/mk/split-cfg.mk
index 6b1091e..9f4bff8 100644
--- a/mk/split-cfg.mk
+++ b/mk/split-cfg.mk
@@ -4,4 +4,4 @@
${TOPDIR}/.cfg/ADK_HAVE_DOT_CONFIG: ${TOPDIR}/.config \
${TOPDIR}/mk/split-cfg.mk ${TOPDIR}/scripts/split-cfg.sh
- ${BASH} ${TOPDIR}/scripts/split-cfg.sh '${TOPDIR}'
+ mksh ${TOPDIR}/scripts/split-cfg.sh '${TOPDIR}'