summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--target/Makefile75
1 files changed, 41 insertions, 34 deletions
diff --git a/target/Makefile b/target/Makefile
index 98c830329..e14f02398 100644
--- a/target/Makefile
+++ b/target/Makefile
@@ -14,7 +14,7 @@ all: install
# .kernelconfig.kernel
# 2) get the global and device-specific static kernel config and place it into
# .kernelconfig.board
-# 3) append ${FS_CMDLINE} to the kernel commandline inside .kernelconfig.board
+# 3) append $(FS_CMDLINE) to the kernel commandline inside .kernelconfig.board
# 4) merge both together into .kernelconfig.tmp
# 5) check if .kernelconfig.tmp differs from the current one
# (.kernelconfig) at all, overwriting the current one
@@ -25,65 +25,65 @@ ADK_PACKAGE_CRYPTINIT_ROOT:=$(strip $(subst ",, $(ADK_PACKAGE_CRYPTINIT_ROOT)))
ADK_PACKAGE_CRYPTINIT_SWAP:=$(strip $(subst ",, $(ADK_PACKAGE_CRYPTINIT_SWAP)))
ADK_PACKAGE_CMDLINE:=root=$(ADK_PACKAGE_CRYPTINIT_ROOT) swap=$(ADK_PACKAGE_CRYPTINIT_SWAP) resume=/dev/mapper/swapcrypt
-ifeq (${ADK_TARGET_KERNEL_CUSTOMISING},y)
+ifeq ($(ADK_TARGET_KERNEL_CUSTOMISING),y)
config-prepare: $(ADK_TOPDIR)/.config
- @PATH='$(HOST_PATH)' sed -n '/^ADK_KERNEL/s//CONFIG/p' ${ADK_TOPDIR}/.config \
- >${BUILD_DIR}/.kernelconfig.kernel
- @if [ -f ${ADK_TARGET_ARCH}/kernel/${ADK_TARGET_KERNEL_MINICONFIG} ];then \
- cat ${ADK_TOPDIR}/target/linux/kernel.config \
- ${ADK_TARGET_ARCH}/kernel/${ADK_TARGET_KERNEL_MINICONFIG} > ${BUILD_DIR}/.kernelconfig.board; \
+ @PATH='$(HOST_PATH)' sed -n '/^ADK_KERNEL/s//CONFIG/p' $(ADK_TOPDIR)/.config \
+ >$(BUILD_DIR)/.kernelconfig.kernel
+ @if [ -f $(ADK_TARGET_ARCH)/kernel/$(ADK_TARGET_KERNEL_MINICONFIG) ];then \
+ cat $(ADK_TOPDIR)/target/linux/kernel.config \
+ $(ADK_TARGET_ARCH)/kernel/$(ADK_TARGET_KERNEL_MINICONFIG) > $(BUILD_DIR)/.kernelconfig.board; \
else \
echo "no miniconfig found for target system"; \
exit 1; \
fi
ifeq ($(ADK_TARGET_SYSTEM_QEMU_M68K),y)
- @PATH='$(HOST_PATH)' sed -i -e 's#^\(CONFIG_.*BOOTPARAM_STRING="\)\(.*\)"#\1\2 ro ${FS_CMDLINE}"#' \
- ${BUILD_DIR}/.kernelconfig.board
+ @$(SED) 's#^\(CONFIG_.*BOOTPARAM_STRING="\)\(.*\)"#\1\2 ro $(FS_CMDLINE)"#' \
+ $(BUILD_DIR)/.kernelconfig.board
endif
ifeq ($(ADK_TARGET_ROOTFS_NFSROOT),)
- @PATH='$(HOST_PATH)' sed -i -e 's#^\(CONFIG_.*CMDLINE="\)\(.*\)"#\1\2 ro"#' \
- ${BUILD_DIR}/.kernelconfig.board
+ @$(SED) 's#^\(CONFIG_.*CMDLINE="\)\(.*\)"#\1\2 ro"#' \
+ $(BUILD_DIR)/.kernelconfig.board
endif
- @PATH='$(HOST_PATH)' sed -i -e 's#^\(CONFIG_.*CMDLINE="\)\(.*\)"#\1\2 ${FS_CMDLINE}"#' \
- ${BUILD_DIR}/.kernelconfig.board
+ @$(SED) 's#^\(CONFIG_.*CMDLINE="\)\(.*\)"#\1\2 $(FS_CMDLINE)"#' \
+ $(BUILD_DIR)/.kernelconfig.board
ifneq ($(ADK_TARGET_CMDLINE),)
- @PATH='$(HOST_PATH)' sed -i -e 's#^\(CONFIG_.*CMDLINE="\)\(.*\)"#\1\2 ${ADK_TARGET_CMDLINE}"#' \
- ${BUILD_DIR}/.kernelconfig.board
+ @$(SED) 's#^\(CONFIG_.*CMDLINE="\)\(.*\)"#\1\2 $(ADK_TARGET_CMDLINE)"#' \
+ $(BUILD_DIR)/.kernelconfig.board
endif
ifeq ($(ADK_TARGET_QEMU_WITH_GRAPHIC),y)
- @PATH='$(HOST_PATH)' sed -i -e 's#^\(CONFIG_.*CMDLINE="\)\(.*\)"#\1\2 console=tty0"#' \
- ${BUILD_DIR}/.kernelconfig.board
+ @$(SED) 's#^\(CONFIG_.*CMDLINE="\)\(.*\)"#\1\2 console=tty0"#' \
+ $(BUILD_DIR)/.kernelconfig.board
endif
ifneq ($(ADK_PACKAGE_CRYPTINIT_ROOT),)
- @PATH='$(HOST_PATH)' sed -i -e 's#^\(CONFIG_.*CMDLINE="\)\(.*\)"#\1\2 ${ADK_PACKAGE_CMDLINE}"#' \
- ${BUILD_DIR}/.kernelconfig.board
+ @$(SED) 's#^\(CONFIG_.*CMDLINE="\)\(.*\)"#\1\2 $(ADK_PACKAGE_CMDLINE)"#' \
+ $(BUILD_DIR)/.kernelconfig.board
endif
ifeq ($(ADK_RUNTIME_QUIET_INIT),y)
- @PATH='$(HOST_PATH)' sed -i -e 's#^\(CONFIG_.*CMDLINE="\)\(.*\)"#\1\2 rcquiet=1"#' \
- ${BUILD_DIR}/.kernelconfig.board
+ @$(SED) 's#^\(CONFIG_.*CMDLINE="\)\(.*\)"#\1\2 rcquiet=1"#' \
+ $(BUILD_DIR)/.kernelconfig.board
endif
ifeq ($(ADK_QUIET_KERNEL),y)
- @PATH='$(HOST_PATH)' sed -i -e 's#^\(CONFIG_.*CMDLINE="\)\(.*\)"#\1\2 quiet loglevel=2 vt.global_cursor_default=0"#' \
- ${BUILD_DIR}/.kernelconfig.board
+ @$(SED) 's#^\(CONFIG_.*CMDLINE="\)\(.*\)"#\1\2 quiet loglevel=2 vt.global_cursor_default=0"#' \
+ $(BUILD_DIR)/.kernelconfig.board
endif
ifeq ($(ADK_KERNEL_DEBUG_WITH_KGDB),y)
- @PATH='$(HOST_PATH)' sed -i -e 's#^\(CONFIG_.*CMDLINE="\)\(.*\)"#\1\2 kgdbwait kgdboc=ttyS0,115200"#' \
- ${BUILD_DIR}/.kernelconfig.board
+ @$(SED) 's#^\(CONFIG_.*CMDLINE="\)\(.*\)"#\1\2 kgdbwait kgdboc=ttyS0,115200"#' \
+ $(BUILD_DIR)/.kernelconfig.board
endif
ifeq ($(ADK_KERNEL_NETCONSOLE),y)
- @PATH='$(HOST_PATH)' sed -i -e 's#^\(CONFIG_.*CMDLINE="\)\(.*\)"#\1\2 netconsole=@$(ADK_PARAMETER_NETCONSOLE_SRC_IP)/,@$(ADK_PARAMETER_NETCONSOLE_DST_IP)/"#' \
- ${BUILD_DIR}/.kernelconfig.board
+ @$(SED) 's#^\(CONFIG_.*CMDLINE="\)\(.*\)"#\1\2 netconsole=@$(ADK_PARAMETER_NETCONSOLE_SRC_IP)/,@$(ADK_PARAMETER_NETCONSOLE_DST_IP)/"#' \
+ $(BUILD_DIR)/.kernelconfig.board
endif
- @cd ${BUILD_DIR} && cat .kernelconfig.board .kernelconfig.kernel \
+ @cd $(BUILD_DIR) && cat .kernelconfig.board .kernelconfig.kernel \
>.kernelconfig.tmp
- @cd ${BUILD_DIR} && cmp -s .kernelconfig.tmp .kernelconfig || \
+ @cd $(BUILD_DIR) && cmp -s .kernelconfig.tmp .kernelconfig || \
cp .kernelconfig.tmp .kernelconfig
- @-rm -f ${BUILD_DIR}/.kernelconfig.tmp
+ @-rm -f $(BUILD_DIR)/.kernelconfig.tmp
else
config-prepare: $(ADK_TOPDIR)/.config
- @if [ -f ${ADK_TARGET_ARCH}/kernel/${ADK_TARGET_KERNEL_MINICONFIG} ];then \
- cat ${ADK_TOPDIR}/target/linux/kernel.config \
- ${ADK_TARGET_ARCH}/kernel/${ADK_TARGET_KERNEL_MINICONFIG} > ${BUILD_DIR}/.kernelconfig.board; \
+ @if [ -f $(ADK_TARGET_ARCH)/kernel/$(ADK_TARGET_KERNEL_MINICONFIG) ];then \
+ cat $(ADK_TOPDIR)/target/linux/kernel.config \
+ $(ADK_TARGET_ARCH)/kernel/$(ADK_TARGET_KERNEL_MINICONFIG) > $(BUILD_DIR)/.kernelconfig.board; \
else \
echo "no miniconfig found for target system"; \
exit 1; \
@@ -100,24 +100,31 @@ clean: $(ADK_TARGET_ARCH)-clean $(ADK_TARGET_ARCH)-imageclean
%-clean:
$(TRACE) target/$(patsubst %-clean,%,$@)-clean
$(MAKE) -C $(patsubst %-clean,%,$@) clean
+
%-imageclean:
$(TRACE) target/$(patsubst %-imageclean,%,$@)-imageclean
$(MAKE) -C $(patsubst %-imageclean,%,$@) imageclean
+
%-prepare:
$(TRACE) target/$(patsubst %-prepare,%,$@)-prepare
$(MAKE) -C $(patsubst %-prepare,%,$@) prepare
+
%-imageprepare:
$(TRACE) target/$(patsubst %-imageprepare,%,$@)-imageprepare
$(MAKE) -C $(patsubst %-imageprepare,%,$@) imageprepare
+
%-compile: %-prepare
$(TRACE) target/$(patsubst %-compile,%,$@)-compile
$(MAKE) -C $(patsubst %-compile,%,$@) compile
+
%-install: %-compile
$(TRACE) target/$(patsubst %-install,%,$@)-install
$(MAKE) -C $(patsubst %-install,%,$@) install
+
%-targethelp:
$(MAKE) -C $(patsubst %-targethelp,%,$@) targethelp
+
%-imageinstall: %-imageprepare
$(TRACE) target/$(patsubst %-imageinstall,%,$@)-imageinstall
$(MAKE) -C $(patsubst %-imageinstall,%,$@) imageinstall
- @echo 'Login as user root with password ${ADK_RUNTIME_PASSWORD} via ssh or console.'
+ @echo 'Login as user root with password $(ADK_RUNTIME_PASSWORD) via ssh or console.'