diff options
Diffstat (limited to 'mk')
-rw-r--r-- | mk/build.mk | 79 | ||||
-rw-r--r-- | mk/cpu.mk | 2 | ||||
-rw-r--r-- | mk/image.mk | 12 | ||||
-rw-r--r-- | mk/kernel-build.mk | 20 | ||||
-rw-r--r-- | mk/kernel.mk | 10 | ||||
-rw-r--r-- | mk/modules.mk | 2 | ||||
-rw-r--r-- | mk/vars.mk | 4 |
7 files changed, 83 insertions, 46 deletions
diff --git a/mk/build.mk b/mk/build.mk index c3795b404..3bfd3bce9 100644 --- a/mk/build.mk +++ b/mk/build.mk @@ -10,6 +10,10 @@ endif CONFIG_CONFIG_IN = Config.in CONFIG = config +DEFCONFIG= ADK_DEVELSYSTEM=n \ + ADK_DEBUG=n \ + ADK_STATIC=n \ + ADK_FORCE_PARALLEL=n noconfig_targets:= menuconfig \ _config \ @@ -20,10 +24,11 @@ MAKECLEAN_SYMBOLS= ADK_TARGET_LIB_UCLIBC \ ADK_TARGET_LIB_GLIBC \ ADK_TARGET_LIB_ECLIBC \ ADK_IPV6 ADK_CXX ADK_DEBUG + POSTCONFIG= -@\ if [ -f .config.old ];then \ if [ -d .cfg ];then \ - what=cleandevice; \ + what=cleantarget; \ for symbol in ${MAKECLEAN_SYMBOLS}; do \ newval=$$(grep -e "^$$symbol=" -e "^\# $$symbol " .config); \ oldval=$$(cat .cfg/"$$symbol" 2>&-); \ @@ -53,7 +58,7 @@ include ${TOPDIR}/mk/split-cfg.mk all: world .NOTPARALLEL: -.PHONY: all world clean cleandevice cleandir distclean image_clean +.PHONY: all world clean cleantarget cleandir distclean image_clean world: $(DISTDIR) $(BUILD_DIR) $(TARGET_DIR) $(PACKAGE_DIR) ${TOPDIR}/.cfg/ADK_HAVE_DOT_CONFIG ${BASH} ${TOPDIR}/scripts/scan-pkgs.sh @@ -107,14 +112,15 @@ image: $(MAKE) -C target image switch: - echo "Saving configuration for device: ${DEVICE}" - cp .config .config.${DEVICE} - mv .cfg .cfg.${DEVICE} - if [ -f .config.${DEV} ];then cp .config.${DEV} .config; \ - cp .config.${DEV} .config.old; \ - mv .cfg.${DEV} .cfg; \ - echo "Setting configuration to device: ${DEV}"; \ - else echo "No old device config found";mv .config .config.bak;fi + 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;fi ############################################################# # @@ -135,9 +141,9 @@ clean: @$(TRACE) clean $(MAKE) -C $(CONFIG) clean for d in ${STAGING_PARENT_PFX}; do \ - #echo "clean: entering $$d" ; \ + echo "clean: entering $$d" ; \ for f in $$(ls $$d/pkg/[a-z]* 2>/dev/null); do \ - #echo "clean: cleaning for $$f" ; \ + echo "clean: cleaning for $$f" ; \ while read file ; do \ rm $$d/target/$$file 2>/dev/null; \ done < $$f ; \ @@ -158,8 +164,8 @@ cleandir: rm -rf $(TOOLCHAIN_BUILD_DIR_PFX) $(STAGING_PARENT_PFX) $(TOOLS_BUILD_DIR) rm -f .tmpconfig.h ${TOPDIR}/package/*/info.mk -cleandevice: - @$(TRACE) cleandevice +cleantarget: + @$(TRACE) cleantarget $(MAKE) -C $(CONFIG) clean rm -rf $(BUILD_DIR) $(BIN_DIR) $(TARGET_DIR) ${TOPDIR}/.cfg rm -rf $(TOOLCHAIN_BUILD_DIR) $(STAGING_PARENT) @@ -167,8 +173,8 @@ cleandevice: distclean: @$(TRACE) distclean - $(MAKE) -C $(CONFIG) clean - rm -rf $(BUILD_DIR_PFX) $(BIN_DIR_PFX) $(TARGET_DIR_PFX) $(DISTDIR) ${TOPDIR}/.cfg + @$(MAKE) -C $(CONFIG) clean + rm -rf $(BUILD_DIR_PFX) $(BIN_DIR_PFX) $(TARGET_DIR_PFX) $(DISTDIR) ${TOPDIR}/.cfg* rm -rf $(TOOLCHAIN_BUILD_DIR_PFX) $(STAGING_PARENT_PFX) $(TOOLS_BUILD_DIR) rm -f .config* .tmpconfig.h ${TOPDIR}/package/*/info.mk @@ -191,7 +197,38 @@ $(CONFIG)/conf: $(CONFIG)/mconf: @$(MAKE) -C $(CONFIG) -menuconfig: $(CONFIG)/mconf +defconfig: + @if [ ! -z "$(TARGET)" ];then \ + grep "^config" target/Config.in |grep -i "$(TARGET)"|sed -e "s#^config \(.*\)#\1=y#" > $(TOPDIR)/.defconfig; \ + for symbol in ${DEFCONFIG}; do \ + echo $$symbol >> $(TOPDIR)/.defconfig; \ + done; \ + fi +ifneq (,$(filter %_qemu,${TARGET})) + @echo ADK_LINUX_QEMU=y >> $(TOPDIR)/.defconfig +endif +ifneq (,$(filter %_rescue,${TARGET})) + @echo ADK_LINUX_RESCUE=y >> $(TOPDIR)/.defconfig +endif + @if [ ! -z "$(TARGET)" ];then \ + $(CONFIG)/conf -D .defconfig $(CONFIG_CONFIG_IN); \ + fi + +modconfig: + @if [ ! -z "$(TARGET)" ];then \ + grep "^config" target/Config.in |grep -i "$(TARGET)"|sed -e "s#^config \(.*\)#\1=y#" > $(TOPDIR)/all.config; \ + for symbol in ${DEFCONFIG}; do \ + echo $$symbol >> $(TOPDIR)/all.config; \ + done; \ + fi +ifneq (,$(filter %_qemu,${TARGET})) + @echo ADK_LINUX_QEMU=y >> $(TOPDIR)/all.config +endif +ifneq (,$(filter %_rescue,${TARGET})) + @echo ADK_LINUX_RESCUE=y >> $(TOPDIR)/all.config +endif + +menuconfig: $(CONFIG)/mconf defconfig @$(CONFIG)/mconf $(CONFIG_CONFIG_IN) ${POSTCONFIG} @@ -202,13 +239,13 @@ _config: $(CONFIG)/conf .NOTPARALLEL: _mconfig _mconfig: ${CONFIG}/conf _mconfig2 _config -_mconfig2: ${CONFIG}/conf +_mconfig2: ${CONFIG}/conf modconfig @${CONFIG}/conf -m ${RCONFIG} >/dev/null distclean: @$(MAKE) -C $(CONFIG) clean - rm -rf $(BUILD_DIR) $(TOOLS_BUILD_DIR) $(BIN_DIR) $(DISTDIR) ${TOPDIR}/.cfg - rm -rf $(TOOLCHAIN_BUILD_DIR) $(STAGING_PARENT) $(TARGET_DIR) - rm -f .config* .tmpconfig.h ${TOPDIR}/package/*/info.mk + @rm -rf $(BUILD_DIR) $(TOOLS_BUILD_DIR) $(BIN_DIR) $(DISTDIR) ${TOPDIR}/.cfg* + @rm -rf $(TOOLCHAIN_BUILD_DIR) $(STAGING_PARENT) $(TARGET_DIR) + @rm -f .config* .tmpconfig.h ${TOPDIR}/package/*/info.mk endif # ifeq ($(strip $(ADK_HAVE_DOT_CONFIG)),y) @@ -3,7 +3,7 @@ # # optimization configure options for CPU features -ifeq ($(DEVICE),alix1c) +ifeq ($(ADK_TARGET),alix1c) CONFIGURE_CPU_OPTS:= --disable-ssse3 \ --disable-sse \ --enable-amd3dnow \ diff --git a/mk/image.mk b/mk/image.mk index 7c61a137d..50c5d8b95 100644 --- a/mk/image.mk +++ b/mk/image.mk @@ -48,10 +48,10 @@ image-prepare-post: chmod 4511 ${TARGET_DIR}/bin/busybox chmod 1777 ${TARGET_DIR}/tmp -INITRAMFS= ${DEVICE}-${ARCH}-${FS} -ROOTFSSQUASHFS= ${DEVICE}-${ARCH}-${FS}.img -ROOTFSTARBALL= ${DEVICE}-${ARCH}-${FS}.tar.gz -INITRAMFS_PIGGYBACK= ${DEVICE}-${ARCH}-${FS}.cpio +INITRAMFS= ${ADK_TARGET}-${ARCH}-${FS} +ROOTFSSQUASHFS= ${ADK_TARGET}-${ARCH}-${FS}.img +ROOTFSTARBALL= ${ADK_TARGET}-${ARCH}-${FS}.tar.gz +INITRAMFS_PIGGYBACK= ${ADK_TARGET}-${ARCH}-${FS}.cpio ${BIN_DIR}/${ROOTFSTARBALL}: ${TARGET_DIR} cd ${TARGET_DIR}; tar -cf - --owner=0 --group=0 . | gzip -n9 >$@ @@ -68,11 +68,11 @@ ${BIN_DIR}/${ROOTFSSQUASHFS}: ${TARGET_DIR} PATH='${TARGET_PATH}' \ mksquashfs ${TARGET_DIR} ${BUILD_DIR}/root.squashfs \ -nopad -noappend -root-owned $(MAKE_TRACE) - cat ${BIN_DIR}/${DEVICE}-${ARCH}-kernel ${BUILD_DIR}/root.squashfs > \ + cat ${BIN_DIR}/${ADK_TARGET}-${ARCH}-kernel ${BUILD_DIR}/root.squashfs > \ ${BUILD_DIR}/${ROOTFSSQUASHFS} # padding of images is required dd if=${BUILD_DIR}/${ROOTFSSQUASHFS} of=${BIN_DIR}/${ROOTFSSQUASHFS} \ bs=4063232 conv=sync $(MAKE_TRACE) imageclean: - rm -f $(BIN_DIR)/$(DEVICE)-* ${BUILD_DIR}/$(DEVICE)-* + rm -f $(BIN_DIR)/$(ADK_TARGET)-* ${BUILD_DIR}/$(ADK_TARGET)-* diff --git a/mk/kernel-build.mk b/mk/kernel-build.mk index b8dccfe84..c32964c10 100644 --- a/mk/kernel-build.mk +++ b/mk/kernel-build.mk @@ -13,19 +13,19 @@ KERNEL_MAKE_OPTS+= CROSS_COMPILE="$(TARGET_CROSS)" ARCH=$(ARCH) CC="$(TARGET_CC) endif $(TOOLCHAIN_BUILD_DIR)/linux-$(KERNEL_VERSION)/.patched: - $(TRACE) target/$(DEVICE)-kernel-patch + $(TRACE) target/$(ADK_TARGET)-kernel-patch $(PATCH) $(TOOLCHAIN_BUILD_DIR)/linux-$(KERNEL_VERSION) ../linux/patches/$(KERNEL_VERSION) *.patch $(MAKE_TRACE) - $(PATCH) $(TOOLCHAIN_BUILD_DIR)/linux-$(KERNEL_VERSION) ../$(DEVICE)/patches *.patch $(MAKE_TRACE) + $(PATCH) $(TOOLCHAIN_BUILD_DIR)/linux-$(KERNEL_VERSION) ../$(ADK_TARGET)/patches *.patch $(MAKE_TRACE) touch $@ $(LINUX_DIR)/.prepared: $(TOOLCHAIN_BUILD_DIR)/linux-$(KERNEL_VERSION)/.patched - $(TRACE) target/$(DEVICE)-kernel-prepare + $(TRACE) target/$(ADK_TARGET)-kernel-prepare ln -sf $(TOOLCHAIN_BUILD_DIR)/linux-$(KERNEL_VERSION) $(LINUX_DIR) mkdir -p $(LINUX_BUILD_DIR)/kmod-control touch $@ $(LINUX_DIR)/.config: $(LINUX_DIR)/.prepared $(BUILD_DIR)/.kernelconfig - $(TRACE) target/$(DEVICE)-kernel-configure + $(TRACE) target/$(ADK_TARGET)-kernel-configure for f in $(TARGETS);do if [ -f $$f ];then rm $$f;fi;done $(MAKE_TRACE) $(CP) $(BUILD_DIR)/.kernelconfig $(LINUX_DIR)/.config echo N | $(MAKE) ${KERNEL_MAKE_OPTS} oldconfig $(MAKE_TRACE) @@ -33,30 +33,30 @@ $(LINUX_DIR)/.config: $(LINUX_DIR)/.prepared $(BUILD_DIR)/.kernelconfig touch -c $(LINUX_DIR)/.config $(LINUX_DIR)/vmlinux: $(LINUX_DIR)/.config - $(TRACE) target/$(DEVICE)-kernel-compile + $(TRACE) target/$(ADK_TARGET)-kernel-compile $(MAKE) ${KERNEL_MAKE_OPTS} -j${ADK_MAKE_JOBS} $(MAKE_TRACE) - $(TRACE) target/$(DEVICE)-kernel-modules-install + $(TRACE) target/$(ADK_TARGET)-kernel-modules-install rm -rf $(LINUX_BUILD_DIR)/modules $(MAKE) ${KERNEL_MAKE_OPTS} DEPMOD=true \ INSTALL_MOD_PATH=$(LINUX_BUILD_DIR)/modules \ modules_install $(MAKE_TRACE) - $(TRACE) target/$(DEVICE)-create-packages + $(TRACE) target/$(ADK_TARGET)-create-packages $(MAKE) $(KERNEL_PKG) $(TARGETS) touch -c $(LINUX_DIR)/vmlinux $(KERNEL_PKG): - $(TRACE) target/$(DEVICE)-create-kernel-package + $(TRACE) target/$(ADK_TARGET)-create-kernel-package rm -rf $(KERNEL_PKGDIR) @mkdir -p $(KERNEL_PKGDIR)/etc ${BASH} ${SCRIPT_DIR}/make-ipkg-dir.sh ${KERNEL_PKGDIR} \ - ../linux/kernel.control ${DEVICE}-${KERNEL_VERSION} ${CPU_ARCH} + ../linux/kernel.control ${ADK_TARGET}-${KERNEL_VERSION} ${CPU_ARCH} $(PKG_BUILD) $(KERNEL_PKGDIR) $(PACKAGE_DIR) $(MAKE_TRACE) prepare: compile: $(LINUX_DIR)/vmlinux install: compile ifneq ($(strip $(INSTALL_TARGETS)),) - $(TRACE) target/${DEVICE}-modules-install + $(TRACE) target/${ADK_TARGET}-modules-install $(PKG_INSTALL) $(INSTALL_TARGETS) $(MAKE_TRACE) endif diff --git a/mk/kernel.mk b/mk/kernel.mk index 365cc12e6..33fbf5c2a 100644 --- a/mk/kernel.mk +++ b/mk/kernel.mk @@ -4,12 +4,12 @@ LINUX_KMOD_SUFFIX=ko MODULES_SUBDIR := lib/modules/$(KERNEL_VERSION) -LINUX_BUILD_DIR := $(BUILD_DIR)/linux-$(ARCH)-$(DEVICE) +LINUX_BUILD_DIR := $(BUILD_DIR)/linux-$(ARCH)-$(ADK_TARGET) KMOD_BUILD_DIR := $(LINUX_BUILD_DIR)/linux-modules MODULES_DIR := $(LINUX_BUILD_DIR)/modules/$(MODULES_SUBDIR) TARGET_MODULES_DIR := $(LINUX_TARGET_DIR)/$(MODULES_SUBDIR) -KERNEL_PKG:=$(PACKAGE_DIR)/kernel_$(DEVICE)-$(KERNEL_VERSION)_$(CPU_ARCH).$(PKG_SUFFIX) +KERNEL_PKG:=$(PACKAGE_DIR)/kernel_$(ADK_TARGET)-$(KERNEL_VERSION)_$(CPU_ARCH).$(PKG_SUFFIX) INSTALL_TARGETS:= $(KERNEL_PKG) NOINSTALL_TARGETS:= TARGETS:= @@ -30,9 +30,9 @@ TARGETS:= # define KMOD_template -IDEPENDK_$(1):=kernel ($(DEVICE)-$(KERNEL_VERSION)) $(foreach pkg,$(5),", $(pkg)") +IDEPENDK_$(1):=kernel ($(ADK_TARGET)-$(KERNEL_VERSION)) $(foreach pkg,$(5),", $(pkg)") -PKG_$(1) := $(PACKAGE_DIR)/kmod-$(2)_$(DEVICE)-$(KERNEL_VERSION)-$(KERNEL_RELEASE)_$(CPU_ARCH).$(PKG_SUFFIX) +PKG_$(1) := $(PACKAGE_DIR)/kmod-$(2)_$(ADK_TARGET)-$(KERNEL_VERSION)-$(KERNEL_RELEASE)_$(CPU_ARCH).$(PKG_SUFFIX) I_$(1) := $(KMOD_BUILD_DIR)/ipkg/$(2) ifeq ($$(ADK_KPACKAGE_KMOD_$(1)),m) @@ -52,7 +52,7 @@ $$(PKG_$(1)): echo "Description: kernel module $(2)" >> $(LINUX_BUILD_DIR)/kmod-control/kmod-$(2).control ${BASH} ${SCRIPT_DIR}/make-ipkg-dir.sh $$(I_$(1)) \ $(LINUX_BUILD_DIR)/kmod-control/kmod-$(2).control \ - $(DEVICE)-$(KERNEL_VERSION)-$(KERNEL_RELEASE) $(CPU_ARCH) + $(ADK_TARGET)-$(KERNEL_VERSION)-$(KERNEL_RELEASE) $(CPU_ARCH) echo "Depends: $$(IDEPENDK_$(1))" >> $$(I_$(1))/CONTROL/control ifneq ($(strip $(3)),) mkdir -p $$(I_$(1))/lib/modules/$(KERNEL_VERSION) diff --git a/mk/modules.mk b/mk/modules.mk index dc98493e1..bdb8fa897 100644 --- a/mk/modules.mk +++ b/mk/modules.mk @@ -54,7 +54,7 @@ $(eval $(call KMOD_template,MAC80211,mac80211,\ ,15, kmod-crypto-aes kmod-crypto-arc4 kmod-crypto-ecb kmod-crc32)) $(eval $(call KMOD_template,ATH5K,mac80211-ath5k,\ - $(MODULES_DIR)/kernel/drivers/net/wireless/ath5k/ath5k \ + $(MODULES_DIR)/kernel/drivers/net/wireless/ath/ath5k/ath5k \ ,20, kmod-led-class)) $(eval $(call KMOD_template,RT2X00,mac80211-rt2x00,\ diff --git a/mk/vars.mk b/mk/vars.mk index 45975779f..b68cd6297 100644 --- a/mk/vars.mk +++ b/mk/vars.mk @@ -31,10 +31,10 @@ TOOLCHAIN_BUILD_DIR= $(BASE_DIR)/toolchain_build_${CPU_ARCH} TOOLCHAIN_BUILD_DIR_PFX=$(BASE_DIR)/toolchain_build_* TOOLS_BUILD_DIR= $(BASE_DIR)/tools_build SCRIPT_DIR:= $(BASE_DIR)/scripts -BIN_DIR:= $(BASE_DIR)/bin_${DEVICE} +BIN_DIR:= $(BASE_DIR)/bin_${ADK_TARGET} BIN_DIR_PFX:= $(BASE_DIR)/bin_* PACKAGE_DIR:= $(BIN_DIR)/packages -TARGET_DIR:= $(BASE_DIR)/root_${DEVICE} +TARGET_DIR:= $(BASE_DIR)/root_${ADK_TARGET} TARGET_DIR_PFX:= $(BASE_DIR)/root_* TARGET_PATH= ${SCRIPT_DIR}:${STAGING_TOOLS}/bin:${STAGING_DIR}/scripts:${_PATH} REAL_GNU_TARGET_NAME= $(CPU_ARCH)-linux-$(ADK_TARGET_SUFFIX) |