From 03bd65562a509ff86bfe8861f8e51e973bcfdd3b Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Thu, 19 May 2016 03:15:32 +0000 Subject: [PATCH] litecross: build target config logic into the makefile leaving necessary configuration options for certain targets to the user is error-prone and inconvenient. instead of configuration for exact target string matchs in the sample config.mak, provide general logic in the makefile itself which should cover all variants as well. --- config.mak.dist | 17 ----------------- litecross/Makefile | 25 +++++++++++++++++++++++++ 2 files changed, 25 insertions(+), 17 deletions(-) diff --git a/config.mak.dist b/config.mak.dist index a6ccfad..b78c9bd 100644 --- a/config.mak.dist +++ b/config.mak.dist @@ -63,20 +63,3 @@ # where to look for source files. # COMMON_CONFIG += --with-debug-prefix-map=$(PWD)= - -# The following are options needed to make certain targets work right. -# They may be moved to main build logic rather than config.mak at some -# point in the future. - -ifeq ($(TARGET),sh2eb-linux-muslfdpic) -GCC_CONFIG += --with-cpu=mj2 -GCC_CONFIG += --enable-fdpic -endif - -ifeq ($(TARGET),mips64-linux-musl) -GCC_CONFIG += --with-abi=64 -endif - -ifeq ($(TARGET),arm-linux-musleabihf) -GCC_CONFIG += --with-float=hard -endif diff --git a/litecross/Makefile b/litecross/Makefile index 6bad09f..27f3676 100644 --- a/litecross/Makefile +++ b/litecross/Makefile @@ -12,6 +12,31 @@ TOOLCHAIN_CONFIG = $(GCC_CONFIG) XGCC_DIR = ../obj_toolchain/gcc XGCC = $(XGCC_DIR)/xgcc -B $(XGCC_DIR) +ifneq ($(findstring fdpic,$(TARGET)),) +GCC_CONFIG += --enable-fdpic +endif + +ifneq ($(filter x86_64%x32,$(TARGET)),) +GCC_CONFIG += --with-abi=x32 +endif + +ifneq ($(findstring mips64,$(TARGET))$(findstring mipsisa64,$(TARGET)),) +ifneq ($(findstring n32,$(TARGET)),) +GCC_CONFIG += --with-abi=n32 +else +GCC_CONFIG += --with-abi=64 +endif +endif + +ifneq ($(filter %sf,$(TARGET)),) +GCC_CONFIG += --with-float=soft +endif + +ifneq ($(filter %hf,$(TARGET)),) +GCC_CONFIG += --with-float=hard +endif + + -include config.mak MAKE += MULTILIB_OSDIRNAMES=