|
@@ -20,6 +20,9 @@ OSNeedsComspecToRunBatch = go32v2 watcom
|
|
|
FORCE:
|
|
|
.PHONY: FORCE
|
|
|
|
|
|
+lc = $(subst A,a,$(subst B,b,$(subst C,c,$(subst D,d,$(subst E,e,$(subst F,f,$(subst G,g,$(subst H,h,$(subst I,i,$(subst J,j,$(subst K,k,$(subst L,l,$(subst M,m,$(subst N,n,$(subst O,o,$(subst P,p,$(subst Q,q,$(subst R,r,$(subst S,s,$(subst T,t,$(subst U,u,$(subst V,v,$(subst W,w,$(subst X,x,$(subst Y,y,$(subst Z,z,$1))))))))))))))))))))))))))
|
|
|
+
|
|
|
+
|
|
|
[osdetect]
|
|
|
#####################################################################
|
|
|
# Autodetect source OS (Linux or Dos or Windows NT or OS/2 or other)
|
|
@@ -249,8 +252,26 @@ endif
|
|
|
ifndef OS_TARGET
|
|
|
OS_TARGET:=$(word 5,$(FPC_COMPILERINFO))
|
|
|
endif
|
|
|
-FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
|
|
|
+
|
|
|
+CPU_OS_TARGET=$(CPU_TARGET)-$(OS_TARGET)
|
|
|
+ifdef SUB_TARGET
|
|
|
+L_SUB_TARGET=$(call lc,$(SUB_TARGET))
|
|
|
+FULL_TARGET:=$(CPU_TARGET)-$(OS_TARGET)-$(L_SUB_TARGET)
|
|
|
+else
|
|
|
+FULL_TARGET:=$(CPU_TARGET)-$(OS_TARGET)
|
|
|
+endif
|
|
|
+
|
|
|
+#
|
|
|
+# not sure if we'll need this, but defining it for the moment.
|
|
|
+# Reason for defining it: this could redefine a "cross-compile".
|
|
|
+#
|
|
|
+CPU_OS_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
|
|
|
+ifdef SUB_SOURCE
|
|
|
+L_SUB_SOURCE=$(call lc,$(SUB_SOURCE))
|
|
|
+FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)-$(L_SUB_SOURCE)
|
|
|
+else
|
|
|
FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
|
|
|
+endif
|
|
|
|
|
|
ifeq ($(CPU_TARGET),armeb)
|
|
|
ARCH=arm
|
|
@@ -268,6 +289,11 @@ ifeq ($(FULL_TARGET),aarch64-embedded)
|
|
|
# override FPCOPT+=-Cp$(SUBARCH)
|
|
|
endif
|
|
|
|
|
|
+ifdef SUB_TARGET
|
|
|
+override FPCOPT+=-t$(SUB_TARGET)
|
|
|
+endif
|
|
|
+
|
|
|
+
|
|
|
ifeq ($(FULL_TARGET),arm-embedded)
|
|
|
ifeq ($(SUBARCH),)
|
|
|
# we don't add a default here, people should explicitly add the SUBARCH
|
|
@@ -328,14 +354,17 @@ SOURCESUFFIX=$(FULL_SOURCE)
|
|
|
endif
|
|
|
|
|
|
# Cross compile flag
|
|
|
-ifneq ($(FULL_TARGET),$(FULL_SOURCE))
|
|
|
+#
|
|
|
+# We may need to switch to FULL_TARGET/FULL_TARGET
|
|
|
+#
|
|
|
+ifneq ($(CPU_OS_TARGET),$(CPU_OS_SOURCE))
|
|
|
CROSSCOMPILE=1
|
|
|
endif
|
|
|
|
|
|
# Check if the Makefile supports this target, but not
|
|
|
# when the make target is to rebuild the makefile
|
|
|
ifeq ($(findstring makefile,$(MAKECMDGOALS)),)
|
|
|
-ifeq ($(filter $(FULL_TARGET),$(MAKEFILETARGETS)),)
|
|
|
+ifeq ($(filter $(CPU_OS_TARGET),$(MAKEFILETARGETS)),)
|
|
|
$(error The Makefile doesn't support target $(FULL_TARGET), please run fpcmake first)
|
|
|
endif
|
|
|
endif
|
|
@@ -361,7 +390,7 @@ BUILDNATIVE=1
|
|
|
export BUILDNATIVE
|
|
|
endif
|
|
|
|
|
|
-export OS_TARGET OS_SOURCE ARCH CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE TARGETSUFFIX SOURCESUFFIX CROSSCOMPILE
|
|
|
+export OS_TARGET OS_SOURCE ARCH CPU_TARGET CPU_SOURCE SUB_TARGET SUB_SOURCE FULL_TARGET FULL_SOURCE TARGETSUFFIX SOURCESUFFIX CROSSCOMPILE CPU_OS_TARGET CPU_OS_SOURCE
|
|
|
|
|
|
[fpmakefpcdetect]
|
|
|
#####################################################################
|