summaryrefslogtreecommitdiff
path: root/mk
diff options
context:
space:
mode:
authordir <dir@ableton.com>2017-03-15 14:13:25 +0100
committerWaldemar Brodkorb <wbx@openadk.org>2017-03-22 06:04:07 +0100
commita455c0620f3f54e8b261520014916e2d18a8c6fe (patch)
treed433c71647a081577cf57ee00f938669f2b24b03 /mk
parent0918c67d7e39f6e97a77289e2a7a3bf2c725b7af (diff)
Introduce CCACHE-less compiler variables and use for building with cmake
Diffstat (limited to 'mk')
-rw-r--r--mk/pkg-bottom.mk8
-rw-r--r--mk/vars.mk15
2 files changed, 13 insertions, 10 deletions
diff --git a/mk/pkg-bottom.mk b/mk/pkg-bottom.mk
index b88517752..21e8abed2 100644
--- a/mk/pkg-bottom.mk
+++ b/mk/pkg-bottom.mk
@@ -52,8 +52,8 @@ ifneq ($(filter manual,${CONFIG_STYLE}),)
env ${CONFIGURE_ENV} ${MAKE} do-configure $(MAKE_TRACE)
else ifneq ($(filter cmake,${CONFIG_STYLE}),)
@$(CMD_TRACE) "configuring cmake.. "
- sed -e "s#@@TARGET_CC@@#$(TARGET_CC)#" \
- -e "s#@@TARGET_CXX@@#$(TARGET_CXX)#" \
+ sed -e "s#@@TARGET_CC@@#$(TARGET_CC_NO_CCACHE)#" \
+ -e "s#@@TARGET_CXX@@#$(TARGET_CXX_NO_CCACHE)#" \
-e "s#@@TARGET_CFLAGS@@#$(TARGET_CFLAGS)#" \
-e "s#@@TARGET_CXXFLAGS@@#$(TARGET_CXXFLAGS)#" \
-e "s#@@TARGET_ARCH@@#$(ADK_TARGET_ARCH)#" \
@@ -185,11 +185,11 @@ ifneq (,$(filter dev,${PKG_OPTS}))
@mkdir -p $(WRKDIR)/fake-${ADK_TARGET_CPU_ARCH}/pkg-$(PKG_LIBNAME)-dev/usr/include
@test -d ${WRKINST}/usr/include && cd ${WRKINST}/usr/include; \
find . -name \*.h | \
- $(CPIO) -padlmu --quiet $(WRKDIR)/fake-${ADK_TARGET_CPU_ARCH}/pkg-$(PKG_LIBNAME)-dev/usr/include
+ $(CPIO) -padlmu --quiet $(WRKDIR)/fake-${ADK_TARGET_CPU_ARCH}/pkg-$(PKG_LIBNAME)-dev/usr/include
@mkdir -p $(WRKDIR)/fake-${ADK_TARGET_CPU_ARCH}/pkg-$(PKG_LIBNAME)-dev/usr/lib/pkgconfig
@test -d ${WRKINST}/usr/lib/pkgconfig && cd ${WRKINST}/usr/lib/pkgconfig; \
find . -name \*.pc | \
- $(CPIO) -padlmu --quiet $(WRKDIR)/fake-${ADK_TARGET_CPU_ARCH}/pkg-$(PKG_LIBNAME)-dev/usr/lib/pkgconfig
+ $(CPIO) -padlmu --quiet $(WRKDIR)/fake-${ADK_TARGET_CPU_ARCH}/pkg-$(PKG_LIBNAME)-dev/usr/lib/pkgconfig
@for a in ${WRKINST}/usr/bin/*-config*; do \
[[ -e $$a ]] || continue; \
mkdir -p $(WRKDIR)/fake-${ADK_TARGET_CPU_ARCH}/pkg-$(PKG_LIBNAME)-dev/usr/bin; \
diff --git a/mk/vars.mk b/mk/vars.mk
index 7dcc756ee..ab9c0dcc1 100644
--- a/mk/vars.mk
+++ b/mk/vars.mk
@@ -90,14 +90,12 @@ CONFIGURE_TRIPLE:= --build=${GNU_HOST_NAME} \
--host=${GNU_TARGET_NAME} \
--target=${GNU_TARGET_NAME}
-ifneq ($(strip ${ADK_USE_CCACHE}),)
-TARGET_COMPILER_PREFIX=$(STAGING_HOST_DIR)/usr/bin/ccache ${TARGET_CROSS}
-endif
-
# target tools
ifeq ($(ADK_BUILD_COMPILER_GCC),y)
TARGET_CC:= ${TARGET_COMPILER_PREFIX}gcc
TARGET_CXX:= ${TARGET_COMPILER_PREFIX}g++
+TARGET_CC_NO_CCACHE:= ${TARGET_CC}
+TARGET_CXX_NO_CCACHE:= ${TARGET_CXX}
endif
ifeq ($(ADK_BUILD_COMPILER_LLVM),y)
TARGET_CC:= clang --target=${GNU_TARGET_NAME} --sysroot=$(STAGING_TARGET_DIR)
@@ -107,6 +105,11 @@ endif
# gcc specific
ifeq ($(ADK_BUILD_COMPILER_GCC),y)
+ifneq ($(strip ${ADK_USE_CCACHE}),)
+TARGET_CC:= $(STAGING_HOST_DIR)/usr/bin/ccache ${TARGET_CC_NO_CCACHE}
+TARGET_CXX:= $(STAGING_HOST_DIR)/usr/bin/ccache ${TARGET_CXX_NO_CXXACHE}
+endif
+
# for x86_64 x32 ABI we need to extend TARGET_CC/TARGET_CXX
ifeq ($(ADK_TARGET_ABI_X32),y)
TARGET_CC+= $(ADK_TARGET_ABI_CFLAGS)
@@ -332,7 +335,7 @@ TOOLS_ENV= AR='$(TARGET_CROSS)ar' \
RANLIB='$(TARGET_CROSS)ranlib' \
NM='$(TARGET_CROSS)nm'
endif
-
+
TARGET_ENV= $(TOOLS_ENV) \
AS='$(TARGET_CROSS)as' \
LD='$(TARGET_CROSS)ld' \
@@ -404,7 +407,7 @@ endif
RSTRIP:= PATH="$(TARGET_PATH)" prefix='${TARGET_CROSS}' ${BASH} ${SCRIPT_DIR}/rstrip.sh
STATCMD:=$(shell if stat -qs .>/dev/null 2>&1; then echo 'stat -f %z';else echo 'stat -c %s';fi)
-
+
EXTRACT_CMD= PATH='${HOST_PATH}'; mkdir -p ${WRKDIR}; \
cd ${WRKDIR} && \
for file in ${FULLDISTFILES}; do case $$file in \