From 0ab346e85d74a376875cc918f295fc4e014ff2f8 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Mon, 2 May 2016 17:45:22 +0000 Subject: [PATCH] litecross: accept empty {GMP,MPC,MPFR}_SRCDIR to use pre-installed ones --- litecross/Makefile | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/litecross/Makefile b/litecross/Makefile index bbb3630..5ca8c94 100644 --- a/litecross/Makefile +++ b/litecross/Makefile @@ -54,23 +54,32 @@ src_gcc: | $(GCC_SRCDIR) src_musl: | $(MUSL_SRCDIR) ln -sf $(MUSL_SRCDIR) $@ +ifneq ($(GMP_SRCDIR),) +src_toolchain: src_gmp src_gmp: | $(GMP_SRCDIR) ln -sf "$(GMP_SRCDIR)" $@ +endif +ifneq ($(MPC_SRCDIR),) +src_toolchain: src_mpc src_mpc: | $(MPC_SRCDIR) ln -sf "$(MPC_SRCDIR)" $@ +endif +ifneq ($(MPFR_SRCDIR),) +src_toolchain: src_mpfr src_mpfr: | $(MPFR_SRCDIR) ln -sf "$(MPFR_SRCDIR)" $@ +endif -src_toolchain: src_binutils src_gcc src_gmp src_mpc src_mpfr +src_toolchain: src_binutils src_gcc rm -rf $@ $@.tmp mkdir $@.tmp cd $@.tmp && ln -sf ../src_binutils/* . cd $@.tmp && ln -sf ../src_gcc/* . - cd $@.tmp && ln -sf ../src_gmp gmp - cd $@.tmp && ln -sf ../src_mpc mpc - cd $@.tmp && ln -sf ../src_mpfr mpfr + $(if $(GMP_SRCDIR),cd $@.tmp && ln -sf ../src_gmp gmp) + $(if $(MPC_SRCDIR),cd $@.tmp && ln -sf ../src_mpc mpc) + $(if $(MPFR_SRCDIR),cd $@.tmp && ln -sf ../src_mpfr mpfr) mv $@.tmp $@ obj_%: