diff options
Diffstat (limited to 'mk')
-rw-r--r-- | mk/build.mk | 229 | ||||
-rw-r--r-- | mk/image.mk | 38 | ||||
-rw-r--r-- | mk/kernel-build.mk | 24 | ||||
-rw-r--r-- | mk/kernel.mk | 2 | ||||
-rw-r--r-- | mk/modules.mk | 29 | ||||
-rw-r--r-- | mk/package.mk | 54 | ||||
-rw-r--r-- | mk/pkg-bottom.mk | 38 | ||||
-rw-r--r-- | mk/python.mk | 4 | ||||
-rw-r--r-- | mk/rootfs.mk | 15 | ||||
-rw-r--r-- | mk/vars.mk | 40 |
10 files changed, 247 insertions, 226 deletions
diff --git a/mk/build.mk b/mk/build.mk index bb4f2998f..4c563a38c 100644 --- a/mk/build.mk +++ b/mk/build.mk @@ -10,12 +10,10 @@ endif CONFIG_CONFIG_IN = Config.in CONFIG = config -DEFCONFIG= ADK_DEVELSYSTEM=n \ - ADK_DEBUG=n \ +DEFCONFIG= ADK_DEBUG=n \ ADK_STATIC=n \ ADK_MAKE_PARALLEL=y \ ADK_MAKE_JOBS=4 \ - ADK_FORCE_PARALLEL=n \ ADK_PACKAGE_BZR=n \ ADK_PACKAGE_GRUB=n \ ADK_PACKAGE_AUFS2_UTIL=n \ @@ -117,6 +115,8 @@ ${TOPDIR}/package/Depends.mk: ${TOPDIR}/.config $(wildcard ${TOPDIR}/package/*/M world: $(DISTDIR) $(BUILD_DIR) $(TARGET_DIR) $(PACKAGE_DIR) ${BASH} ${TOPDIR}/scripts/scan-pkgs.sh + ${BASH} ${TOPDIR}/scripts/update-sys + ${BASH} ${TOPDIR}/scripts/update-pkg ifeq ($(ADK_NATIVE),y) $(MAKE) -f mk/build.mk toolchain/kernel-headers-prepare tools/install target/config-prepare target/compile package/compile root_clean package/install package_index target/install else @@ -145,23 +145,23 @@ $(TARGET_DIR): $(PACKAGE_DIR): mkdir -p ${PACKAGE_DIR}/.stamps -${STAGING_DIR} ${STAGING_DIR}/etc ${STAGING_TOOLS}: - mkdir -p ${STAGING_DIR}/{bin,etc,lib,usr/include} \ - ${STAGING_TOOLS}/{bin,lib} +${STAGING_TARGET_DIR} ${STAGING_TARGET_DIR}/etc ${STAGING_HOST_DIR}: + mkdir -p ${STAGING_TARGET_DIR}/{bin,etc,lib,usr/include} \ + ${STAGING_HOST_DIR}/{bin,lib} -${STAGING_DIR}/etc/ipkg.conf: ${STAGING_DIR}/etc +${STAGING_TARGET_DIR}/etc/ipkg.conf: ${STAGING_TARGET_DIR}/etc ifeq ($(ADK_TARGET_PACKAGE_IPKG),y) - echo "dest root /" >${STAGING_DIR}/etc/ipkg.conf - echo "option offline_root ${TARGET_DIR}" >>$(STAGING_DIR)/etc/ipkg.conf + echo "dest root /" >${STAGING_TARGET_DIR}/etc/ipkg.conf + echo "option offline_root ${TARGET_DIR}" >>$(STAGING_TARGET_DIR)/etc/ipkg.conf endif -package/%: ${STAGING_DIR}/etc/ipkg.conf ${TOPDIR}/package/Depends.mk +package/%: ${STAGING_TARGET_DIR}/etc/ipkg.conf ${TOPDIR}/package/Depends.mk $(MAKE) -C package $(patsubst package/%,%,$@) target/%: $(MAKE) -C target $(patsubst target/%,%,$@) -toolchain/%: ${STAGING_DIR} +toolchain/%: ${STAGING_TARGET_DIR} $(MAKE) -C toolchain $(patsubst toolchain/%,%,$@) tools/%: @@ -171,24 +171,29 @@ image: $(MAKE) -C target image 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 - if [ -f .config.${TARGET} ];then cp -p .config.${TARGET} .config; \ - cp -p .config.old.${TARGET} .config.old; \ - echo "Setting configuration to target: ${TARGET}"; \ - else echo "No old target config found";mv .config .config.bak; make TARGET=${TARGET};fi + if [ -f .config ];then \ + echo "Saving configuration for target system: ${ADK_TARGET_SYSTEM} with arch: ${ADK_TARGET_ARCH}";\ + cp -p .config .config.${ADK_TARGET_ARCH}_${ADK_TARGET_SYSTEM};\ + fi + if [ -f .config.old ];then cp -p .config.old .config.old.${ADK_TARGET_ARCH}_${ADK_TARGET_SYSTEM};fi + if [ -f .config.${ARCH}_${SYSTEM} ];then \ + cp -p .config.${ARCH}_${SYSTEM} .config; \ + cp -p .config.old.${ARCH}_${SYSTEM} .config.old; \ + echo "Setting configuration to target system: ${SYSTEM} with arch: ${ARCH}"; \ + else \ + echo "No old target config found" ;\ + mv .config .config.bak ;\ + if [ ! -z "$(SYSTEM)" ];then \ + make ARCH=${ARCH} SYSTEM=${SYSTEM} menuconfig; \ + else \ + make menuconfig; \ + fi \ + fi kernelconfig: -ifeq ($(ADKtype),) - cp $(TOPDIR)/target/$(ADK_TARGET)/kernel.config $(BUILD_DIR)/linux/.config - $(MAKE) -C $(BUILD_DIR)/linux/ ARCH=$(ARCH) menuconfig - cp $(BUILD_DIR)/linux/.config $(TOPDIR)/target/$(ADK_TARGET)/kernel.config -else cp $(TOPDIR)/target/$(ARCH)/kernel.config $(BUILD_DIR)/linux/.config $(MAKE) -C $(BUILD_DIR)/linux/ ARCH=$(ARCH) menuconfig cp $(BUILD_DIR)/linux/.config $(TOPDIR)/target/$(ARCH)/kernel.config -endif # create a new package from package/.template newpackage: @@ -213,8 +218,8 @@ root_clean: clean: @$(TRACE) clean $(MAKE) -C $(CONFIG) clean - for d in ${STAGING_PARENT}; do \ - for f in $$(ls $$d/pkg/[a-z]* 2>/dev/null); do \ + for d in ${STAGING_PKG_DIR}; do \ + for f in $$(ls $$d/[a-z]* 2>/dev/null); do \ while read file ; do \ rm $$d/target/$$file 2>/dev/null; \ done < $$f ; \ @@ -234,15 +239,15 @@ cleandir: @$(MAKE) -C $(CONFIG) clean $(MAKE_TRACE) rm -rf $(BUILD_DIR_PFX) $(BIN_DIR_PFX) $(TARGET_DIR_PFX) \ ${TOPDIR}/package/pkglist.d ${TOPDIR}/package/pkgconfigs.d - rm -rf $(TOOLCHAIN_BUILD_DIR_PFX) $(STAGING_PARENT_PFX) $(TOOLS_BUILD_DIR) - rm -f .menu .tmpconfig.h .rebuild* \ - ${TOPDIR}/package/Depends.mk ${TOPDIR}/prereq.mk \ + rm -rf $(TOOLCHAIN_BUILD_DIR_PFX) $(STAGING_HOST_DIR_PFX) $(TOOLS_BUILD_DIR) + rm -rf $(STAGING_TARGET_DIR_PFX) $(STAGING_PKG_DIR_PFX) + rm -f .menu .tmpconfig.h .rebuild* ${TOPDIR}/package/Depends.mk ${TOPDIR}/prereq.mk cleantarget: @$(TRACE) cleantarget @$(MAKE) -C $(CONFIG) clean $(MAKE_TRACE) rm -rf $(BUILD_DIR) $(BIN_DIR) $(TARGET_DIR) - rm -rf $(TOOLCHAIN_BUILD_DIR) $(STAGING_PARENT) + rm -rf $(TOOLCHAIN_BUILD_DIR) $(STAGING_HOST_DIR) $(STAGING_TARGET_DIR) $(STAGING_PKG_DIR) rm -f .tmpconfig.h all.config .defconfig distclean: @@ -250,7 +255,8 @@ distclean: @$(MAKE) -C $(CONFIG) clean $(MAKE_TRACE) @rm -rf $(BUILD_DIR_PFX) $(BIN_DIR_PFX) $(TARGET_DIR_PFX) $(DISTDIR) \ ${TOPDIR}/package/pkglist.d ${TOPDIR}/package/pkgconfigs.d - @rm -rf $(TOOLCHAIN_BUILD_DIR_PFX) $(STAGING_PARENT_PFX) $(TOOLS_BUILD_DIR) + @rm -rf $(TOOLCHAIN_BUILD_DIR_PFX) $(STAGING_HOST_DIR_PFX) $(TOOLS_BUILD_DIR) + @rm -rf $(STAGING_TARGET_DIR_PFX) $(STAGING_PKG_DIR_PFX) @rm -f .config* .defconfig .tmpconfig.h all.config ${TOPDIR}/prereq.mk \ .menu ${TOPDIR}/package/Depends.mk .ADK_HAVE_DOT_CONFIG .rebuild.* @@ -304,58 +310,52 @@ ifneq (,$(filter CYGWIN%,${OStype})) @echo ADK_HOST_CYGWIN=y > $(TOPDIR)/.defconfig endif ifeq ($(ADKtype),ibm-x40) - @echo ADK_ARCH_CHOICE=y >> $(TOPDIR)/.defconfig @echo ADK_LINUX_NATIVE=y >> $(TOPDIR)/.defconfig - @echo ADK_HARDWARE_IBM_X40=y >> $(TOPDIR)/.defconfig + @echo ADK_TARGET_SYSTEM_IBM_X40=y >> $(TOPDIR)/.defconfig endif ifeq ($(ADKtype),lemote-yeelong) - @echo ADK_HARDWARE_LEMOTE_YEELONG=y >> $(TOPDIR)/.defconfig + @echo ADK_LINUX_NATIVE=y >> $(TOPDIR)/.defconfig + @echo ADK_TARGET_SYSTEM_LEMOTE_YEELONG=y >> $(TOPDIR)/.defconfig endif - @if [ ! -z "$(TARGET)" ];then \ - grep "^config" target/Config.in \ - |grep -i "$(TARGET)"\$$ \ + @echo 'source "target/config/Config.in.arch.default"' > target/config/Config.in.arch + @echo 'source "target/config/Config.in.arch.choice"' >> target/config/Config.in.arch + @echo 'source "target/config/Config.in.system.default"' > target/config/Config.in.system + @echo 'source "target/config/Config.in.system.choice"' >> target/config/Config.in.system + @if [ ! -z "$(ARCH)" ];then \ + grep "^config" target/config/Config.in.arch.choice \ + |grep -i "$(ARCH)"\$$ \ |sed -e "s#^config \(.*\)#\1=y#" \ >> $(TOPDIR)/.defconfig; \ - if [ "$(TARGET)" = "native" ];then \ - echo "ADK_ARCH_CHOICE=y" >> $(TOPDIR)/.defconfig; \ - fi; \ fi @for symbol in ${DEFCONFIG}; do \ echo $$symbol >> $(TOPDIR)/.defconfig; \ done @if [ ! -z "$(FS)" ];then \ - grep "^config" target/Config.in \ + grep "^config" target/config/Config.in \ |grep -i "$(FS)" \ |sed -e "s#^config \(.*\)#\1=y#" \ >> $(TOPDIR)/.defconfig; \ fi @if [ ! -z "$(PKG)" ];then \ - grep "^config" target/Config.in \ + grep "^config" target/config/Config.in \ |grep -i "$(PKG)" \ |sed -e "s#^config \(.*\)#\1=y#" \ >> $(TOPDIR)/.defconfig; \ fi @if [ ! -z "$(LIBC)" ];then \ - grep "^config" target/Config.in \ + grep "^config" target/config/Config.in \ |grep -i "$(LIBC)" \ |sed -e "s#^config \(.*\)#\1=y#" \ >> $(TOPDIR)/.defconfig; \ fi - @if [ ! -z "$(HW)" ];then \ - hw=$$(echo "$(HW)" |sed -e "s/-/_/g"); \ - grep -h "^config" target/Config.in.* \ - |grep -i "$$hw" \ + @if [ ! -z "$(SYSTEM)" ];then \ + system=$$(echo "$(SYSTEM)" |sed -e "s/-/_/g"); \ + grep -h "^config" target/*/Config.in.systems \ + |grep -i "$$system" \ |sed -e "s#^config \(.*\)#\1=y#" \ >> $(TOPDIR)/.defconfig; \ - echo "ADK_ARCH_CHOICE=y" >> $(TOPDIR)/.defconfig; \ fi -ifneq (,$(filter rb%,${TARGET})) - @echo ADK_LINUX_MIKROTIK=y >> $(TOPDIR)/.defconfig -endif -ifneq (,$(filter alix%,${TARGET})) - @echo ADK_LINUX_ALIX=y >> $(TOPDIR)/.defconfig -endif - @if [ ! -z "$(TARGET)" ];then \ + @if [ ! -z "$(SYSTEM)" ];then \ $(CONFIG)/conf -D .defconfig $(CONFIG_CONFIG_IN); \ fi @@ -382,14 +382,18 @@ ifneq (,$(filter CYGWIN%,${OStype})) @echo ADK_HOST_CYGWIN=y > $(TOPDIR)/all.config endif ifeq ($(ADKtype),ibmx-40) - @echo ADK_HARDWARE_IBM_X40=y >> $(TOPDIR)/all.config + @echo ADK_TARGET_SYSTEM_IBM_X40=y >> $(TOPDIR)/all.config endif ifeq ($(ADKtype),lemote-yeelong) - @echo ADK_HARDWARE_LEMOTE_YEELONG=y >> $(TOPDIR)/all.config + @echo ADK_TARGET_SYSTEM_LEMOTE_YEELONG=y >> $(TOPDIR)/all.config endif - @if [ ! -z "$(TARGET)" ];then \ - grep "^config" target/Config.in \ - |grep -i "$(TARGET)"\$$ \ + @echo 'source "target/config/Config.in.arch.default"' > target/config/Config.in.arch + @echo 'source "target/config/Config.in.arch.choice"' >> target/config/Config.in.arch + @echo 'source "target/config/Config.in.system.default"' > target/config/Config.in.system + @echo 'source "target/config/Config.in.system.choice"' >> target/config/Config.in.system + @if [ ! -z "$(ARCH)" ];then \ + grep "^config" target/config/Config.in.arch.choice \ + |grep -i "$(ARCH)"\$$ \ |sed -e "s#^config \(.*\)#\1=y#" \ >> $(TOPDIR)/all.config; \ fi @@ -397,39 +401,34 @@ endif echo $$symbol >> $(TOPDIR)/all.config; \ done @if [ ! -z "$(FS)" ];then \ - grep "^config" target/Config.in \ + grep "^config" target/config/Config.in \ |grep -i "$(FS)" \ |sed -e "s#^config \(.*\)#\1=y#" \ >> $(TOPDIR)/all.config; \ fi @if [ ! -z "$(PKG)" ];then \ - grep "^config" target/Config.in \ + grep "^config" target/config/Config.in \ |grep -i "$(PKG)" \ |sed -e "s#^config \(.*\)#\1=y#" \ >> $(TOPDIR)/all.config; \ fi @if [ ! -z "$(LIBC)" ];then \ - grep "^config" target/Config.in \ + grep "^config" target/config/Config.in \ |grep -i "$(LIBC)" \ |sed -e "s#^config \(.*\)#\1=y#" \ >> $(TOPDIR)/all.config; \ fi - @if [ ! -z "$(HW)" ];then \ - hw=$$(echo "$(HW)" |sed -e "s/-/_/g"); \ - grep -h "^config" target/Config.in.* \ - |grep -i "$$hw" \ + @if [ ! -z "$(SYSTEM)" ];then \ + system=$$(echo "$(SYSTEM)" |sed -e "s/-/_/g"); \ + grep -h "^config" target/*/Config.in.systems \ + |grep -i "$$system" \ |sed -e "s#^config \(.*\)#\1=y#" \ >> $(TOPDIR)/all.config; \ - echo "ADK_ARCH_CHOICE=y" >> $(TOPDIR)/all.config; \ fi -ifneq (,$(filter rb%,${TARGET})) - @echo ADK_LINUX_MIKROTIK=y >> $(TOPDIR)/all.config -endif -ifneq (,$(filter alix%,${TARGET})) - @echo ADK_LINUX_ALIX=y >> $(TOPDIR)/all.config -endif menuconfig: $(CONFIG)/mconf defconfig .menu package/Config.in.auto + @${BASH} ${TOPDIR}/scripts/update-sys + @${BASH} ${TOPDIR}/scripts/update-pkg @if [ ! -f .config ];then \ $(CONFIG)/conf -D .defconfig $(CONFIG_CONFIG_IN); \ fi @@ -437,6 +436,8 @@ menuconfig: $(CONFIG)/mconf defconfig .menu package/Config.in.auto ${POSTCONFIG} guiconfig: $(CONFIG)/gconf defconfig .menu package/Config.in.auto + @${BASH} ${TOPDIR}/scripts/update-sys + @${BASH} ${TOPDIR}/scripts/update-pkg @if [ ! -f .config ];then \ $(CONFIG)/conf -D .defconfig $(CONFIG_CONFIG_IN); \ fi @@ -457,52 +458,84 @@ distclean: @$(MAKE) -C $(CONFIG) clean @rm -rf $(BUILD_DIR_PFX) $(BIN_DIR_PFX) $(TARGET_DIR_PFX) $(DISTDIR) \ ${TOPDIR}/package/pkglist.d ${TOPDIR}/package/pkgconfigs.d - @rm -rf $(TOOLCHAIN_BUILD_DIR_PFX) $(STAGING_PARENT_PFX) $(TOOLS_BUILD_DIR) + @rm -rf $(TOOLCHAIN_BUILD_DIR_PFX) $(STAGING_TARGET_DIR_PFX) $(TOOLS_BUILD_DIR) + @rm -rf $(STAGING_HOST_DIR_PFX) $(STAGING_TARGET_DIR_PFX) $(STAGING_PKG_DIR_PFX) @rm -f .config* .defconfig .tmpconfig.h all.config ${TOPDIR}/prereq.mk \ .menu .rebuild.* ${TOPDIR}/package/Depends.mk .ADK_HAVE_DOT_CONFIG endif # ! ifeq ($(strip $(ADK_HAVE_DOT_CONFIG)),y) -# build all targets and combinations +# build all target architecture and libc combinations (toolchain only) +bulktoolchain: + for libc in uclibc eglibc glibc;do \ + while read arch; do \ + ( \ + mkdir -p $(TOPDIR)/bin/toolchain_$${arch}_$$libc; \ + echo === building $$arch $$libc toolchain on $$(date); \ + $(GMAKE) prereq && \ + $(GMAKE) ARCH=$$arch SYSTEM=toolchain LIBC=$$libc defconfig; \ + $(GMAKE) VERBOSE=1 all; if [ $$? -ne 0 ]; then touch .exit;fi; \ + rm .config; \ + ) 2>&1 | tee $(TOPDIR)/bin/toolchain_$${arch}_$${libc}/build.log; \ + if [ -f .exit ];then echo "Bulk build failed!"; rm .exit; exit 1;fi \ + done <${TOPDIR}/target/arch.lst ;\ + done + +# build all target architecture, target systems and libc combinations bulk: - @while read target libc fs hw; do \ - mkdir -p $(TOPDIR)/bin/$${target}_$$libc; \ + for libc in uclibc eglibc glibc;do \ + while read arch; do \ + systems=$$(./scripts/getsystems $$arch); \ + for system in $$systems;do \ ( \ - echo === building $$target $$hw $$libc $$fs on $$(date); \ + mkdir -p $(TOPDIR)/bin/$${system}_$${arch}_$$libc; \ + echo === building $$arch $$system $$libc on $$(date); \ $(GMAKE) prereq && \ - $(GMAKE) TARGET=$$target HW=$$hw LIBC=$$libc FS=$$fs defconfig; \ - $(GMAKE) VERBOSE=1 all; if [ $$? -ne 0 ]; then touch .exit;fi; \ + $(GMAKE) ARCH=$$arch SYSTEM=$$system LIBC=$$libc defconfig; \ + $(GMAKE) VERBOSE=1 all; if [ $$? -ne 0 ]; then touch .exit;fi; \ rm .config; \ - ) 2>&1 | tee $(TOPDIR)/bin/$${target}_$$libc/$$target-$$libc-$$fs.log; \ + ) 2>&1 | tee $(TOPDIR)/bin/$${system}_$${arch}_$$libc/build.log; \ + done; \ if [ -f .exit ];then echo "Bulk build failed!"; rm .exit; exit 1;fi \ - done <${TOPDIR}/target/bulkdef.lst + done <${TOPDIR}/target/arch.lst ;\ + done bulkall: - @while read target libc fs hw; do \ - mkdir -p $(TOPDIR)/bin/$${target}_$$libc; \ + for libc in uclibc eglibc glibc;do \ + while read arch; do \ + systems=$$(./scripts/getsystems $$arch); \ + for system in $$systems;do \ ( \ - echo === building $$target $$hw $$libc $$fs on $$(date); \ + mkdir -p $(TOPDIR)/bin/$${system}_$${arch}_$$libc; \ + echo === building $$arch $$system $$libc on $$(date); \ $(GMAKE) prereq && \ - $(GMAKE) TARGET=$$target HW=$$hw LIBC=$$libc FS=$$fs allconfig; \ - $(GMAKE) VERBOSE=1 all; if [ $$? -ne 0 ]; then touch .exit;fi; \ + $(GMAKE) ARCH=$$arch SYSTEM=$$system LIBC=$$libc allconfig; \ + $(GMAKE) VERBOSE=1 all; if [ $$? -ne 0 ]; then touch .exit;fi; \ rm .config; \ - ) 2>&1 | tee $(TOPDIR)/bin/$${target}_$$libc/$$target-$$libc-$$fs.log; \ + ) 2>&1 | tee $(TOPDIR)/bin/$${system}_$${arch}_$$libc/build.log; \ + done; \ if [ -f .exit ];then echo "Bulk build failed!"; rm .exit; exit 1;fi \ - done <${TOPDIR}/target/bulk.lst + done <${TOPDIR}/target/arch.lst ;\ + done bulkallmod: - @while read target libc fs hw; do \ - mkdir -p $(TOPDIR)/bin/$${target}_$$libc; \ + for libc in uclibc eglibc glibc;do \ + while read arch; do \ + systems=$$(./scripts/getsystems $$arch); \ + for system in $$systems;do \ ( \ - echo === building $$target $$hw $$libc $$fs on $$(date); \ + mkdir -p $(TOPDIR)/bin/$${system}_$${arch}_$$libc; \ + echo === building $$arch $$system $$libc on $$(date); \ $(GMAKE) prereq && \ - $(GMAKE) TARGET=$$target HW=$$hw LIBC=$$libc FS=$$fs allmodconfig; \ - $(GMAKE) VERBOSE=1 all; if [ $$? -ne 0 ]; then touch .exit;fi; \ + $(GMAKE) ARCH=$$arch SYSTEM=$$system LIBC=$$libc allmodconfig; \ + $(GMAKE) VERBOSE=1 all; if [ $$? -ne 0 ]; then touch .exit;fi; \ rm .config; \ - ) 2>&1 | tee $(TOPDIR)/bin/$${target}_$$libc/$$target-$$libc-$$fs.log; \ + ) 2>&1 | tee $(TOPDIR)/bin/$${system}_$${arch}_$$libc/build.log; \ + done; \ if [ -f .exit ];then echo "Bulk build failed!"; rm .exit; exit 1;fi \ - done <${TOPDIR}/target/bulk.lst + done <${TOPDIR}/target/arch.lst ;\ + done ${TOPDIR}/bin/tools/pkgmaker: @mkdir -p $(TOPDIR)/bin/tools @@ -521,7 +554,7 @@ $(TOPDIR)/bin/tools: @mkdir -p $(TOPDIR)/bin/tools ${TOPDIR}/bin/tools/depmaker: $(TOPDIR)/bin/tools - $(HOSTCC) -o $(TOPDIR)/bin/tools/depmaker $(TOPDIR)/tools/adk/depmaker.c + $(HOSTCC) -g -o $(TOPDIR)/bin/tools/depmaker $(TOPDIR)/tools/adk/depmaker.c dep: $(TOPDIR)/bin/tools/depmaker @echo "Generating dependencies ..." diff --git a/mk/image.mk b/mk/image.mk index 9a26434ae..484b2745a 100644 --- a/mk/image.mk +++ b/mk/image.mk @@ -24,30 +24,23 @@ image-prepare-post: KERNEL_PKGDIR:=$(LINUX_BUILD_DIR)/kernel-pkg KERNEL_PKG:=$(PACKAGE_DIR)/kernel_$(KERNEL_VERSION)_$(CPU_ARCH).$(PKG_SUFFIX) -kernel-package: $(LINUX_DIR)/vmlinux - $(TRACE) target/$(ADK_TARGET)-create-kernel-package +kernel-package: $(KERNEL) + $(TRACE) target/$(ADK_TARGET_ARCH)-create-kernel-package rm -rf $(KERNEL_PKGDIR) @mkdir -p $(KERNEL_PKGDIR)/boot - cp $(KERNEL) $(KERNEL_PKGDIR)/boot/vmlinuz-adk + cp $(KERNEL) $(KERNEL_PKGDIR)/boot/kernel @${BASH} ${SCRIPT_DIR}/make-ipkg-dir.sh ${KERNEL_PKGDIR} \ ../linux/kernel.control ${KERNEL_VERSION} ${CPU_ARCH} $(PKG_BUILD) $(KERNEL_PKGDIR) $(PACKAGE_DIR) $(MAKE_TRACE) - $(TRACE) target/$(ADK_TARGET)-install-kernel-package + $(TRACE) target/$(ADK_TARGET_ARCH)-install-kernel-package $(PKG_INSTALL) $(KERNEL_PKG) $(MAKE_TRACE) -ifeq ($(ADK_HW),) -INITRAMFS= ${ADK_TARGET}-${ADK_LIBC}-${FS} -ROOTFSSQUASHFS= ${ADK_TARGET}-${ADK_LIBC}-${FS}.img -ROOTFSTARBALL= ${ADK_TARGET}-${ADK_LIBC}-${FS}+kernel.tar.gz -ROOTFSUSERTARBALL= ${ADK_TARGET}-${ADK_LIBC}-${FS}.tar.gz -INITRAMFS_PIGGYBACK= ${ADK_TARGET}-${ADK_LIBC}-${FS}.cpio -else -INITRAMFS= ${ADK_HW}-${ADK_TARGET}-${ADK_LIBC}-${FS} -ROOTFSSQUASHFS= ${ADK_HW}-${ADK_TARGET}-${ADK_LIBC}-${FS}.img -ROOTFSTARBALL= ${ADK_HW}-${ADK_TARGET}-${ADK_LIBC}-${FS}+kernel.tar.gz -ROOTFSUSERTARBALL= ${ADK_HW}-${ADK_TARGET}-${ADK_LIBC}-${FS}.tar.gz -INITRAMFS_PIGGYBACK= ${ADK_HW}-${ADK_TARGET}-${ADK_LIBC}-${FS}.cpio -endif +TARGET_KERNEL:= $(BIN_DIR)/${ADK_TARGET_SYSTEM}-${ADK_TARGET_ARCH}-${ADK_TARGET_FS}-kernel +INITRAMFS= ${ADK_TARGET_SYSTEM}-${ADK_TARGET_ARCH}-${ADK_TARGET_LIBC}-${ADK_TARGET_FS} +ROOTFSSQUASHFS= ${ADK_TARGET_SYSTEM}-${ADK_TARGET_ARCH}-${ADK_TARGET_LIBC}-${ADK_TARGET_FS}.img +ROOTFSTARBALL= ${ADK_TARGET_SYSTEM}-${ADK_TARGET_ARCH}-${ADK_TARGET_LIBC}-${ADK_TARGET_FS}+kernel.tar.gz +ROOTFSUSERTARBALL= ${ADK_TARGET_SYSTEM}-${ADK_TARGET_ARCH}-${ADK_TARGET_LIBC}-${ADK_TARGET_FS}.tar.gz +INITRAMFS_PIGGYBACK= ${ADK_TARGET_SYSTEM}-${ADK_TARGET_ARCH}-${ADK_TARGET_LIBC}-${ADK_TARGET_FS}.cpio ${BIN_DIR}/${ROOTFSTARBALL}: ${TARGET_DIR} kernel-package cd ${TARGET_DIR}; find . | sed -n '/^\.\//s///p' | \ @@ -55,7 +48,7 @@ ${BIN_DIR}/${ROOTFSTARBALL}: ${TARGET_DIR} kernel-package ${TOOLS_DIR}/cpio -o -Hustar -P | gzip -n9 >$@ ${BIN_DIR}/${ROOTFSUSERTARBALL}: ${TARGET_DIR} - cd ${TARGET_DIR}; find . | grep -v ./boot | sed -n '/^\.\//s///p' | \ + cd ${TARGET_DIR}; find . | grep -v ./boot/ | sed -n '/^\.\//s///p' | \ sed "s#\(.*\)#:0:0::::::\1#" | sort | \ ${TOOLS_DIR}/cpio -o -Hustar -P | gzip -n9 >$@ @@ -63,7 +56,7 @@ ${BIN_DIR}/${INITRAMFS}: ${TARGET_DIR} cd ${TARGET_DIR}; find . | sed -n '/^\.\//s///p' | \ sed "s#\(.*\)#:0:0::::::\1#" | sort | \ ${TOOLS_DIR}/cpio -o -C512 -Hnewc -P | \ - ${ADK_COMPRESSION_TOOL} >$@ 2>/dev/null + lzma -9 >$@ 2>/dev/null ${BUILD_DIR}/${INITRAMFS_PIGGYBACK}: ${TARGET_DIR} $(SED) 's#^CONFIG_INITRAMFS_SOURCE.*#CONFIG_INITRAMFS_SOURCE="${BUILD_DIR}/${INITRAMFS_PIGGYBACK}"#' \ @@ -73,11 +66,10 @@ ${BUILD_DIR}/${INITRAMFS_PIGGYBACK}: ${TARGET_DIR} ${TOOLS_DIR}/cpio -o -C512 -Hnewc -P >$@ 2>/dev/null ${BIN_DIR}/${ROOTFSSQUASHFS}: ${TARGET_DIR} - ${STAGING_TOOLS}/bin/mksquashfs ${TARGET_DIR} \ + ${STAGING_HOST_DIR}/bin/mksquashfs ${TARGET_DIR} \ ${BUILD_DIR}/root.squashfs \ -nopad -noappend -root-owned $(MAKE_TRACE) - cat ${BIN_DIR}/${ADK_TARGET}-${FS}-kernel \ - ${BUILD_DIR}/root.squashfs > \ + cat ${ADK_TARGET_KERNEL} ${BUILD_DIR}/root.squashfs > \ ${BUILD_DIR}/${ROOTFSSQUASHFS} createinitramfs: @@ -89,4 +81,4 @@ createinitramfs: ARCH=$(ARCH) CC="$(TARGET_CC)" $(MAKE_TRACE) imageclean: - rm -f $(BIN_DIR)/$(ADK_TARGET)-* ${BUILD_DIR}/$(ADK_TARGET)-* + rm -f $(BIN_DIR)/$(ADK_TARGET_SYSTEM)-* ${BUILD_DIR}/$(ADK_TARGET_SYSTEM)-* diff --git a/mk/kernel-build.mk b/mk/kernel-build.mk index 2eaf1ada1..ba3259b16 100644 --- a/mk/kernel-build.mk +++ b/mk/kernel-build.mk @@ -6,25 +6,19 @@ include $(TOPDIR)/mk/linux.mk include ${TOPDIR}/mk/kernel-vars.mk $(TOOLCHAIN_BUILD_DIR)/w-$(PKG_NAME)-$(PKG_VERSION)-$(PKG_RELEASE)/linux-$(KERNEL_VERSION)/.patched: - $(TRACE) target/$(ADK_TARGET)-kernel-patch - $(PATCH) $(TOOLCHAIN_BUILD_DIR)/w-$(PKG_NAME)-$(PKG_VERSION)-$(PKG_RELEASE)/linux-$(KERNEL_VERSION) ../linux/patches/$(KERNEL_VERSION) *.patch $(MAKE_TRACE) - $(PATCH) $(TOOLCHAIN_BUILD_DIR)/w-$(PKG_NAME)-$(PKG_VERSION)-$(PKG_RELEASE)/linux-$(KERNEL_VERSION) ../$(ADK_TARGET)/patches *.patch $(MAKE_TRACE) -ifeq ($(ADK_NATIVE),y) - if [ -f /etc/adktarget ];then \ - target=$$(cat /etc/adktarget); \ - $(PATCH) $(TOOLCHAIN_BUILD_DIR)/w-$(PKG_NAME)-$(PKG_VERSION)-$(PKG_RELEASE)/linux-$(KERNEL_VERSION) ../$$target/patches *.patch $(MAKE_TRACE); \ - fi -endif + $(TRACE) target/kernel-patch + $(PATCH) $(TOOLCHAIN_BUILD_DIR)/w-$(PKG_NAME)-$(PKG_VERSION)-$(PKG_RELEASE)/linux-$(KERNEL_VERSION) \ + ../linux/patches/$(KERNEL_VERSION) *.patch $(MAKE_TRACE) touch $@ $(LINUX_DIR)/.prepared: $(TOOLCHAIN_BUILD_DIR)/w-$(PKG_NAME)-$(PKG_VERSION)-$(PKG_RELEASE)/linux-$(KERNEL_VERSION)/.patched - $(TRACE) target/$(ADK_TARGET)-kernel-prepare + $(TRACE) target/kernel-prepare ln -sf $(TOOLCHAIN_BUILD_DIR)/w-$(PKG_NAME)-$(PKG_VERSION)-$(PKG_RELEASE)/linux-$(KERNEL_VERSION) $(LINUX_DIR) mkdir -p $(LINUX_BUILD_DIR)/kmod-control touch $@ $(LINUX_DIR)/.config: $(LINUX_DIR)/.prepared $(BUILD_DIR)/.kernelconfig $(TOPDIR)/mk/modules.mk - $(TRACE) target/$(ADK_TARGET)-kernel-configure + $(TRACE) target/$(ADK_TARGET_ARCH)-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) @@ -32,15 +26,15 @@ $(LINUX_DIR)/.config: $(LINUX_DIR)/.prepared $(BUILD_DIR)/.kernelconfig $(TOPDIR touch -c $(LINUX_DIR)/.config $(LINUX_DIR)/vmlinux: $(LINUX_DIR)/.config - $(TRACE) target/$(ADK_TARGET)-kernel-compile + $(TRACE) target/$(ADK_TARGET_ARCH)-kernel-compile $(MAKE) ${KERNEL_MAKE_OPTS} -j${ADK_MAKE_JOBS} LOCALVERSION="" $(MAKE_TRACE) - $(TRACE) target/$(ADK_TARGET)-kernel-modules-install + $(TRACE) target/$(ADK_TARGET_ARCH)-kernel-modules-install rm -rf $(LINUX_BUILD_DIR)/modules $(MAKE) ${KERNEL_MAKE_OPTS} DEPMOD=true \ INSTALL_MOD_PATH=$(LINUX_BUILD_DIR)/modules \ LOCALVERSION="" \ modules_install $(MAKE_TRACE) - $(TRACE) target/$(ADK_TARGET)-create-packages + $(TRACE) target/$(ADK_TARGET_ARCH)-create-packages ifneq ($(strip $(TARGETS)),) $(MAKE) $(TARGETS) endif @@ -50,7 +44,7 @@ prepare: compile: $(LINUX_DIR)/vmlinux install: compile ifneq ($(strip $(INSTALL_TARGETS)),) - $(TRACE) target/${ADK_TARGET}-modules-install + $(TRACE) target/${ADK_TARGET_ARCH}-modules-install ifeq ($(ADK_TARGET_PACKAGE_IPKG),y) $(PKG_INSTALL) $(INSTALL_TARGETS) $(MAKE_TRACE) else diff --git a/mk/kernel.mk b/mk/kernel.mk index 5d2f9dbe0..2ce156694 100644 --- a/mk/kernel.mk +++ b/mk/kernel.mk @@ -3,7 +3,7 @@ LINUX_KMOD_SUFFIX=ko MODULES_SUBDIR := lib/modules/$(KERNEL_VERSION) -LINUX_BUILD_DIR := $(BUILD_DIR)/linux-$(ADK_TARGET) +LINUX_BUILD_DIR := $(BUILD_DIR)/linux-$(ADK_TARGET_ARCH) KMOD_BUILD_DIR := $(LINUX_BUILD_DIR)/linux-modules MODULES_DIR := $(LINUX_BUILD_DIR)/modules/$(MODULES_SUBDIR) TARGET_MODULES_DIR := $(LINUX_TARGET_DIR)/$(MODULES_SUBDIR) diff --git a/mk/modules.mk b/mk/modules.mk index b0bdddc6d..ec026182a 100644 --- a/mk/modules.mk +++ b/mk/modules.mk @@ -764,20 +764,27 @@ $(eval $(call KMOD_template,CRYPTO_DEV_GEODE,crypto-dev-geode,\ $(MODULES_DIR)/kernel/drivers/crypto/geode-aes \ ,20)) -$(eval $(call KMOD_template,CRYPTO_ALGAPI,crypto-algapi,\ +$(eval $(call KMOD_template,CRYPTO_DEV_HIFN_795X,crypto-dev-hifn-795x,\ + $(MODULES_DIR)/kernel/drivers/crypto/hifn_795x \ +,20, crypto-manager2)) + +$(eval $(call KMOD_template,CRYPTO_ALGAPI2,crypto-algapi2,\ $(MODULES_DIR)/kernel/crypto/crypto_algapi \ - $(MODULES_DIR)/kernel/crypto/pcompress \ ,02)) -$(eval $(call KMOD_template,CRYPTO_AEAD,crypto-aead,\ +$(eval $(call KMOD_template,CRYPTO_PCOMP2,crypto-pcomp2,\ + $(MODULES_DIR)/kernel/crypto/pcompress \ +,03)) + +$(eval $(call KMOD_template,CRYPTO_AEAD2,crypto-aead2,\ $(MODULES_DIR)/kernel/crypto/aead \ ,03)) -$(eval $(call KMOD_template,CRYPTO_HASH,crypto-hash,\ +$(eval $(call KMOD_template,CRYPTO_HASH2,crypto-hash2,\ $(MODULES_DIR)/kernel/crypto/crypto_hash \ ,04)) -$(eval $(call KMOD_template,CRYPTO_BLKCIPHER,crypto-blkcipher,\ +$(eval $(call KMOD_template,CRYPTO_BLKCIPHER2,crypto-blkcipher2,\ $(MODULES_DIR)/kernel/crypto/crypto_wq \ $(MODULES_DIR)/kernel/crypto/crypto_blkcipher \ ,05)) @@ -787,7 +794,7 @@ $(eval $(call KMOD_template,CRYPTO_RNG2,crypto-rng2,\ $(MODULES_DIR)/kernel/crypto/krng \ ,06)) -$(eval $(call KMOD_template,CRYPTO_MANAGER,crypto-manager,\ +$(eval $(call KMOD_template,CRYPTO_MANAGER2,crypto-manager2,\ $(MODULES_DIR)/kernel/crypto/cryptomgr \ $(MODULES_DIR)/kernel/crypto/eseqiv \ $(MODULES_DIR)/kernel/crypto/chainiv \ @@ -1298,17 +1305,21 @@ $(eval $(call KMOD_template,LEDS_CLASS,leds-class,\ $(MODULES_DIR)/kernel/drivers/leds/led-class \ ,05)) +$(eval $(call KMOD_template,LEDS_ALIX2,leds-alix2,\ + $(MODULES_DIR)/kernel/drivers/leds/leds-alix2 \ +,10)) + $(eval $(call KMOD_template,LEDS_TRIGGER_TIMER,leds-trigger-timer,\ $(MODULES_DIR)/kernel/drivers/leds/ledtrig-timer \ -,10)) +,20)) $(eval $(call KMOD_template,LEDS_TRIGGER_HEARTBEAT,leds-trigger-heartbeat,\ $(MODULES_DIR)/kernel/drivers/leds/ledtrig-heartbeat \ -,10)) +,20)) $(eval $(call KMOD_template,LEDS_TRIGGER_DEFAULT_ON,leds-trigger-default-on,\ $(MODULES_DIR)/kernel/drivers/leds/ledtrig-default-on \ -,10)) +,20)) $(eval $(call KMOD_template,NETFILTER_XT_TARGET_LED,netfilter-xt-target-led,\ $(MODULES_DIR)/kernel/net/netfilter/xt_LED \ diff --git a/mk/package.mk b/mk/package.mk index 4879f9cf2..eb2e21d31 100644 --- a/mk/package.mk +++ b/mk/package.mk @@ -7,15 +7,15 @@ TCFLAGS:= ${TARGET_CFLAGS} TCXXFLAGS:= ${TARGET_CFLAGS} TCPPFLAGS:= ${TARGET_CPPFLAGS} TLDFLAGS:= ${TARGET_LDFLAGS} -Wl,-rpath -Wl,/usr/lib \ - -Wl,-rpath-link -Wl,${STAGING_DIR}/usr/lib \ - -L${STAGING_DIR}/lib -L${STAGING_DIR}/usr/lib + -Wl,-rpath-link -Wl,${STAGING_TARGET_DIR}/usr/lib \ + -L${STAGING_TARGET_DIR}/lib -L${STAGING_TARGET_DIR}/usr/lib ifeq ($(ADK_STATIC),y) TCFLAGS:= ${TARGET_CFLAGS} -static TCXXFLAGS:= ${TARGET_CFLAGS} -static TCPPFLAGS:= ${TARGET_CPPFLAGS} -static TLDFLAGS:= ${TARGET_LDFLAGS} -Wl,-rpath -Wl,/usr/lib \ - -Wl,-rpath-link -Wl,${STAGING_DIR}/usr/lib \ - -L${STAGING_DIR}/lib -L${STAGING_DIR}/usr/lib \ + -Wl,-rpath-link -Wl,${STAGING_TARGET_DIR}/usr/lib \ + -L${STAGING_TARGET_DIR}/lib -L${STAGING_TARGET_DIR}/usr/lib \ -static endif ifeq ($(ADK_NATIVE),y) @@ -41,7 +41,7 @@ CONFIGURE_ENV+= CONFIG_SHELL='$(strip ${SHELL})' \ CXXFLAGS='$(strip ${TCXXFLAGS})' \ CPPFLAGS='$(strip ${TCPPFLAGS})' \ LDFLAGS='$(strip ${TLDFLAGS})' \ - PKG_CONFIG_LIBDIR='${STAGING_DIR}/usr/lib/pkgconfig' + PKG_CONFIG_LIBDIR='${STAGING_TARGET_DIR}/usr/lib/pkgconfig' ifeq ($(ADK_NATIVE),) CONFIGURE_ENV+= ${TARGET_CONFIGURE_OPTS} \ ${HOST_CONFIGURE_OPTS} \ @@ -68,7 +68,7 @@ MAKE_ENV+= WRKDIR='${WRKDIR}' WRKDIST='${WRKDIST}' \ CXXFLAGS='$(strip ${TCXXFLAGS})' \ CPPFLAGS='$(strip ${TCPPFLAGS})' \ LDFLAGS='$(strip ${TLDFLAGS})' -MAKE_ENV+= PKG_CONFIG_LIBDIR='${STAGING_DIR}/usr/lib/pkgconfig' +MAKE_ENV+= PKG_CONFIG_LIBDIR='${STAGING_TARGET_DIR}/usr/lib/pkgconfig' ifeq ($(ADK_NATIVE),) MAKE_ENV+= PATH='${TARGET_PATH}' \ ${HOST_CONFIGURE_OPTS} \ @@ -126,9 +126,9 @@ build-all-pkgs: ${_IPKGS_COOKIE} # 5.) description for the package, $(PKG_DESCR) # 6.) section of the package, $(PKG_SECTION) # 7.) special package options -# noscripts -> do not install scripts to $(STAGING_DIR)/target/scripts +# noscripts -> do not install scripts to $(STAGING_TARGET_DIR)/target/scripts # (needed for example for autoconf/automake) -# noremove -> do not remove files from $(STAGING_DIR)/target while +# noremove -> do not remove files from $(STAGING_TARGET_DIR)/target while # cleaning (needed for toolchain packages like glibc/eglibc) # should be package format independent and modular in the future define PKG_template @@ -192,45 +192,45 @@ endif [[ -e $$$$script ]] || continue; \ chmod 0755 "$$$$script"; \ done - @mkdir -p $${PACKAGE_DIR} '$${STAGING_PARENT}/pkg' \ - '$${STAGING_DIR}/scripts' + @mkdir -p $${PACKAGE_DIR} '$${STAGING_PKG_DIR}' \ + '$${STAGING_TARGET_DIR}/scripts' ifeq (,$(filter noremove,$(7))) - @if test -s '$${STAGING_PARENT}/pkg/$(1)'; then \ - cd '$${STAGING_DIR}'; \ + @if test -s '$${STAGING_PKG_DIR}/$(1)'; then \ + cd '$${STAGING_TARGET_DIR}'; \ while read fn; do \ rm -f "$$$$fn"; \ - done <'$${STAGING_PARENT}/pkg/$(1)'; \ + done <'$${STAGING_PKG_DIR}/$(1)'; \ fi endif - @rm -f '$${STAGING_PARENT}/pkg/$(1)' + @rm -f '$${STAGING_PKG_DIR}/$(1)' @-cd $${IDIR_$(1)}; \ x=$$$$(find tmp var -mindepth 1 2>/dev/null); if [[ -n $$$$x ]]; then \ echo 'WARNING: $${IPKG_$(1)} installs files into a' \ 'ramdisk location:' >&2; \ echo "$$$$x" | sed 's/^/- /' >&2; \ fi; \ - if [ "${PKG_NAME}" != "uClibc" -a "${PKG_NAME}" != "glibc" -a "${PKG_NAME}" != "eglibc" -a "${PKG_NAME}" != "libpthread" -a "${PKG_NAME}" != "libstdcxx" -a "${PKG_NAME}" != "libthread-db" ];then \ + if [ "${PKG_NAME}" != "uClibc" -a "${PKG_NAME}" != "glibc" -a "${PKG_NAME}" != "eglibc" -a "${PKG_NAME}" != "libpthread" -a "${PKG_NAME}" != "libstdcxx" -a "${PKG_NAME}" != "libgcc" -a "${PKG_NAME}" != "libthread-db" ];then \ find lib \( -name lib\*.so\* -o -name lib\*.a \) \ -exec echo 'WARNING: $${IPKG_$(1)} installs files in /lib -' \ ' fix this!' >&2 \; -quit 2>/dev/null; fi; \ find usr ! -type d 2>/dev/null | \ grep -v -e '^usr/share' -e '^usr/man' -e '^usr/info' -e '^usr/lib/libc.so' | \ - tee '$${STAGING_PARENT}/pkg/$(1)' | \ - $(TOPDIR)/bin/tools/cpio -padlmu '$${STAGING_DIR}' - @cd '$${STAGING_DIR}'; grep 'usr/lib/.*\.la$$$$' \ - '$${STAGING_PARENT}/pkg/$(1)' | while read fn; do \ + tee '$${STAGING_PKG_DIR}/$(1)' | \ + $(TOPDIR)/bin/tools/cpio -padlmu '$${STAGING_TARGET_DIR}' + @cd '$${STAGING_TARGET_DIR}'; grep 'usr/lib/.*\.la$$$$' \ + '$${STAGING_PKG_DIR}/$(1)' | while read fn; do \ chmod u+w $$$$fn; \ - $(SED) "s,\(^libdir='\| \|-L\|^dependency_libs='\)/usr/lib,\1$(STAGING_DIR)/usr/lib,g" $$$$fn; \ + $(SED) "s,\(^libdir='\| \|-L\|^dependency_libs='\)/usr/lib,\1$(STAGING_TARGET_DIR)/usr/lib,g" $$$$fn; \ done ifeq (,$(filter noscripts,$(7))) - @cd '$${STAGING_DIR}'; grep 'usr/s*bin/' \ - '$${STAGING_PARENT}/pkg/$(1)' | \ + @cd '$${STAGING_TARGET_DIR}'; grep 'usr/s*bin/' \ + '$${STAGING_PKG_DIR}/$(1)' | \ while read fn; do \ b="$$$$(dd if="$$$$fn" bs=2 count=1 2>/dev/null)"; \ [[ $$$$b = '#!' ]] || continue; \ cp "$$$$fn" scripts/; \ echo "scripts/$$$$(basename "$$$$fn")" \ - >>'$${STAGING_PARENT}/pkg/$(1)'; \ + >>'$${STAGING_PKG_DIR}/$(1)'; \ done endif ifeq (,$(filter libmix,$(7))) @@ -243,14 +243,14 @@ clean-targets: clean-dev-$(1) clean-dev-$(1): ifeq (,$(filter noremove,$(7))) - @if test -s '$${STAGING_PARENT}/pkg/$(1)'; then \ - cd '$${STAGING_DIR}'; \ + @if test -s '$${STAGING_PKG_DIR}/$(1)'; then \ + cd '$${STAGING_TARGET_DIR}'; \ while read fn; do \ rm -f "$$$$fn"; \ - done <'$${STAGING_PARENT}/pkg/$(1)'; \ + done <'$${STAGING_PKG_DIR}/$(1)'; \ fi endif - @rm -f '$${STAGING_PARENT}/pkg/$(1)' + @rm -f '$${STAGING_PKG_DIR}/$(1)' $$(INFO_$(1)): $$(IPKG_$(1)) $(PKG_INSTALL) $$(IPKG_$(1)) diff --git a/mk/pkg-bottom.mk b/mk/pkg-bottom.mk index 82f7b8588..50064b33b 100644 --- a/mk/pkg-bottom.mk +++ b/mk/pkg-bottom.mk @@ -128,7 +128,7 @@ do-install: post-install: ${_FAKE_COOKIE}: ${_BUILD_COOKIE} -rm -f ${_ALL_CONTROLS} - @mkdir -p '${STAGING_PARENT}/pkg' ${WRKINST} '${STAGING_DIR}/scripts' + @mkdir -p '${STAGING_PKG_DIR}' ${WRKINST} '${STAGING_TARGET_DIR}/scripts' @mkdir -p ${WRKINST}/{sbin,bin,etc,lib} ${WRKINST}/usr/{sbin,bin,lib} @${MAKE} ${_ALL_CONTROLS} $(MAKE_TRACE) @env ${MAKE_ENV} ${MAKE} pre-install $(MAKE_TRACE) @@ -147,41 +147,41 @@ endif ifeq ($(ADK_NATIVE),) @for a in ${WRKINST}/usr/{bin/*-config,lib/pkgconfig/*.pc}; do \ [[ -e $$a ]] || continue; \ - $(SED) "s,^prefix=.*,prefix=${STAGING_DIR}/usr," $$a; \ + $(SED) "s,^prefix=.*,prefix=${STAGING_TARGET_DIR}/usr," $$a; \ done endif ifeq (,$(filter noremove,${PKG_OPTS})) - @if test -s '${STAGING_PARENT}/pkg/${PKG_NAME}'; then \ - cd '${STAGING_DIR}'; \ + @if test -s '${STAGING_PKG_DIR}/${PKG_NAME}'; then \ + cd '${STAGING_TARGET_DIR}'; \ while read fn; do \ rm -f "$$fn"; \ - done <'${STAGING_PARENT}/pkg/${PKG_NAME}'; \ + done <'${STAGING_PKG_DIR}/${PKG_NAME}'; \ fi endif - @rm -f '${STAGING_PARENT}/pkg/${PKG_NAME}' + @rm -f '${STAGING_PKG_DIR}/${PKG_NAME}' @-cd ${WRKINST}; \ - if [ "${PKG_NAME}" != "uClibc" -a "${PKG_NAME}" != "eglibc" -a "${PKG_NAME}" != "glibc" -a "${PKG_NAME}" != "libpthread" -a "${PKG_NAME}" != "libstdcxx" -a "${PKG_NAME}" != "libthread-db" ];then \ + if [ "${PKG_NAME}" != "uClibc" -a "${PKG_NAME}" != "eglibc" -a "${PKG_NAME}" != "glibc" -a "${PKG_NAME}" != "libpthread" -a "${PKG_NAME}" != "libstdcxx" -a "${PKG_NAME}" != "libgcc" -a "${PKG_NAME}" != "libthread-db" ];then \ find lib \( -name lib\*.so\* -o -name lib\*.a \) \ -exec echo 'WARNING: ${PKG_NAME} installs files in /lib -' \ ' fix this!' >&2 \; -quit 2>/dev/null; fi;\ find usr ! -type d 2>/dev/null | \ grep -v -e '^usr/share' -e '^usr/man' -e '^usr/info' -e '^usr/lib/libc.so' | \ - tee '${STAGING_PARENT}/pkg/${PKG_NAME}' | \ - $(TOPDIR)/bin/tools/cpio -padlmu '${STAGING_DIR}' - @cd '${STAGING_DIR}'; grep 'usr/lib/.*\.la$$' \ - '${STAGING_PARENT}/pkg/${PKG_NAME}' | while read fn; do \ + tee '${STAGING_PKG_DIR}/${PKG_NAME}' | \ + $(TOPDIR)/bin/tools/cpio -padlmu '${STAGING_TARGET_DIR}' + @cd '${STAGING_TARGET_DIR}'; grep 'usr/lib/.*\.la$$' \ + '${STAGING_PKG_DIR}/${PKG_NAME}' | while read fn; do \ chmod u+w $$fn; \ - $(SED) "s,\(^libdir='\| \|-L\|^dependency_libs='\)/usr/lib,\1$(STAGING_DIR)/usr/lib,g" $$fn; \ + $(SED) "s,\(^libdir='\| \|-L\|^dependency_libs='\)/usr/lib,\1$(STAGING_TARGET_DIR)/usr/lib,g" $$fn; \ done ifeq (,$(filter noscripts,${PKG_OPTS})) - @cd '${STAGING_DIR}'; grep 'usr/s*bin/' \ - '${STAGING_PARENT}/pkg/${PKG_NAME}' | \ + @cd '${STAGING_TARGET_DIR}'; grep 'usr/s*bin/' \ + '${STAGING_PKG_DIR}/${PKG_NAME}' | \ while read fn; do \ b="$$(dd if="$$fn" bs=2 count=1 2>/dev/null)"; \ [[ $$b = '#!' ]] || continue; \ cp "$$fn" scripts/; \ echo "scripts/$$(basename "$$fn")" \ - >>'${STAGING_PARENT}/pkg/${PKG_NAME}'; \ + >>'${STAGING_PKG_DIR}/${PKG_NAME}'; \ done endif touch $@ @@ -236,11 +236,11 @@ clean-targets: clean-dev-generic clean-dev-generic: ifeq (,$(filter noremove,${PKG_OPTS})) - @if test -s '${STAGING_PARENT}/pkg/${PKG_NAME}'; then \ - cd '${STAGING_DIR}'; \ + @if test -s '${STAGING_PKG_DIR}/${PKG_NAME}'; then \ + cd '${STAGING_TARGET_DIR}'; \ while read fn; do \ rm -f "$$fn"; \ - done <'${STAGING_PARENT}/pkg/${PKG_NAME}'; \ + done <'${STAGING_PKG_DIR}/${PKG_NAME}'; \ fi endif - @rm -f '${STAGING_PARENT}/pkg/${PKG_NAME}' + @rm -f '${STAGING_PKG_DIR}/${PKG_NAME}' diff --git a/mk/python.mk b/mk/python.mk index 0a7816219..e0fce5f0e 100644 --- a/mk/python.mk +++ b/mk/python.mk @@ -1,3 +1,3 @@ PYTHON_VERSION=2.7 -PYTHON_LIBDIR:=$(STAGING_TOOLS)/lib -PYTHON:=${STAGING_TOOLS}/bin/hostpython +PYTHON_LIBDIR:=$(STAGING_HOST_DIR)/lib +PYTHON:=${STAGING_HOST_DIR}/bin/hostpython diff --git a/mk/rootfs.mk b/mk/rootfs.mk index aab7d4ab1..5ad4e9381 100644 --- a/mk/rootfs.mk +++ b/mk/rootfs.mk @@ -3,29 +3,30 @@ define rootfs_template ifeq ($(ADK_TARGET_ROOTFS_$(2)),y) -FS:=$(1) +ADK_TARGET_FS:=$(1) FS_CMDLINE:=$(3) endif endef -ifeq ($(ADK_HARDWARE_QEMU_X86),y) +ifeq ($(ADK_TARGET_SYSTEM_QEMU_X86),y) ROOTFS:= root=/dev/sda1 endif -ifeq ($(ADK_LINUX_MIPS_RB532),y) +ifeq ($(ADK_TARGET_SYSTEM_MIKROTIK_RB532),y) ROOTFS:= root=/dev/sda2 MTDDEV:= root=/dev/mtdblock1 endif -ifeq ($(ADK_LINUX_MIPS_RB433),y) +ifeq ($(ADK_TARGET_SYSTEM_MIKROTIK_RB433),y) MTDDEV:= root=/dev/mtdblock2 endif -ifeq ($(ADK_LINUX_ARM_FOXG20),y) +ifeq ($(ADK_TARGET_SYSTEM_ACMESYSTEMS_FOXG20),y) ROOTFS:= root=/dev/mmcblk0p2 rootwait endif -$(eval $(call rootfs_template,ext2-block,EXT2_BLOCK,$(ROOTFS))) +$(eval $(call rootfs_template,cf,CF,$(ROOTFS))) +$(eval $(call rootfs_template,mmc,MMC,$(ROOTFS))) $(eval $(call rootfs_template,usb,USB,rootdelay=3)) $(eval $(call rootfs_template,archive,ARCHIVE,$(ROOTFS))) $(eval $(call rootfs_template,initramfs,INITRAMFS)) @@ -35,4 +36,4 @@ $(eval $(call rootfs_template,yaffs,YAFFS,$(MTDDEV) panic=3)) $(eval $(call rootfs_template,nfsroot,NFSROOT,root=/dev/nfs ip=dhcp init=/init)) $(eval $(call rootfs_template,encrypted,ENCRYPTED)) -export FS +export ADK_TARGET_FS diff --git a/mk/vars.mk b/mk/vars.mk index 88dad66fb..25b285518 100644 --- a/mk/vars.mk +++ b/mk/vars.mk @@ -18,35 +18,25 @@ TARGET_CFLAGS:= $(TARGET_CFLAGS_ARCH) $(TARGET_DEBUGGING) -fwrapv BASE_DIR:= $(TOPDIR) DISTDIR?= ${BASE_DIR}/dl -ifeq ($(ADK_HW),) -BUILD_DIR:= ${BASE_DIR}/build_${ADK_TARGET}_${ADK_LIBC} -else -BUILD_DIR:= ${BASE_DIR}/build_${ADK_HW}_${ADK_TARGET}_${ADK_LIBC} -endif +BUILD_DIR:= ${BASE_DIR}/build_${ADK_TARGET_SYSTEM}_${CPU_ARCH}_${ADK_TARGET_LIBC} BUILD_DIR_PFX:= $(BASE_DIR)/build_* -STAGING_PARENT:= ${BASE_DIR}/cross_${ADK_TARGET}_${ADK_LIBC} -STAGING_PARENT_PFX:= ${BASE_DIR}/cross_* -STAGING_TOOLS:= ${STAGING_PARENT}/host -STAGING_DIR:= ${STAGING_PARENT}/target -TOOLCHAIN_BUILD_DIR= $(BASE_DIR)/toolchain_build_${ADK_TARGET}_${ADK_LIBC} +STAGING_PKG_DIR:= ${BASE_DIR}/pkg_${ADK_TARGET_SYSTEM}_${ADK_TARGET_LIBC} +STAGING_PKG_DIR_PFX:= ${BASE_DIR}/pkg_* +STAGING_HOST_DIR:= ${BASE_DIR}/host_${CPU_ARCH}_${ADK_TARGET_LIBC} +STAGING_HOST_DIR_PFX:= ${BASE_DIR}/host_* +STAGING_TARGET_DIR:= ${BASE_DIR}/target_${CPU_ARCH}_${ADK_TARGET_LIBC} +STAGING_TARGET_DIR_PFX:=${BASE_DIR}/target_* +TOOLCHAIN_BUILD_DIR= $(BASE_DIR)/toolchain_build_${CPU_ARCH}_${ADK_TARGET_LIBC} TOOLCHAIN_BUILD_DIR_PFX=$(BASE_DIR)/toolchain_build_* TOOLS_BUILD_DIR= $(BASE_DIR)/tools_build TOOLS_DIR:= $(BASE_DIR)/bin/tools SCRIPT_DIR:= $(BASE_DIR)/scripts -ifeq ($(ADK_HW),) -BIN_DIR:= $(BASE_DIR)/bin/${ADK_TARGET}_${ADK_LIBC} -else -BIN_DIR:= $(BASE_DIR)/bin/${ADK_HW}_${ADK_TARGET}_${ADK_LIBC} -endif +BIN_DIR:= $(BASE_DIR)/bin/${ADK_TARGET_SYSTEM}_${CPU_ARCH}_${ADK_TARGET_LIBC} BIN_DIR_PFX:= $(BASE_DIR)/bin PACKAGE_DIR:= $(BIN_DIR)/packages -ifeq ($(ADK_HW),) -TARGET_DIR:= $(BASE_DIR)/root_${ADK_TARGET}_${ADK_LIBC} -else -TARGET_DIR:= $(BASE_DIR)/root_${ADK_HW}_${ADK_TARGET}_${ADK_LIBC} -endif +TARGET_DIR:= $(BASE_DIR)/root_${ADK_TARGET_SYSTEM}_${CPU_ARCH}_${ADK_TARGET_LIBC} TARGET_DIR_PFX:= $(BASE_DIR)/root_* -TARGET_PATH= ${SCRIPT_DIR}:${TOOLS_DIR}:${STAGING_TOOLS}/bin:${STAGING_DIR}/scripts:${_PATH} +TARGET_PATH= ${SCRIPT_DIR}:${TOOLS_DIR}:${STAGING_HOST_DIR}/bin:${STAGING_TARGET_DIR}/scripts:${_PATH} REAL_GNU_TARGET_NAME= $(CPU_ARCH)-$(ADK_VENDOR)-linux-$(ADK_TARGET_SUFFIX) GNU_TARGET_NAME= $(CPU_ARCH)-$(ADK_VENDOR)-linux TOOLCHAIN_SYSROOT:= $(TOOLCHAIN_BUILD_DIR)/libc_dev @@ -54,18 +44,18 @@ ifeq ($(ADK_NATIVE),y) TARGET_CROSS:= TARGET_COMPILER_PREFIX?= else -TARGET_CROSS:= $(STAGING_TOOLS)/bin/$(REAL_GNU_TARGET_NAME)- +TARGET_CROSS:= $(STAGING_HOST_DIR)/bin/$(REAL_GNU_TARGET_NAME)- TARGET_COMPILER_PREFIX?=${TARGET_CROSS} 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_CPPFLAGS+= -I${STAGING_TARGET_DIR}/usr/include TARGET_LDFLAGS+= -Wl,-O2 PATCH= ${BASH} $(SCRIPT_DIR)/patch.sh SED:= sed -i -e LINUX_DIR:= $(BUILD_DIR)/linux -LINUX_HEADER_DIR:= $(STAGING_DIR)/linux-header +LINUX_HEADER_DIR:= $(STAGING_TARGET_DIR)/linux-header TARGET_CONFIGURE_OPTS= PATH='${TARGET_PATH}' \ AR=$(TARGET_CROSS)ar \ @@ -90,7 +80,7 @@ PKG_BUILD:= PATH='${TARGET_PATH}' \ ${BASH} ${SCRIPT_DIR}/ipkg-build PKG_INSTALL:= IPKG_TMP=$(BUILD_DIR)/tmp \ IPKG_INSTROOT=$(TARGET_DIR) \ - IPKG_CONF_DIR=$(STAGING_DIR)/etc \ + IPKG_CONF_DIR=$(STAGING_TARGET_DIR)/etc \ IPKG_OFFLINE_ROOT=$(TARGET_DIR) \ ${BASH} ${SCRIPT_DIR}/ipkg \ -force-defaults -force-depends install |