summaryrefslogtreecommitdiff
path: root/mk
diff options
context:
space:
mode:
Diffstat (limited to 'mk')
-rw-r--r--mk/build.mk48
-rw-r--r--mk/buildhlp.mk2
-rw-r--r--mk/package.mk12
-rw-r--r--mk/pkg-bottom.mk60
-rw-r--r--mk/split-cfg.mk3
-rw-r--r--mk/vars.mk11
6 files changed, 67 insertions, 69 deletions
diff --git a/mk/build.mk b/mk/build.mk
index a9d493924..19388ad89 100644
--- a/mk/build.mk
+++ b/mk/build.mk
@@ -21,8 +21,8 @@ DEFCONFIG= ADK_DEVELSYSTEM=n \
ADK_COMPILE_HEIMDAL=n \
ADK_PACKAGE_HEIMDAL_PKINIT=n \
ADK_PACKAGE_HEIMDAL_SERVER=n \
- ADK_PACKAGE_HEIMDAL_LIBS=n \
- ADK_PACKAGE_HEIMDAL_CLIENT_LIBS=n \
+ ADK_PACKAGE_LIBHEIMDAL=n \
+ ADK_PACKAGE_LIBHEIMDAL_CLIENT=n \
BUSYBOX_SELINUX=n \
BUSYBOX_MODPROBE_SMALL=n \
BUSYBOX_EJECT=n \
@@ -58,37 +58,11 @@ noconfig_targets:= menuconfig \
defconfig \
tags
-MAKECLEANDIR_SYMBOLS= ADK_DEBUG
-
-MAKECLEAN_SYMBOLS= ADK_TARGET_PACKAGE_IPKG \
- ADK_TARGET_PACKAGE_RPM \
- ADK_TARGET_PACKAGE_TGZ
-
POSTCONFIG= -@ \
if [ -f .config.old ];then \
- if [ -d .cfg ];then \
- what=cleantarget; \
- for symbol in ${MAKECLEANDIR_SYMBOLS}; do \
- newval=$$(grep -e "^$$symbol=" -e "^\# $$symbol " .config); \
- oldval=$$(cat .cfg/"$$symbol" 2>&-); \
- [[ $$newval = $$oldval ]] && continue; \
- echo; \
- echo >&2 "WARNING: Toolchain related options have changed, 'make" \
- "$$what' might be required!"; \
- break; \
- done; \
- what=clean; \
- for symbol in ${MAKECLEAN_SYMBOLS}; do \
- newval=$$(grep -e "^$$symbol=" -e "^\# $$symbol " .config); \
- oldval=$$(cat .cfg/"$$symbol" 2>&-); \
- [[ $$newval = $$oldval ]] && continue; \
- echo; \
- echo >&2 "WARNING: Package backend related options have changed, 'make" \
- "$$what' might be required!"; \
- break; \
- done; \
- if [ -f .busyboxcfg ];then rm .busyboxcfg;fi; \
- fi; \
+ if [ -f .busyboxcfg ];then \
+ rm .busyboxcfg; \
+ fi; \
fi
# Pull in the user's configuration file
@@ -108,7 +82,7 @@ ${TOPDIR}/package/Depends.mk: ${TOPDIR}/.config $(wildcard ${TOPDIR}/package/*/M
.NOTPARALLEL:
.PHONY: all world clean cleantarget cleandir distclean image_clean
-world: $(DISTDIR) $(BUILD_DIR) $(TARGET_DIR) $(PACKAGE_DIR) ${TOPDIR}/.cfg_${ADK_TARGET}_${ADK_LIBC}/ADK_HAVE_DOT_CONFIG
+world: $(DISTDIR) $(BUILD_DIR) $(TARGET_DIR) $(PACKAGE_DIR) ${TOPDIR}/.ADK_HAVE_DOT_CONFIG
${BASH} ${TOPDIR}/scripts/scan-pkgs.sh
ifeq ($(ADK_NATIVE),y)
$(MAKE) -f mk/build.mk toolchain/kernel-headers-prepare target/config-prepare target/compile package/compile root_clean package/install package_index target/install
@@ -148,10 +122,10 @@ ifeq ($(ADK_TARGET_PACKAGE_IPKG),y)
echo "option offline_root ${TARGET_DIR}" >>$(STAGING_DIR)/etc/ipkg.conf
endif
-package/%: ${TOPDIR}/.cfg_${ADK_TARGET}_${ADK_LIBC}/ADK_HAVE_DOT_CONFIG ${STAGING_DIR}/etc/ipkg.conf ${TOPDIR}/package/Depends.mk
+package/%: ${TOPDIR}/.ADK_HAVE_DOT_CONFIG ${STAGING_DIR}/etc/ipkg.conf ${TOPDIR}/package/Depends.mk
$(MAKE) -C package $(patsubst package/%,%,$@)
-target/%: ${TOPDIR}/.cfg_${ADK_TARGET}_${ADK_LIBC}/ADK_HAVE_DOT_CONFIG
+target/%: ${TOPDIR}/.ADK_HAVE_DOT_CONFIG
$(MAKE) -C target $(patsubst target/%,%,$@)
toolchain/%: ${STAGING_DIR}
@@ -164,10 +138,8 @@ switch:
echo "Saving configuration for target: ${ADK_TARGET}"
cp -p .config .config.${ADK_TARGET}
if [ -f .config.old ];then cp -p .config.old .config.old.${ADK_TARGET};fi
- mv .cfg .cfg.${ADK_TARGET}
if [ -f .config.${TARGET} ];then cp -p .config.${TARGET} .config; \
cp -p .config.old.${TARGET} .config.old; \
- mv .cfg.${TARGET} .cfg; \
echo "Setting configuration to target: ${TARGET}"; \
else echo "No old target config found";mv .config .config.bak; make TARGET=${TARGET};fi
@@ -251,7 +223,7 @@ distclean:
$(TOOLS_BUILD_DIR)
@rm -f .config* .defconfig .tmpconfig.h all.config ${TOPDIR}/prereq.mk \
.menu ${TOPDIR}/package/*/info.mk ${TOPDIR}/package/Depends.mk \
- .busyboxcfg
+ .busyboxcfg .ADK_HAVE_DOT_CONFIG
else # ! ifeq ($(strip $(ADK_HAVE_DOT_CONFIG)),y)
@@ -427,7 +399,7 @@ distclean:
${TOPDIR}/.cfg* ${TOPDIR}/package/pkglist.d
@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
+ .menu ${TOPDIR}/package/*/info.mk ${TOPDIR}/package/Depends.mk .ADK_HAVE_DOT_CONFIG
endif # ! ifeq ($(strip $(ADK_HAVE_DOT_CONFIG)),y)
diff --git a/mk/buildhlp.mk b/mk/buildhlp.mk
index 684801617..e45504697 100644
--- a/mk/buildhlp.mk
+++ b/mk/buildhlp.mk
@@ -58,7 +58,7 @@ post-patch:
${WRKDIST}/.prepared: ${WRKDIST}/.extract_done
[ ! -d ./patches ] || ${PREVENT_PATCH} ${PATCH} ${WRKDIST} ./patches \
'{patch-!(*.orig),*.patch}' $(MAKE_TRACE)
- [ ! -d ./extra ] || (cd extra; $(PREVENT_PATCH) cp -Rp . ${WRKDIST}/) \
+ [ ! -d ./src ] || (cd src; $(PREVENT_PATCH) cp -Rp . ${WRKDIST}/) \
$(MAKE_TRACE)
@${MAKE} post-patch $(MAKE_TRACE)
touch $@
diff --git a/mk/package.mk b/mk/package.mk
index 50f5ecb61..dbf383c8b 100644
--- a/mk/package.mk
+++ b/mk/package.mk
@@ -54,7 +54,6 @@ CONFIGURE_ENV+= CONFIG_SHELL='$(strip ${SHELL})' \
else
CONFIGURE_ENV+= ${TARGET_CONFIGURE_OPTS} \
${HOST_CONFIGURE_OPTS} \
- CC='${TARGET_CC}' CXX='${TARGET_CXX}' \
CFLAGS='$(strip ${TCFLAGS})' \
CXXFLAGS='$(strip ${TCXXFLAGS})' \
CPPFLAGS='$(strip ${TCPPFLAGS})' \
@@ -65,6 +64,7 @@ CONFIGURE_ENV+= ${TARGET_CONFIGURE_OPTS} \
ac_cv_func_realloc_0_nonnull=yes \
ac_cv_func_malloc_0_nonnull=yes
endif
+CONFIGURE_PROG?= configure
MAKE_FILE?= Makefile
# this is environment for 'make all' and 'make install'
MAKE_ENV?=
@@ -91,15 +91,19 @@ MAKE_ENV+= PATH='${TARGET_PATH}' \
WRKSRC='${WRKSRC}' WRKBUILD='${WRKBUILD}' \
PKG_CONFIG_PATH='${STAGING_DIR}/usr/lib/pkgconfig' \
PKG_CONFIG_LIBDIR=/dev/null \
- CC='${TARGET_CC}' CXX='${TARGET_CXX}' \
- AR='${TARGET_CROSS}ar' RANLIB='${TARGET_CROSS}ranlib' \
+ CC='${TARGET_CC}' \
+ CXX='${TARGET_CXX}' \
+ AR='${TARGET_CROSS}ar' \
+ RANLIB='${TARGET_CROSS}ranlib' \
NM='${TARGET_CROSS}nm' \
+ STRIP='${TARGET_CROSS}strip' \
+ CROSS="$(TARGET_CROSS)" \
CFLAGS='$(strip ${TCFLAGS})' \
CXXFLAGS='$(strip ${TCXXFLAGS})' \
CPPFLAGS='$(strip ${TCPPFLAGS})' \
LDFLAGS='$(strip ${TLDFLAGS})'
endif
-MAKE_FLAGS+= ${XAKE_FLAGS}
+MAKE_FLAGS+= ${XAKE_FLAGS} V=1
FAKE_FLAGS+= ${XAKE_FLAGS}
ifeq ($(strip ${WRKDIR_BSD}),)
diff --git a/mk/pkg-bottom.mk b/mk/pkg-bottom.mk
index 0dc830b28..e136392d7 100644
--- a/mk/pkg-bottom.mk
+++ b/mk/pkg-bottom.mk
@@ -5,11 +5,11 @@
# that we can call it (BSD make has .if target(foo) but GNU not)
# and it won't error out.
# * ${_foo_COOKIE} are the actual targets
-# * default is "manual" -> define a do-foo: target in the Makefile
+# * default is "auto"
+# * define "manual" if you need your own method
+# -> define a do-foo: target in the Makefile
# * if you have a style -> define a pre-foo: and post-foo: if they
# are required, but the do-foo: magic is done here
-# * we want to use styles (configure:gnu, build/install:auto), for
-# making the Makefiles of the packages more clear
pre-configure:
do-configure:
@@ -18,21 +18,42 @@ ${_CONFIGURE_COOKIE}: ${_PATCH_COOKIE}
mkdir -p ${WRKBUILD}
@${MAKE} pre-configure $(MAKE_TRACE)
-ifneq ($(filter autogen,${CONFIGURE_STYLE}),)
+ifneq ($(filter autogen,${AUTOTOOL_STYLE}),)
cd ${WRKBUILD}; \
./autogen.sh $(MAKE_TRACE)
endif
-ifneq ($(filter autotool,${CONFIGURE_STYLE}),)
+ifneq ($(filter autotool,${AUTOTOOL_STYLE}),)
cd ${WRKBUILD}; \
env AUTOCONF_VERSION=2.62 \
AUTOMAKE_VERSION=1.9 \
autoreconf -vif $(MAKE_TRACE)
endif
-ifneq ($(filter autoconf,${CONFIGURE_STYLE}),)
+ifneq ($(filter autoconf,${AUTOTOOL_STYLE}),)
cd ${WRKBUILD}; \
env AUTOCONF_VERSION=2.62 autoconf $(MAKE_TRACE)
endif
-ifneq ($(filter gnu,${CONFIGURE_STYLE}),)
+ifneq ($(filter manual,${CONFIG_STYLE}),)
+ env ${CONFIGURE_ENV} ${MAKE} do-configure $(MAKE_TRACE)
+else ifneq ($(filter minimal,${CONFIG_STYLE}),)
+ @$(CMD_TRACE) "configuring... "
+ @cd ${WRKBUILD}; \
+ for i in $$(find . -name config.sub);do \
+ if [ -f $$i ]; then \
+ ${CP} $$i $$i.bak; \
+ ${CP} ${SCRIPT_DIR}/config.sub $$i; \
+ fi; \
+ done; \
+ for i in $$(find . -name config.guess);do \
+ if [ -f $$i ]; then \
+ ${CP} $$i $$i.bak; \
+ ${CP} ${SCRIPT_DIR}/config.guess $$i; \
+ fi; \
+ done;
+ cd ${WRKBUILD}; rm -f config.{cache,status}; \
+ env ${CONFIGURE_ENV} \
+ ${BASH} ${WRKSRC}/${CONFIGURE_PROG} \
+ ${CONFIGURE_ARGS} $(MAKE_TRACE)
+else ifeq ($(strip ${CONFIG_STYLE}),)
@$(CMD_TRACE) "configuring... "
@cd ${WRKBUILD}; \
for i in $$(find . -name config.sub);do \
@@ -49,7 +70,7 @@ ifneq ($(filter gnu,${CONFIGURE_STYLE}),)
done;
cd ${WRKBUILD}; rm -f config.{cache,status}; \
env ${CONFIGURE_ENV} \
- ${BASH} ${WRKSRC}/configure \
+ ${BASH} ${WRKSRC}/${CONFIGURE_PROG} \
--build=${GNU_HOST_NAME} \
--host=${GNU_TARGET_NAME} \
--target=${GNU_TARGET_NAME} \
@@ -67,10 +88,8 @@ ifneq ($(filter gnu,${CONFIGURE_STYLE}),)
--disable-dependency-tracking \
--disable-libtool-lock \
${CONFIGURE_ARGS} $(MAKE_TRACE)
-else ifeq ($(filter-out manual,${CONFIGURE_STYLE}),)
- env ${CONFIGURE_ENV} ${MAKE} do-configure $(MAKE_TRACE)
else
- @echo "Invalid CONFIGURE_STYLE '${CONFIGURE_STYLE}'" >&2
+ @echo "Invalid CONFIG_STYLE '${CONFIG_STYLE}'" >&2
@exit 1
endif
@${MAKE} post-configure $(MAKE_TRACE)
@@ -89,13 +108,12 @@ post-build:
${_BUILD_COOKIE}: ${_CONFIGURE_COOKIE}
@env ${MAKE_ENV} ${MAKE} pre-build $(MAKE_TRACE)
@$(CMD_TRACE) "compiling... "
-ifneq ($(filter auto,${BUILD_STYLE}),)
- cd ${WRKBUILD} && env ${MAKE_ENV} ${MAKE} -f ${MAKE_FILE} \
- ${MAKE_FLAGS} ${ALL_TARGET} $(MAKE_TRACE)
-else ifneq ($(filter manual,${BUILD_STYLE}),)
+
+ifneq ($(filter manual,${BUILD_STYLE}),)
env ${MAKE_ENV} ${MAKE} do-build $(MAKE_TRACE)
else ifeq ($(strip ${BUILD_STYLE}),)
- env ${MAKE_ENV} ${MAKE} do-build $(MAKE_TRACE)
+ cd ${WRKBUILD} && env ${MAKE_ENV} ${MAKE} -f ${MAKE_FILE} \
+ ${MAKE_FLAGS} ${ALL_TARGET} $(MAKE_TRACE)
else
@echo "Invalid BUILD_STYLE '${BUILD_STYLE}'" >&2
@exit 1
@@ -109,15 +127,15 @@ post-install:
${_FAKE_COOKIE}: ${_BUILD_COOKIE}
-rm -f ${_ALL_CONTROLS}
@mkdir -p '${STAGING_PARENT}/pkg' ${WRKINST} '${STAGING_DIR}/scripts'
+ @mkdir -p ${WRKINST}/{sbin,bin,etc,lib}
+ @mkdir -p ${WRKINST}/usr/{sbin,bin,etc,lib}
@${MAKE} ${_ALL_CONTROLS} $(MAKE_TRACE)
@env ${MAKE_ENV} ${MAKE} pre-install $(MAKE_TRACE)
-ifneq ($(filter auto,${INSTALL_STYLE}),)
- cd ${WRKBUILD} && env ${MAKE_ENV} ${MAKE} -f ${MAKE_FILE} \
- DESTDIR='${WRKINST}' ${FAKE_FLAGS} ${INSTALL_TARGET} $(MAKE_TRACE)
-else ifneq ($(filter manual,${INSTALL_STYLE}),)
+ifneq ($(filter manual,${INSTALL_STYLE}),)
env ${MAKE_ENV} ${MAKE} do-install $(MAKE_TRACE)
else ifeq ($(strip ${INSTALL_STYLE}),)
- env ${MAKE_ENV} ${MAKE} do-install $(MAKE_TRACE)
+ cd ${WRKBUILD} && env ${MAKE_ENV} ${MAKE} -f ${MAKE_FILE} \
+ DESTDIR='${WRKINST}' ${FAKE_FLAGS} ${INSTALL_TARGET} $(MAKE_TRACE)
else
@echo "Invalid INSTALL_STYLE '${INSTALL_STYLE}'" >&2
@exit 1
diff --git a/mk/split-cfg.mk b/mk/split-cfg.mk
index a5c59b682..e9521c259 100644
--- a/mk/split-cfg.mk
+++ b/mk/split-cfg.mk
@@ -2,7 +2,8 @@
# material, please see the LICENCE file in the top-level directory.
# must work with both BSD and GNU make
-${TOPDIR}/.cfg_${ADK_TARGET}_${ADK_LIBC}/ADK_HAVE_DOT_CONFIG: \
+${TOPDIR}/.ADK_HAVE_DOT_CONFIG: \
${TOPDIR}/.config ${TOPDIR}/mk/split-cfg.mk \
${TOPDIR}/scripts/split-cfg.sh
mksh ${TOPDIR}/scripts/split-cfg.sh '${TOPDIR}' '${ADK_TARGET}' '${ADK_LIBC}'
+ touch ${TOPDIR}/.ADK_HAVE_DOT_CONFIG
diff --git a/mk/vars.mk b/mk/vars.mk
index 53755266e..3f8f86884 100644
--- a/mk/vars.mk
+++ b/mk/vars.mk
@@ -46,6 +46,7 @@ TARGET_CROSS:= $(STAGING_TOOLS)/bin/$(CPU_ARCH)-linux-$(ADK_TARGET_SUFFIX)-
endif
TARGET_CC:= ${TARGET_COMPILER_PREFIX}gcc
TARGET_CXX:= ${TARGET_COMPILER_PREFIX}g++
+TARGET_LD:= ${TARGET_COMPILER_PREFIX}ld
TARGET_CPPFLAGS+= -I${STAGING_DIR}/usr/include
TARGET_LDFLAGS+= -Wl,-O2
PATCH= ${BASH} $(SCRIPT_DIR)/patch.sh
@@ -58,11 +59,13 @@ TARGET_CONFIGURE_OPTS= PATH='${TARGET_PATH}' \
AS=$(TARGET_CROSS)as \
LD=$(TARGET_CROSS)ld \
NM=$(TARGET_CROSS)nm \
- CC="$(TARGET_CC)" \
- GCC="$(TARGET_CC)" \
- CXX="$(TARGET_CXX)" \
- RANLIB=$(TARGET_CROSS)ranlib
+ RANLIB=$(TARGET_CROSS)ranlib \
+ CC='$(TARGET_CC)' \
+ GCC='$(TARGET_CC)' \
+ CXX='$(TARGET_CXX)' \
+ CROSS='$(TARGET_CROSS)'
HOST_CONFIGURE_OPTS= CC_FOR_BUILD='${HOSTCC}' \
+ BUILD_CC='${HOSTCC}' \
CFLAGS_FOR_BUILD='${HOSTCFLAGS}' \
CPPFLAGS_FOR_BUILD='${HOSTCPPFLAGS}' \
LDFLAGS_FOR_BUILD='${HOSTLDFLAGS}'