From 77d2e823090aa1abf7558029920d275259cecdf5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alberto=20Gonz=C3=A1lez=20Palomo?= Date: Mon, 11 Jan 2021 22:30:21 +0100 Subject: [PATCH] makefile: improve Makefile, support more CPU architectures (#8043) Tested on PowerPC, IBM Power9 on Void Linux. --- Makefile | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index b42a4dd23c..13b33a652c 100644 --- a/Makefile +++ b/Makefile @@ -71,10 +71,7 @@ endif endif endif -# note that a branch may not exist yet for the user's system configuration, -# in that case they'll get an error from git while cloning it. -# TODO: print a pretty error ourselves in that case, and ask the user to open a feature request -TCCBRANCH := thirdparty-$(TCCOS)-$(TCCARCH) +.PHONY: all clean fresh_vc fresh_tcc all: latest_vc latest_tcc ifdef WIN32 @@ -118,6 +115,7 @@ else endif fresh_vc: + rm -rf $(VC) $(GITFASTCLONE) $(VCREPO) $(VC) latest_tcc: $(TMPTCC)/.git/config @@ -131,7 +129,13 @@ endif fresh_tcc: rm -rf $(TMPTCC) - $(GITFASTCLONE) --branch $(TCCBRANCH) $(TCCREPO) $(TMPTCC) +# Check wether a TCC branch exists for the user's system configuration. +ifneq (,$(findstring thirdparty-$(TCCOS)-$(TCCARCH), $(shell git ls-remote --heads $(TCCREPO) | sed 's/^[a-z0-9]*\trefs.heads.//'))) + $(GITFASTCLONE) --branch thirdparty-$(TCCOS)-$(TCCARCH) $(TCCREPO) $(TMPTCC) +else + @echo 'Pre-built TCC not available for thirdparty-$(TCCOS)-$(TCCARCH) at $(TCCREPO), will use the system compiler: $(CC)' + $(GITFASTCLONE) --branch thirdparty-unknown-unknown $(TCCREPO) $(TMPTCC) +endif $(TMPTCC)/.git/config: $(MAKE) fresh_tcc