summaryrefslogtreecommitdiff
path: root/mk
diff options
context:
space:
mode:
Diffstat (limited to 'mk')
-rw-r--r--mk/build.mk116
-rw-r--r--mk/buildhlp.mk2
-rw-r--r--mk/fetch.mk6
-rw-r--r--mk/host-bottom.mk33
-rw-r--r--mk/image.mk5
-rw-r--r--mk/kernel-build.mk25
-rw-r--r--mk/kernel-vars.mk11
-rw-r--r--mk/os.mk16
-rw-r--r--mk/package.mk4
-rw-r--r--mk/pkg-bottom.mk20
-rw-r--r--mk/vars.mk4
11 files changed, 96 insertions, 146 deletions
diff --git a/mk/build.mk b/mk/build.mk
index 3d0124cca..d7e32110c 100644
--- a/mk/build.mk
+++ b/mk/build.mk
@@ -1,9 +1,6 @@
# This file is part of the OpenADK project. OpenADK is copyrighted
# material, please see the LICENCE file in the top-level directory.
-ADK_TOPDIR=$(shell pwd)
-export ADK_TOPDIR
-
CONFIG_CONFIG_IN = Config.in
CONFIG = adk/config
DEFCONFIG= ADK_DEBUG=n \
@@ -95,9 +92,7 @@ noconfig_targets:= menuconfig \
defconfig
POSTCONFIG= -@\
- if [ -f .adkinit ];then rm .adkinit;\
- else \
- if [ -f .config.old ];then \
+ if [ ! -f .firstrun ]; then \
$(ADK_TOPDIR)/adk/tools/pkgrebuild;\
rebuild=0; \
cleandir=0; \
@@ -133,22 +128,14 @@ POSTCONFIG= -@\
cleandir=1;\
rebuild=1;\
fi; \
- if [ "$$(grep ^ADK_TARGET_ARCH .config|md5sum)" != "$$(grep ^ADK_TARGET_ARCH .config.old|md5sum)" ];then \
- cleandir=1;\
- rebuild=1;\
- fi; \
- if [ "$$(grep ^ADK_TARGET_SYSTEM .config|md5sum)" != "$$(grep ^ADK_TARGET_SYSTEM .config.old|md5sum)" ];then \
- cleandir=1;\
- rebuild=1;\
- fi; \
if [ $$cleandir -eq 1 ];then \
- echo "You should rebuild with 'make cleandir'";\
+ echo "You should rebuild with 'make cleansystem'";\
fi; \
if [ $$rebuild -eq 1 ];then \
cp .config .config.old;\
fi; \
fi; \
- fi
+ if [ -f .firstrun ]; then rm .firstrun; fi
# Pull in the user's configuration file
ifeq ($(filter $(noconfig_targets),$(MAKECMDGOALS)),)
@@ -161,8 +148,9 @@ include $(ADK_TOPDIR)/rules.mk
all: world
${ADK_TOPDIR}/package/Depends.mk: ${ADK_TOPDIR}/.config $(wildcard ${ADK_TOPDIR}/package/*/Makefile) $(ADK_TOPDIR)/adk/tools/depmaker
- @echo "Generating dependencies ..."
+ @printf " ---> generating dependencies.. "
$(ADK_TOPDIR)/adk/tools/depmaker > ${ADK_TOPDIR}/package/Depends.mk
+ @printf "done\n"
.NOTPARALLEL:
.PHONY: all world clean cleandir cleansystem distclean image_clean
@@ -170,7 +158,6 @@ ${ADK_TOPDIR}/package/Depends.mk: ${ADK_TOPDIR}/.config $(wildcard ${ADK_TOPDIR}
world:
@mkdir -p $(DL_DIR) $(HOST_BUILD_DIR) $(BUILD_DIR) $(TARGET_DIR) $(FW_DIR) \
$(STAGING_HOST_DIR) $(TOOLCHAIN_BUILD_DIR) $(STAGING_PKG_DIR)/stamps
- ${BASH} ${ADK_TOPDIR}/scripts/scan-pkgs.sh
ifeq ($(ADK_TARGET_TOOLCHAIN),y)
ifeq ($(ADK_TOOLCHAIN_ONLY),y)
$(MAKE) -f mk/build.mk package/hostcompile toolchain/final package/compile
@@ -192,12 +179,17 @@ ifeq ($(ADK_TARGET_PACKAGE_OPKG),y)
endif
${STAGING_TARGET_DIR} ${STAGING_TARGET_DIR}/etc ${STAGING_HOST_DIR}:
- @mkdir -p ${STAGING_TARGET_DIR}/{bin,etc,lib,usr/bin,usr/include,usr/lib/pkgconfig} \
- ${STAGING_HOST_DIR}/{usr/bin,usr/lib,usr/include}
- @for i in lib64 lib32 libx32;do \
- cd ${STAGING_TARGET_DIR}/; ln -sf lib $$i; \
+ mkdir -p ${STAGING_TARGET_DIR}/bin
+ mkdir -p ${STAGING_TARGET_DIR}/etc
+ mkdir -p ${STAGING_TARGET_DIR}/usr/bin
+ mkdir -p ${STAGING_TARGET_DIR}/lib
+ mkdir -p ${STAGING_HOST_DIR}/usr/bin
+ mkdir -p ${STAGING_HOST_DIR}/usr/lib
+ mkdir -p ${STAGING_HOST_DIR}/usr/include
+ @for i in lib64 lib32 libx32; do \
+ cd ${STAGING_TARGET_DIR}; ln -sf lib $$i; \
cd ${STAGING_TARGET_DIR}/usr; ln -sf lib $$i; \
- cd ${STAGING_HOST_DIR}/; ln -sf lib $$i; \
+ cd ${STAGING_HOST_DIR}; ln -sf lib $$i; \
cd ${STAGING_HOST_DIR}/usr; ln -sf lib $$i; \
done
@@ -237,7 +229,6 @@ newpackage:
@echo "Edit package/$(PKG)/Makefile to complete"
root_clean:
- @$(TRACE) root_clean
rm -rf $(TARGET_DIR)
mkdir -p $(TARGET_DIR)
touch $(TARGET_DIR)/.adk
@@ -248,7 +239,7 @@ root_clean:
# dependencies information.
clean:
- @$(TRACE) clean
+ @printf " ---> cleaning target build directories and files.. "
$(MAKE) -C $(CONFIG) clean
for f in $$(ls ${STAGING_PKG_DIR}/ 2>/dev/null |grep -v [A-Z]|grep -v stamps 2>/dev/null); do \
while read file ; do \
@@ -259,19 +250,23 @@ clean:
rm -rf $(BUILD_DIR) $(FW_DIR) $(TARGET_DIR) \
${ADK_TOPDIR}/package/pkglist.d
rm -f ${ADK_TOPDIR}/package/Depends.mk
+ @printf "done\n"
cleankernel:
- @$(TRACE) cleankernel
+ @printf " ---> cleaning kernel build directories.. "
@rm -rf $(TOOLCHAIN_BUILD_DIR)/w-linux* $(BUILD_DIR)/linux
+ @printf "done\n"
cleandir:
- @$(TRACE) cleandir
+ @printf " ---> cleaning all build directories and files.. "
@$(MAKE) -C $(CONFIG) clean $(MAKE_TRACE)
@rm -rf $(BUILD_DIR_PFX) $(FW_DIR_PFX) $(TARGET_DIR_PFX) \
${ADK_TOPDIR}/package/pkglist.d ${ADK_TOPDIR}/package/pkgconfigs.d
@rm -rf $(TOOLCHAIN_DIR_PFX) $(STAGING_HOST_DIR_PFX)
@rm -rf $(STAGING_TARGET_DIR_PFX) $(STAGING_PKG_DIR_PFX)
- @rm -f .menu .tmpconfig.h .rebuild* ${ADK_TOPDIR}/package/Depends.mk ${ADK_TOPDIR}/prereq.mk
+ @rm -f .menu .tmpconfig.h .rebuild*
+ @rm -f ${ADK_TOPDIR}/package/Depends.mk ${ADK_TOPDIR}/prereq.mk
+ @printf "done\n"
cleansystem:
@$(TRACE) cleansystem
@@ -280,20 +275,22 @@ cleansystem:
${ADK_TOPDIR}/package/pkglist.d ${ADK_TOPDIR}/package/pkgconfigs.d
@rm -rf $(TOOLCHAIN_DIR) $(STAGING_TARGET_DIR) $(STAGING_PKG_DIR) $(TOOLCHAIN_BUILD_DIR)
@rm -f .menu .tmpconfig.h .rebuild* ${ADK_TOPDIR}/package/Depends.mk ${ADK_TOPDIR}/prereq.mk
+ @printf "done\n"
distclean:
- @$(TRACE) distclean
+ @printf " ---> cleaning build directories, files and downloads.. "
@$(MAKE) -C $(CONFIG) clean $(MAKE_TRACE)
@rm -rf $(TOOLCHAIN_DIR_PFX) $(STAGING_HOST_DIR_PFX)
@rm -rf $(STAGING_TARGET_DIR_PFX) $(STAGING_PKG_DIR_PFX)
@rm -rf $(BUILD_DIR_PFX) $(FW_DIR_PFX) $(TARGET_DIR_PFX) $(DL_DIR)
@rm -rf package/pkglist.d package/pkgconfigs.d
- @rm -f .adkinit .config* .defconfig .tmpconfig.h all.config prereq.mk
- @rm -f .menu package/Depends.mk .ADK_HAVE_DOT_CONFIG .rebuild.*
+ @rm -f .config* .defconfig .tmpconfig.h all.config prereq.mk
+ @rm -f .firstrun .menu package/Depends.mk .ADK_HAVE_DOT_CONFIG .rebuild.*
@rm -f target/*/Config.in.arch* target/*/Config.in.system*
@rm -f package/Config.in.auto* package/Config.in.appliances
@rm -f target/config/Config.in.prereq target/config/Config.in.scripts
@rm -f adk/tools/pkgmaker adk/tools/depmaker adk/tools/pkgrebuild
+ @printf "done\n"
else # ! ifeq ($(strip $(ADK_HAVE_DOT_CONFIG)),y)
@@ -301,7 +298,6 @@ ifeq ($(filter-out distclean,${MAKECMDGOALS}),)
include ${ADK_TOPDIR}/mk/vars.mk
else
include $(ADK_TOPDIR)/prereq.mk
-export HOST_CC HOST_CXX BASH MAKE LANGUAGE LC_ALL OStype PATH QEMU SHELL
endif
all: menuconfig
@@ -450,50 +446,8 @@ defconfig: .menu $(CONFIG)/conf
@if [ ! -z "$(ADK_APPLIANCE)" ];then \
$(CONFIG)/conf --defconfig=.defconfig $(CONFIG_CONFIG_IN); \
fi
-ifeq (${OStype},Linux)
- @echo ADK_HOST_LINUX=y >> $(ADK_TOPDIR)/.config
-endif
-ifeq (${OStype},FreeBSD)
- @echo ADK_HOST_FREEBSD=y >> $(ADK_TOPDIR)/.config
-endif
-ifeq (${OStype},MirBSD)
- @echo ADK_HOST_MIRBSD=y >> $(ADK_TOPDIR)/.config
-endif
-ifeq (${OStype},OpenBSD)
- @echo ADK_HOST_OPENBSD=y >> $(ADK_TOPDIR)/.config
-endif
-ifeq (${OStype},NetBSD)
- @echo ADK_HOST_NETBSD=y >> $(ADK_TOPDIR)/.config
-endif
-ifeq (${OStype},Darwin)
- @echo ADK_HOST_DARWIN=y >> $(ADK_TOPDIR)/.config
-endif
-ifneq (,$(filter CYGWIN%,${OStype}))
- @echo ADK_HOST_CYGWIN=y >> $(ADK_TOPDIR)/.config
-endif
allconfig:
-ifeq (${OStype},Linux)
- @echo ADK_HOST_LINUX=y > $(ADK_TOPDIR)/all.config
-endif
-ifeq (${OStype},FreeBSD)
- @echo ADK_HOST_FREEBSD=y > $(ADK_TOPDIR)/all.config
-endif
-ifeq (${OStype},MirBSD)
- @echo ADK_HOST_MIRBSD=y > $(ADK_TOPDIR)/all.config
-endif
-ifeq (${OStype},OpenBSD)
- @echo ADK_HOST_OPENBSD=y > $(ADK_TOPDIR)/all.config
-endif
-ifeq (${OStype},NetBSD)
- @echo ADK_HOST_NETBSD=y > $(ADK_TOPDIR)/all.config
-endif
-ifeq (${OStype},Darwin)
- @echo ADK_HOST_DARWIN=y > $(ADK_TOPDIR)/all.config
-endif
-ifneq (,$(filter CYGWIN%,${OStype}))
- @echo ADK_HOST_CYGWIN=y > $(ADK_TOPDIR)/all.config
-endif
@if [ ! -z "$(ADK_APPLIANCE)" ];then \
grep "^config" target/config/Config.in.appliances \
|grep -i "_$(ADK_APPLIANCE)"\$$ \
@@ -541,19 +495,21 @@ _config: $(CONFIG)/conf allconfig .menu
@$(CONFIG)/conf ${W} $(CONFIG_CONFIG_IN)
${POSTCONFIG}
-distclean:
+distclean cleandir:
+ @printf " ---> cleaning build directories, files and downloads.. "
@$(MAKE) -C $(CONFIG) clean
@rm -rf $(BUILD_DIR_PFX) $(FW_DIR_PFX) $(TARGET_DIR_PFX) $(DL_DIR)
@rm -rf $(TOOLCHAIN_DIR_PFX) $(STAGING_TARGET_DIR_PFX)
@rm -rf $(STAGING_HOST_DIR_PFX) $(STAGING_TARGET_DIR_PFX) $(STAGING_PKG_DIR_PFX)
@rm -rf package/pkglist.d package/pkgconfigs.d
- @rm -f .adkinit .config* .defconfig .tmpconfig.h all.config
+ @rm -f .config* .defconfig .tmpconfig.h all.config
@rm -f .menu .rebuild.* package/Depends.mk .ADK_HAVE_DOT_CONFIG prereq.mk
@rm -f target/*/Config.in.arch*
@rm -f target/*/Config.in.system*
@rm -f package/Config.in.auto* package/Config.in.appliances
@rm -f target/config/Config.in.prereq target/config/Config.in.scripts
@rm -f adk/tools/pkgmaker adk/tools/depmaker adk/tools/pkgrebuild
+ @printf "done\n"
endif # ! ifeq ($(strip $(ADK_HAVE_DOT_CONFIG)),y)
@@ -573,14 +529,16 @@ $(ADK_TOPDIR)/adk/tools/depmaker: $(ADK_TOPDIR)/adk/tools/depmaker.c
@$(HOST_CC) $(HOST_CFLAGS) -o $@ $(ADK_TOPDIR)/adk/tools/depmaker.c
menu .menu: $(wildcard package/*/Makefile) $(wildcard target/*/systems) $(wildcard target/*/systems/*) $(ADK_TOPDIR)/adk/tools/pkgmaker $(ADK_TOPDIR)/adk/tools/pkgrebuild $(wildcard target/appliances/*)
- @echo "Generating menu structure ..."
- @$(BASH) $(ADK_TOPDIR)/scripts/create-menu
+ @printf " ---> generating menu structure.. "
+ @$(SHELL) $(ADK_TOPDIR)/scripts/create-menu
@$(ADK_TOPDIR)/adk/tools/pkgmaker
@:>.menu
+ @printf "done\n"
dep: $(ADK_TOPDIR)/adk/tools/depmaker
- @echo "Generating dependencies ..."
+ @printf " ---> generating dependencies.. "
@$(ADK_TOPDIR)/adk/tools/depmaker > ${ADK_TOPDIR}/package/Depends.mk
+ @printf "done\n"
.PHONY: menu dep
diff --git a/mk/buildhlp.mk b/mk/buildhlp.mk
index ae52fc132..f664e19b7 100644
--- a/mk/buildhlp.mk
+++ b/mk/buildhlp.mk
@@ -82,7 +82,7 @@ ${WRKDIST}/.prepared: ${WRKDIST}/.extract_done
$(MAKE_TRACE)
@${MAKE} post-patch $(MAKE_TRACE)
# always use latest config.sub/config.guess from OpenADK scripts directory
- cd ${WRKDIST}; \
+ @cd ${WRKDIST}; \
for i in $$(find . -name config.sub);do \
if [ -f $$i ]; then \
${CP} ${SCRIPT_DIR}/config.sub $$i; \
diff --git a/mk/fetch.mk b/mk/fetch.mk
index dfd190a55..13673b452 100644
--- a/mk/fetch.mk
+++ b/mk/fetch.mk
@@ -31,7 +31,7 @@ ifneq ($(ADK_DISABLE_CHECKSUM),y)
@if [ ! -e $(firstword ${FULLDISTFILES}).nohash ]; then \
OK=n; \
allsums="$(strip ${PKG_HASH})"; \
- (PATH='$(HOST_PATH)' sha256sum ${FULLDISTFILES}; echo exit) | while read sum name; do \
+ ($${SHA256} ${FULLDISTFILES}; echo exit) | while read sum name; do \
if [[ $$sum = exit ]]; then \
[[ $$OK = n ]] && echo >&2 "==> No distfile found!" || :; \
[[ $$OK = 1 ]] || exit 1; \
@@ -81,9 +81,9 @@ $(1):
;; \
http://*|https://*|ftp://*) \
for site in $${PKG_SITES} $${MASTER_SITE_BACKUP}; do \
- : echo "$${FETCH_CMD} $$$$site$$$$filename"; \
+ : echo "$${FETCHCMD} $$$$site$$$$filename"; \
rm -f "$$$$filename"; \
- if $${FETCH_CMD} $$$$site$$$$filename; then \
+ if $${FETCHCMD} $$$$filename $$$$site$$$$filename; then \
: check the size here; \
[[ ! -e $$$$filename ]] || exit 0; \
fi; \
diff --git a/mk/host-bottom.mk b/mk/host-bottom.mk
index caba52f3e..e28b1daf1 100644
--- a/mk/host-bottom.mk
+++ b/mk/host-bottom.mk
@@ -6,10 +6,10 @@ host-extract: ${_HOST_PATCH_COOKIE}
hostpre-configure:
host-configure:
${_HOST_CONFIGURE_COOKIE}: ${_HOST_PATCH_COOKIE}
- @mkdir -p ${WRKBUILD}
- @$(CMD_TRACE) "host configuring... "
+ mkdir -p ${WRKBUILD}
+ @$(CMD_TRACE) "configuring.. "
ifneq (,$(filter autogen,${AUTOTOOL_STYLE}))
- @$(CMD_TRACE) "autotool configuring... "
+ @$(CMD_TRACE) "autotool configuring.. "
@cd ${WRKSRC}; env ${AUTOTOOL_ENV} $(BASH) autogen.sh $(MAKE_TRACE)
endif
ifneq (,$(filter autoreconf,${AUTOTOOL_STYLE}))
@@ -17,17 +17,6 @@ ifneq (,$(filter autoreconf,${AUTOTOOL_STYLE}))
@rm -rf ${WRKSRC}/autom4te.cache
@touch ${WRKDIR}/.autoreconf_done
endif
- @cd ${WRKBUILD}; \
- for i in $$(find . -name config.sub);do \
- if [ -f $$i ]; then \
- ${CP} ${SCRIPT_DIR}/config.sub $$i; \
- fi; \
- done; \
- for i in $$(find . -name config.guess);do \
- if [ -f $$i ]; then \
- ${CP} ${SCRIPT_DIR}/config.guess $$i; \
- fi; \
- done;
@${MAKE} hostpre-configure $(MAKE_TRACE)
ifeq (${HOST_STYLE},)
cd ${WRKBUILD}; \
@@ -70,7 +59,7 @@ ifeq (${HOST_STYLE},manual)
${MAKE} host-configure $(MAKE_TRACE)
endif
ifeq (${HOST_STYLE},perl)
- @$(CMD_TRACE) "configuring perl module... "
+ @$(CMD_TRACE) "configuring perl module.. "
cd ${WRKBUILD}; \
PATH='${HOST_PATH}' \
PERL_MM_USE_DEFAULT=1 \
@@ -83,7 +72,7 @@ endif
host-build:
${_HOST_BUILD_COOKIE}: ${_HOST_CONFIGURE_COOKIE}
ifneq (${HOST_STYLE},manual)
- @$(CMD_TRACE) "host compiling... "
+ @$(CMD_TRACE) "compiling.. "
cd ${WRKBUILD} && env ${HOST_MAKE_ENV} ${MAKE} -f ${MAKE_FILE} \
${HOST_MAKE_FLAGS} ${HOST_ALL_TARGET} $(MAKE_TRACE)
endif
@@ -93,7 +82,7 @@ endif
hostpost-install:
host-install: ${ALL_HOSTINST}
${_HOST_FAKE_COOKIE}: ${_HOST_BUILD_COOKIE}
- @$(CMD_TRACE) "host installing... "
+ @$(CMD_TRACE) "installing.. "
@mkdir -p ${HOST_WRKINST}
ifeq (${HOST_STYLE},)
cd ${WRKBUILD} && env ${HOST_MAKE_ENV} ${MAKE} -f ${MAKE_FILE} \
@@ -113,16 +102,18 @@ endif
$(SED) "s,^prefix=.*,prefix=$(STAGING_HOST_DIR)/usr," $$a; \
chmod u+x $(STAGING_HOST_DIR)/usr/bin/$$(basename $$a); \
done
- @touch $@
+ touch $@
${_HOST_COOKIE}:
+ printf wbxdebug
exec ${MAKE} hostpackage
ifeq ($(HOST_LINUX_ONLY),)
hostpackage: ${ALL_HOSTDIRS}
- @touch ${_HOST_COOKIE}
+ touch ${_HOST_COOKIE}
endif
hostclean:
- @$(CMD_TRACE) "cleaning... "
- rm -rf ${WRKDIR} ${STAGING_PKG_DIR}/stamps/${PKG_NAME}*-host
+ @$(CMD_TRACE) "cleaning.. "
+ rm -r ${STAGING_PKG_DIR}/stamps/${PKG_NAME}*-host
+ rm -rf ${WRKDIR}
diff --git a/mk/image.mk b/mk/image.mk
index 5711140a9..15ebae324 100644
--- a/mk/image.mk
+++ b/mk/image.mk
@@ -107,15 +107,16 @@ ROOTFSUSERTARBALL= ${ADK_TARGET_SYSTEM}-${ADK_TARGET_LIBC}-${ADK_TARGET_FS}.tar.
ROOTFSISO= ${ADK_TARGET_SYSTEM}-${ADK_TARGET_LIBC}.iso
kernel-package: kernel-strip
- $(TRACE) target/$(ADK_TARGET_ARCH)-create-kernel-package
+ $(START_TRACE) "target/$(ADK_TARGET_ARCH)-create-kernel-package.. "
rm -rf $(KERNEL_PKGDIR)
@mkdir -p $(KERNEL_PKGDIR)/boot
cp $(BUILD_DIR)/$(TARGET_KERNEL) $(KERNEL_PKGDIR)/boot/kernel
@${BASH} ${SCRIPT_DIR}/make-ipkg-dir.sh ${KERNEL_PKGDIR} \
../linux/kernel.control ${KERNEL_VERSION} ${ADK_TARGET_CPU_ARCH}
$(PKG_BUILD) $(KERNEL_PKGDIR) $(PACKAGE_DIR) $(MAKE_TRACE)
- $(TRACE) target/$(ADK_TARGET_ARCH)-install-kernel-package
$(PKG_INSTALL) $(KERNEL_PKG) $(MAKE_TRACE)
+ $(CMD_TRACE) " done"
+ $(END_TRACE)
${FW_DIR}/${ROOTFSTARBALL}: ${TARGET_DIR}/.adk kernel-package
cd ${TARGET_DIR}; find . | sed -n '/^\.\//s///p' | \
diff --git a/mk/kernel-build.mk b/mk/kernel-build.mk
index 4649a78c5..a67b666cf 100644
--- a/mk/kernel-build.mk
+++ b/mk/kernel-build.mk
@@ -34,13 +34,12 @@ ADK_DEPMOD:=true
endif
$(LINUX_DIR)/.prepared: $(TOOLCHAIN_BUILD_DIR)/w-$(PKG_NAME)-$(PKG_VERSION)-$(PKG_RELEASE)/linux-$(KERNEL_FILE_VER)/.patched
- $(TRACE) target/kernel-prepare
ln -sf $(TOOLCHAIN_BUILD_DIR)/w-$(PKG_NAME)-$(PKG_VERSION)-$(PKG_RELEASE)/linux-$(KERNEL_FILE_VER) $(LINUX_DIR)
mkdir -p $(LINUX_BUILD_DIR)/kmod-control
touch $@
$(LINUX_DIR)/.config: $(LINUX_DIR)/.prepared $(BUILD_DIR)/.kernelconfig
- $(TRACE) target/$(ADK_TARGET_ARCH)-kernel-configure
+ $(START_TRACE) "target/$(ADK_TARGET_ARCH)-kernel-configure.. "
-for f in $(TARGETS);do if [ -f $$f ];then rm $$f;fi;done
ifeq ($(ADK_TARGET_KERNEL_USE_DEFCONFIG),y)
${KERNEL_MAKE_ENV} $(MAKE) -C "${LINUX_DIR}" ${KERNEL_MAKE_OPTS} $(ADK_TARGET_KERNEL_DEFCONFIG) $(MAKE_TRACE)
@@ -50,23 +49,31 @@ else
${KERNEL_MAKE_ENV} $(MAKE) -C "${LINUX_DIR}" ${KERNEL_MAKE_OPTS} KCONFIG_ALLCONFIG=mini.config allnoconfig $(MAKE_TRACE)
endif
touch -c $(LINUX_DIR)/.config
+ $(CMD_TRACE) " done"
+ $(END_TRACE)
$(LINUX_DIR)/$(KERNEL_FILE): $(LINUX_DIR)/.config
- $(TRACE) target/$(ADK_TARGET_ARCH)-kernel-compile
+ $(START_TRACE) "target/$(ADK_TARGET_ARCH)-kernel-compile.. "
${KERNEL_MAKE_ENV} $(MAKE) -C "${LINUX_DIR}" ${KERNEL_MAKE_OPTS} -j${ADK_MAKE_JOBS} $(KERNEL_TARGET) $(MAKE_TRACE)
touch -c $(LINUX_DIR)/$(KERNEL_FILE)
+ $(CMD_TRACE) " done"
+ $(END_TRACE)
$(LINUX_BUILD_DIR)/modules: $(LINUX_DIR)/$(KERNEL_FILE)
- $(TRACE) target/$(ADK_TARGET_ARCH)-kernel-modules-compile
+ $(START_TRACE) "target/$(ADK_TARGET_ARCH)-kernel-modules-compile.. "
${KERNEL_MAKE_ENV} $(MAKE) -C "${LINUX_DIR}" ${KERNEL_MAKE_OPTS} -j${ADK_MAKE_JOBS} modules $(MAKE_TRACE)
- $(TRACE) target/$(ADK_TARGET_ARCH)-kernel-modules-install
+ $(CMD_TRACE) " done"
+ $(END_TRACE)
+ $(START_TRACE) "target/$(ADK_TARGET_ARCH)-kernel-modules-install.. "
rm -rf $(LINUX_BUILD_DIR)/modules
${KERNEL_MAKE_ENV} $(MAKE) -C "${LINUX_DIR}" ${KERNEL_MAKE_OPTS} \
DEPMOD=$(ADK_DEPMOD) \
INSTALL_MOD_PATH=$(LINUX_BUILD_DIR)/modules \
modules_install $(MAKE_TRACE)
+ $(CMD_TRACE) " done"
+ $(END_TRACE)
ifneq ($(ADK_RUNTIME_DEV_UDEV),y)
- $(TRACE) target/$(ADK_TARGET_ARCH)-create-packages
+ $(START_TRACE) "target/$(ADK_TARGET_ARCH)-create-packages.. "
@mkdir -p ${PACKAGE_DIR}
PATH='${HOST_PATH}' ${BASH} ${SCRIPT_DIR}/make-module-ipkgs.sh \
"${ADK_TARGET_CPU_ARCH}" \
@@ -74,6 +81,8 @@ ifneq ($(ADK_RUNTIME_DEV_UDEV),y)
"${LINUX_BUILD_DIR}" \
"${PKG_BUILD}" \
"${PACKAGE_DIR}"
+ $(CMD_TRACE) " done"
+ $(END_TRACE)
endif
prepare:
@@ -83,12 +92,14 @@ else
compile: $(LINUX_DIR)/$(KERNEL_FILE)
endif
install: compile
- $(TRACE) target/${ADK_TARGET_ARCH}-modules-install
+ $(START_TRACE) "target/${ADK_TARGET_ARCH}-modules-install.. "
ifeq ($(ADK_TARGET_PACKAGE_IPKG)$(ADK_TARGET_PACKAGE_OPKG),y)
$(PKG_INSTALL) $(wildcard ${PACKAGE_DIR}/kmod-*) $(MAKE_TRACE)
else
$(foreach pkg,$(wildcard ${PACKAGE_DIR}/kmod-*),$(shell $(PKG_INSTALL) $(pkg)))
endif
+ $(CMD_TRACE) " done"
+ $(END_TRACE)
clean:
rm -rf $(LINUX_BUILD_DIR)
diff --git a/mk/kernel-vars.mk b/mk/kernel-vars.mk
index ee1ce803b..1b1baee87 100644
--- a/mk/kernel-vars.mk
+++ b/mk/kernel-vars.mk
@@ -10,9 +10,14 @@ KERNEL_MAKE_OPTS:= V=1 \
DISABLE_PAX_PLUGINS=y \
CONFIG_SHELL='${SHELL}'
-# regex for relocs needs pcre on Darwin
-ifeq (${OStype},Darwin)
-KERNEL_MAKE_OPTS+= HOSTCFLAGS='$(HOST_CPPFLAGS) ${HOST_CFLAGS}' HOSTLDFLAGS='-lpcreposix'
+# regex for relocs needs pcre
+ifeq ($(OS_FOR_BUILD),Darwin)
+KERNEL_MAKE_OPTS+= HOSTLDFLAGS='-lpcreposix'
+endif
+
+# non-Linux platforms need elf.h
+ifneq ($(OS_FOR_BUILD),Linux)
+KERNEL_MAKE_OPTS+= HOSTCFLAGS='$(HOST_CPPFLAGS) ${HOST_CFLAGS}'
KERNEL_MAKE_OPTS+= HOST_EXTRACFLAGS='-I ${ADK_TOPDIR}/adk/include -DKBUILD_NO_NLS'
else
KERNEL_MAKE_OPTS+= HOSTCFLAGS='${HOST_CFLAGS}'
diff --git a/mk/os.mk b/mk/os.mk
deleted file mode 100644
index 31d5dd789..000000000
--- a/mk/os.mk
+++ /dev/null
@@ -1,16 +0,0 @@
-# This file is part of the OpenADK project. OpenADK is copyrighted
-# material, please see the LICENCE file in the top-level directory.
-
-# operating system quirks
-ifeq (${OStype},Darwin)
-HOST_CC:=clang -fbracket-depth=1024
-HOST_CXX:=clang++ -fbracket-depth=1024
-else
-ifeq (${OStype},FreeBSD)
-HOST_CC:=clang -fbracket-depth=1024
-HOST_CXX:=clang++ -fbracket-depth=1024
-else
-HOST_CC:=${CC}
-HOST_CXX:=${CXX}
-endif
-endif
diff --git a/mk/package.mk b/mk/package.mk
index e0bd141cf..2c78ed1fd 100644
--- a/mk/package.mk
+++ b/mk/package.mk
@@ -299,12 +299,12 @@ endef
install-targets:
install:
- @$(CMD_TRACE) "installing... "
+ @$(CMD_TRACE) "installing.. "
@$(MAKE) install-targets $(MAKE_TRACE)
clean-targets:
clean:
- @$(CMD_TRACE) "cleaning... "
+ @$(CMD_TRACE) "cleaning.. "
@$(MAKE) clean-targets $(MAKE_TRACE)
rm -rf ${WRKDIR} ${ALL_IPKGS} ${_IPKGS_COOKIE}
diff --git a/mk/pkg-bottom.mk b/mk/pkg-bottom.mk
index e120ef391..f16f854e1 100644
--- a/mk/pkg-bottom.mk
+++ b/mk/pkg-bottom.mk
@@ -24,19 +24,19 @@ do-configure:
post-configure:
${_CONFIGURE_COOKIE}: ${_PATCH_COOKIE}
ifneq (,$(filter bootstrap,${AUTOTOOL_STYLE}))
- @$(CMD_TRACE) "autotool configuring... "
+ @$(CMD_TRACE) "autotool configuring.. "
@cd ${WRKSRC}; env ${AUTOTOOL_ENV} $(BASH) bootstrap.sh $(MAKE_TRACE)
endif
ifneq (,$(filter autogen,${AUTOTOOL_STYLE}))
- @$(CMD_TRACE) "autotool configuring... "
+ @$(CMD_TRACE) "autotool configuring.. "
@cd ${WRKSRC}; env ${AUTOTOOL_ENV} $(BASH) autogen.sh $(MAKE_TRACE)
endif
ifneq (,$(filter autoconf,${AUTOTOOL_STYLE}))
- @$(CMD_TRACE) "autotool configuring... "
+ @$(CMD_TRACE) "autotool configuring.. "
@cd ${WRKSRC}; env ${AUTOTOOL_ENV} autoconf $(MAKE_TRACE)
endif
ifneq (,$(filter autoreconf,${AUTOTOOL_STYLE}))
- @$(CMD_TRACE) "autotool configuring... "
+ @$(CMD_TRACE) "autotool configuring.. "
@cd ${WRKSRC}; env ${AUTOTOOL_ENV} autoreconf -vif $(MAKE_TRACE)
@rm -rf ${WRKSRC}/autom4te.cache
@touch ${WRKDIR}/.autoreconf_done
@@ -47,7 +47,7 @@ endif
ifneq ($(filter manual,${CONFIG_STYLE}),)
env ${CONFIGURE_ENV} ${MAKE} do-configure $(MAKE_TRACE)
else ifneq ($(filter cmake,${CONFIG_STYLE}),)
- @$(CMD_TRACE) "configuring cmake... "
+ @$(CMD_TRACE) "configuring cmake.. "
sed -e "s#@@TARGET_CC@@#$(TARGET_CC)#" \
-e "s#@@TARGET_CXX@@#$(TARGET_CXX)#" \
-e "s#@@TARGET_CFLAGS@@#$(TARGET_CFLAGS)#" \
@@ -61,19 +61,19 @@ else ifneq ($(filter cmake,${CONFIG_STYLE}),)
-DCMAKE_TOOLCHAIN_FILE="$(SCRIPT_DIR)/toolchain.cmake" \
${CMAKE_FLAGS} ${WRKSRC}) $(MAKE_TRACE)
else ifneq ($(filter minimal,${CONFIG_STYLE}),)
- @$(CMD_TRACE) "configuring... "
+ @$(CMD_TRACE) "configuring.. "
cd ${WRKBUILD}; rm -f config.{cache,status}; \
env ${CONFIGURE_ENV} \
${BASH} ${WRKSRC}/${CONFIGURE_PROG} \
${CONFIGURE_ARGS} $(MAKE_TRACE)
else ifneq ($(filter basic,${CONFIG_STYLE}),)
- @$(CMD_TRACE) "configuring... "
+ @$(CMD_TRACE) "configuring.. "
cd ${WRKBUILD}; rm -f config.{cache,status}; \
env ${CONFIGURE_ENV} \
${BASH} ${WRKSRC}/${CONFIGURE_PROG} ${CONFIGURE_TRIPLE} \
${CONFIGURE_ARGS} $(MAKE_TRACE)
else ifneq ($(filter perl,${CONFIG_STYLE}),)
- @$(CMD_TRACE) "configuring perl module... "
+ @$(CMD_TRACE) "configuring perl module.. "
if [ -f ${WRKBUILD}/Makefile.PL ]; then \
cd ${WRKBUILD}; \
PATH='${HOST_PATH}' \
@@ -88,7 +88,7 @@ else ifneq ($(filter perl,${CONFIG_STYLE}),)
perl-host Build.PL; \
fi
else ifeq ($(strip ${CONFIG_STYLE}),)
- @$(CMD_TRACE) "configuring... "
+ @$(CMD_TRACE) "configuring.. "
cd ${WRKBUILD}; rm -f config.{cache,status}; \
env ${CONFIGURE_ENV} \
${BASH} ${WRKSRC}/${CONFIGURE_PROG} ${CONFIGURE_TRIPLE} \
@@ -125,7 +125,7 @@ do-build:
post-build:
${_BUILD_COOKIE}: ${_CONFIGURE_COOKIE}
@env ${MAKE_ENV} ${MAKE} pre-build $(MAKE_TRACE)
- @$(CMD_TRACE) "compiling... "
+ @$(CMD_TRACE) "compiling.. "
ifneq ($(filter manual,${BUILD_STYLE}),)
env ${MAKE_ENV} ${MAKE} ${MAKE_FLAGS} do-build $(MAKE_TRACE)
else ifeq ($(strip ${BUILD_STYLE}),)
diff --git a/mk/vars.mk b/mk/vars.mk
index 96bcdbec6..860713107 100644
--- a/mk/vars.mk
+++ b/mk/vars.mk
@@ -426,9 +426,9 @@ QUIET:=
else
QUIET:= --quiet
endif
-FETCH_CMD?= PATH='${HOST_PATH}' wget --timeout=$(ADK_WGET_TIMEOUT) -t 3 --no-check-certificate $(QUIET)
+FETCHCMD?= PATH='${HOST_PATH}' wget --timeout=$(ADK_WGET_TIMEOUT) -t 3 --no-check-certificate $(QUIET)
-ifneq (,$(filter CYGWIN%,${OStype}))
+ifneq (,$(filter CYGWIN%,${OS_FOR_BUILD}))
EXEEXT:= .exe
endif