2018-03-16 16:59:24 +00:00
|
|
|
ifeq "$(MUSL_CROSS_ONCE)" ""
|
|
|
|
MUSL_CROSS_ONCE := 1
|
|
|
|
|
|
|
|
|
|
|
|
# Allow the path to the musl-cross directory to be passed on
|
|
|
|
# the environment so that the full path doens't need to be spelled out
|
|
|
|
ifneq "$(MUSL_DIR)" ""
|
|
|
|
CROSS := $(MUSL_DIR)/crossgcc/x86_64-linux-musl/bin/x86_64-linux-musl-
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifneq "$(CROSS)" ""
|
|
|
|
|
|
|
|
# check that $(CROSS)gcc exists or else things just won't work
|
|
|
|
ifneq "y" "$(shell [ -x '$(CROSS)gcc' ] && echo y)"
|
2018-03-16 17:37:24 +00:00
|
|
|
$(error $(CROSS)gcc does not exist - can not build)
|
2018-03-16 16:59:24 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
# The cross compiler has already been built, so the musl-cross target
|
|
|
|
# is a NOP.
|
2018-05-02 15:38:39 +00:00
|
|
|
#musl-cross.intermediate:
|
2017-01-31 17:45:42 +00:00
|
|
|
|
2018-03-16 16:59:24 +00:00
|
|
|
else
|
|
|
|
|
|
|
|
# Force a full build of the cross compiler
|
|
|
|
|
|
|
|
modules-y += musl-cross
|
2017-01-31 17:45:42 +00:00
|
|
|
musl-cross_version := git
|
|
|
|
musl-cross_dir := musl-cross-$(musl-cross_version)
|
|
|
|
musl-cross_repo := https://github.com/GregorR/musl-cross
|
|
|
|
|
2018-05-02 15:38:39 +00:00
|
|
|
CROSS_TOP := crossgcc/x86_64-linux-musl/bin/x86_64-musl-linux-
|
|
|
|
CROSS := $(build)/../$(CROSS_TOP)
|
|
|
|
musl-cross_output := ../../$(CROSS_TOP)gcc
|
2018-03-16 19:18:13 +00:00
|
|
|
|
2017-01-31 17:45:42 +00:00
|
|
|
musl-cross_configure := \
|
2017-02-28 20:54:49 +00:00
|
|
|
/bin/echo -e > Makefile \
|
2017-01-31 17:45:42 +00:00
|
|
|
'$(musl-cross_output):\n\tCC_BASE_PREFIX="$(pwd)/crossgcc" ./build.sh'
|
|
|
|
|
2018-03-16 16:59:24 +00:00
|
|
|
|
|
|
|
endif
|
|
|
|
|
2017-01-31 17:45:42 +00:00
|
|
|
musl-cross_target :=
|
|
|
|
|
2018-03-16 16:59:24 +00:00
|
|
|
endif
|