summaryrefslogtreecommitdiff
path: root/mk
diff options
context:
space:
mode:
Diffstat (limited to 'mk')
-rw-r--r--mk/build.mk15
-rw-r--r--mk/modules.mk4
-rw-r--r--mk/vars.mk35
3 files changed, 26 insertions, 28 deletions
diff --git a/mk/build.mk b/mk/build.mk
index 90168586a..821548428 100644
--- a/mk/build.mk
+++ b/mk/build.mk
@@ -41,8 +41,6 @@ DEFCONFIG= ADK_DEBUG=n \
ADK_PKG_TEST=n \
ADK_PKG_MPDBOX=n \
ADK_PKG_DEVELOPMENT=n \
- ADK_PKG_CONSOLE=n \
- ADK_PKG_TEST=n \
ADK_TOOLCHAIN_GCC_USE_SSP=n \
ADK_TOOLCHAIN_GCC_USE_LTO=n \
BUSYBOX_IFPLUGD=n \
@@ -122,7 +120,7 @@ POSTCONFIG= -@\
make kernelclean;\
fi; \
if [ "$$(grep ^ADK_LINUX_ARM_WITH_THUMB .config|md5sum)" != "$$(grep ^ADK_LINUX_ARM_WITH_THUMB .config.old|md5sum)" ];then \
- echo "You should make cleantarget, after changing thumb mode";\
+ echo "You should make cleandir, after changing thumb mode";\
fi; \
if [ $$rebuild -eq 1 ];then \
cp .config .config.old;\
@@ -144,7 +142,7 @@ ${TOPDIR}/package/Depends.mk: ${TOPDIR}/.config $(wildcard ${TOPDIR}/package/*/M
$(STAGING_HOST_DIR)/usr/bin/depmaker > ${TOPDIR}/package/Depends.mk
.NOTPARALLEL:
-.PHONY: all world clean cleantarget cleandir cleantoolchain distclean image_clean
+.PHONY: all world clean cleandir cleantoolchain distclean image_clean
world:
mkdir -p $(DL_DIR) $(BUILD_DIR) $(TARGET_DIR) $(FW_DIR) \
@@ -275,13 +273,6 @@ cleantoolchain:
@rm -rf $(STAGING_TARGET_DIR_PFX) $(STAGING_PKG_DIR_PFX)
@rm -f .menu .tmpconfig.h .rebuild* ${TOPDIR}/package/Depends.mk
-cleantarget:
- @$(TRACE) cleantarget
- @$(MAKE) -C $(CONFIG) clean $(MAKE_TRACE)
- rm -rf $(BUILD_DIR) $(FW_DIR) $(TARGET_DIR)
- rm -rf $(TOOLCHAIN_BUILD_DIR) $(STAGING_HOST_DIR) $(STAGING_TARGET_DIR) $(STAGING_PKG_DIR)
- rm -f .tmpconfig.h all.config .defconfig
-
distclean:
@$(TRACE) distclean
@$(MAKE) -C $(CONFIG) clean $(MAKE_TRACE)
@@ -593,7 +584,7 @@ bulkallmod:
$(GMAKE) prereq && \
$(GMAKE) ARCH=$$arch SYSTEM=$$system LIBC=$$libc FS=archive allmodconfig; \
$(GMAKE) VERBOSE=1 all; if [ $$? -ne 0 ]; then echo $$system-$$libc >.exit; exit 1;fi; \
- $(GMAKE) cleantarget; \
+ $(GMAKE) clean; \
rm .config; \
) 2>&1 | tee $(TOPDIR)/firmware/$${system}_$${arch}_$$libc/build.log; \
if [ -f .exit ]; then break;fi \
diff --git a/mk/modules.mk b/mk/modules.mk
index 52678042c..e8a0821de 100644
--- a/mk/modules.mk
+++ b/mk/modules.mk
@@ -1294,7 +1294,7 @@ $(eval $(call KMOD_template,PCMCIA,pcmcia,\
,60))
$(eval $(call KMOD_template,SERIAL_8250_CS,serial-8250-cs,\
- $(MODULES_DIR)/kernel/drivers/tty/serial/serial_cs \
+ $(MODULES_DIR)/kernel/drivers/tty/serial/8250/serial_cs \
,70))
#
@@ -1743,7 +1743,7 @@ $(eval $(call KMOD_template,PARPORT_PC,parport-pc,\
,55))
$(eval $(call KMOD_template,PLIP,plip,\
- $(MODULES_DIR)/kernel/drivers/net/plip \
+ $(MODULES_DIR)/kernel/drivers/net/plip/plip \
,60))
#
diff --git a/mk/vars.mk b/mk/vars.mk
index 5fd4a51aa..dc030f0ca 100644
--- a/mk/vars.mk
+++ b/mk/vars.mk
@@ -21,7 +21,7 @@ TOOLS_BUILD_DIR= $(BASE_DIR)/tools_build
SCRIPT_DIR:= $(BASE_DIR)/scripts
STAGING_HOST_DIR:= ${BASE_DIR}/host_${GNU_HOST_NAME}
-# PFX dirs for cleandir
+# dirs for cleandir
FW_DIR_PFX:= $(BASE_DIR)/firmware
BUILD_DIR_PFX:= $(BASE_DIR)/build_*
STAGING_PKG_DIR_PFX:= ${BASE_DIR}/pkg_*
@@ -56,18 +56,13 @@ TARGET_PATH= ${SCRIPT_DIR}:${STAGING_TARGET_DIR}/scripts:${STAGING_HOST_DIR}/bi
HOST_PATH= ${SCRIPT_DIR}:${STAGING_HOST_DIR}/bin:${STAGING_HOST_DIR}/usr/bin:${_PATH}
AUTOTOOL_PATH= ${STAGING_HOST_DIR}/bin:${STAGING_HOST_DIR}/usr/bin:${STAGING_TARGET_DIR}/scripts:${_PATH}
-ifeq ($(ADK_TARGET_ABI_X32),y)
-GNU_TARGET_NAME= $(CPU_ARCH)-x32-linux-$(ADK_TARGET_SUFFIX)
-else
-GNU_TARGET_NAME= $(CPU_ARCH)-$(ADK_VENDOR)-linux-$(ADK_TARGET_SUFFIX)
-endif
-
ifeq ($(ADK_DISABLE_HONOUR_CFLAGS),)
GCC_CHECK:= GCC_HONOUR_COPTS=2
else
GCC_CHECK:=
endif
+GNU_TARGET_NAME:= $(CPU_ARCH)-$(ADK_VENDOR)-linux-$(ADK_TARGET_SUFFIX)
TARGET_CROSS:= $(STAGING_HOST_DIR)/bin/$(GNU_TARGET_NAME)-
TARGET_COMPILER_PREFIX?=${TARGET_CROSS}
CONFIGURE_TRIPLE:= --build=${GNU_HOST_NAME} --host=${GNU_TARGET_NAME} --target=${GNU_TARGET_NAME}
@@ -76,10 +71,17 @@ ifneq ($(strip ${ADK_USE_CCACHE}),)
TARGET_COMPILER_PREFIX=ccache ${TARGET_CROSS}
endif
-# target compiler flags
+# target tools
TARGET_CC:= ${TARGET_COMPILER_PREFIX}gcc
TARGET_CXX:= ${TARGET_COMPILER_PREFIX}g++
TARGET_LD:= ${TARGET_COMPILER_PREFIX}ld
+TARGET_AR:= ${TARGET_COMPILER_PREFIX}ar
+TARGET_RANLIB:= ${TARGET_COMPILER_PREFIX}ranlib
+
+ifneq ($(ADK_TARGET_ABI_CFLAGS),)
+TARGET_CC+= $(ADK_TARGET_ABI_CFLAGS)
+TARGET_CXX+= $(ADK_TARGET_ABI_CFLAGS)
+endif
MODE_FLAGS:=
ifeq ($(ADK_LINUX_ARM),y)
@@ -91,13 +93,13 @@ endif
endif
TARGET_CPPFLAGS:=
-TARGET_CFLAGS:= $(TARGET_CFLAGS_ARCH) -fwrapv -fno-ident -fhonour-copts $(ADK_TARGET_ABI_CFLAGS) $(MODE_FLAGS)
-TARGET_CFLAGS_LIBC:= $(TARGET_CFLAGS_ARCH) -fwrapv -fno-ident -fhonour-copts $(TARGET_OPTIMIZATION) $(MODE_FLAGS)
-TARGET_CXXFLAGS:= $(TARGET_CFLAGS_ARCH) -fwrapv -fno-ident $(MODE_FLAGS)
+TARGET_CFLAGS:= $(TARGET_CFLAGS_ARCH) -fwrapv -fno-ident -fhonour-copts
+TARGET_CXXFLAGS:= $(TARGET_CFLAGS_ARCH) -fwrapv -fno-ident
TARGET_LDFLAGS:= -L$(STAGING_TARGET_DIR)/lib -L$(STAGING_TARGET_DIR)/usr/lib \
-Wl,-O1 -Wl,-rpath -Wl,/usr/lib \
-Wl,-rpath-link -Wl,${STAGING_TARGET_DIR}/usr/lib \
$(ADK_TARGET_ABI_LDFLAGS)
+
# security optimization, see http://www.akkadia.org/drepper/dsohowto.pdf
TARGET_LDFLAGS+= -Wl,-z,relro,-z,now
# needed for musl ppc
@@ -130,6 +132,10 @@ TARGET_CFLAGS+= -fno-unwind-tables -fno-asynchronous-unwind-tables
TARGET_CFLAGS+= -g3
endif
+ifneq ($(MODE_FLAGS),)
+TARGET_CFLAGS+= $(MODE_CFLAGS)
+TARGET_CXXFLAGS+= $(MODE_CFLAGS)
+endif
# A nifty macro to make testing gcc features easier (from uClibc project)
check_gcc=$(shell \
@@ -139,7 +145,6 @@ check_gcc=$(shell \
CF_FOR_BUILD=$(call check_gcc,-fhonour-copts,)
# host compiler flags
-CXX_FOR_BUILD?= g++
CPPFLAGS_FOR_BUILD?= -I$(STAGING_HOST_DIR)/usr/include
CFLAGS_FOR_BUILD= -O2 -Wall $(CF_FOR_BUILD)
CXXFLAGS_FOR_BUILD?= -O2 -Wall
@@ -150,9 +155,11 @@ PATCH= ${BASH} $(SCRIPT_DIR)/patch.sh
SED:= PATH=${HOST_PATH} sed -i -e
LINUX_DIR:= $(BUILD_DIR)/linux
KERNEL_MODULE_FLAGS:= ARCH=${ARCH} \
- KERNEL_PATH=${LINUX_DIR} KERNELDIR=${LINUX_DIR} KERNEL_DIR=${LINUX_DIR} \
+ KERNEL_PATH=${LINUX_DIR} \
+ KERNELDIR=${LINUX_DIR} \
+ KERNEL_DIR=${LINUX_DIR} \
PREFIX=/usr CROSS_COMPILE="${TARGET_CROSS}" \
- LDFLAGS="$(ADK_TARGET_KERNEL_LDFLAGS)" CFLAGS_MODULE="-fhonour-copts" V=1
+ CFLAGS_MODULE="-fhonour-copts" V=1
TARGET_CONFIGURE_OPTS= PATH='${TARGET_PATH}' \
AR='$(TARGET_CROSS)ar' \