scc

simple c99 compiler
git clone git://git.simple-cc.org/scc
Log | Files | Refs | README | LICENSE

commit e7e91a1f03b432341687e5ca1b8fb3ec3eb0124c
parent f34be4fb648859e6877fca6cedd18c30ed50dc33
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Sun, 18 Aug 2019 18:57:44 +0100

Add HOST variable

This variable is automatically detected by the top
level Makefile and it allows to set variables
that depend of the host system where scc is compiled.

Diffstat:
MMakefile | 1+
Mconfig/amd64-darwin.mk | 1-
Mconfig/amd64-dragonfly.mk | 1-
Mconfig/amd64-linux.mk | 1-
Mconfig/amd64-netbsd.mk | 1-
Mconfig/amd64-openbsd.mk | 1-
Mconfig/arm32-linux.mk | 1-
Mconfig/arm64-linux.mk | 1-
Aconfig/host/bsd.mk | 2++
Aconfig/host/darwin.mk | 1+
Aconfig/host/dragonfly.mk | 1+
Aconfig/host/linux.mk | 1+
Aconfig/host/netbsd.mk | 1+
Aconfig/host/openbsd.mk | 1+
Aconfig/host/unix.mk | 1+
Mscripts/rules.mk | 5+++++
16 files changed, 14 insertions(+), 7 deletions(-)

diff --git a/Makefile b/Makefile @@ -23,6 +23,7 @@ $(ENVIRON): @rm -f $@; \ trap 'r=$?;rm -f $$$$.tmp;exit $r' EXIT HUP INT QUIT TERM; \ echo PATH=$$PATH:$$PWD/$(SCRIPTDIR):. > $$$$.tmp && \ + echo HOST=`uname | tr 'A-Z' 'a-z'` >> $$$$.tmp && \ echo NM=\"$(NM)\" >> $$$$.tmp && \ echo AR=\"$(AR)\" >> $$$$.tmp && \ echo RL=\"$(RL)\" >> $$$$.tmp && \ diff --git a/config/amd64-darwin.mk b/config/amd64-darwin.mk @@ -1,4 +1,3 @@ ARCH = amd64 SYS = darwin ABI = amd64-darwin -DRIVER = posix diff --git a/config/amd64-dragonfly.mk b/config/amd64-dragonfly.mk @@ -1,4 +1,3 @@ ARCH = amd64 SYS = dragonfly ABI = amd64-posix -DRIVER = posix diff --git a/config/amd64-linux.mk b/config/amd64-linux.mk @@ -1,4 +1,3 @@ ARCH = amd64 SYS = linux ABI = amd64-posix -DRIVER = posix diff --git a/config/amd64-netbsd.mk b/config/amd64-netbsd.mk @@ -1,4 +1,3 @@ ARCH = amd64 SYS = netbsd ABI = amd64-posix -DRIVER = posix diff --git a/config/amd64-openbsd.mk b/config/amd64-openbsd.mk @@ -1,4 +1,3 @@ ARCH = amd64 SYS = openbsd ABI = amd64-posix -DRIVER = posix diff --git a/config/arm32-linux.mk b/config/arm32-linux.mk @@ -1,4 +1,3 @@ ARCH = arm32 SYS = linux ABI = arm32-posix -DRIVER = posix diff --git a/config/arm64-linux.mk b/config/arm64-linux.mk @@ -1,4 +1,3 @@ ARCH = arm64 SYS = linux ABI = arm64-posix -DRIVER = posix diff --git a/config/host/bsd.mk b/config/host/bsd.mk @@ -0,0 +1,2 @@ +DRIVER = posix +HOSTCFLAGS = -D_ISOC99_SOURCE -D_ANSI_SOURCE diff --git a/config/host/darwin.mk b/config/host/darwin.mk @@ -0,0 +1 @@ +include $(PROJECTDIR)/config/host/bsd.mk diff --git a/config/host/dragonfly.mk b/config/host/dragonfly.mk @@ -0,0 +1 @@ +include $(PROJECTDIR)/config/host/bsd.mk diff --git a/config/host/linux.mk b/config/host/linux.mk @@ -0,0 +1 @@ +DRIVER = posix diff --git a/config/host/netbsd.mk b/config/host/netbsd.mk @@ -0,0 +1 @@ +include $(PROJECTDIR)/config/host/bsd.mk diff --git a/config/host/openbsd.mk b/config/host/openbsd.mk @@ -0,0 +1 @@ +include $(PROJECTDIR)/config/host/bsd.mk diff --git a/config/host/unix.mk b/config/host/unix.mk @@ -0,0 +1 @@ +DRIVER = posix diff --git a/scripts/rules.mk b/scripts/rules.mk @@ -1,7 +1,9 @@ CONF=amd64-linux TOOL=unix +HOST=unix include $(PROJECTDIR)/config/$(CONF).mk include $(PROJECTDIR)/config/toolchain/$(TOOL).mk +include $(PROJECTDIR)/config/host/$(HOST).mk LIBDIR = $(PROJECTDIR)/lib/scc SCRIPTDIR = $(PROJECTDIR)/scripts @@ -23,6 +25,7 @@ AR = $(CROSS_COMPILE)$(ARCHIVE) SCC_CFLAGS = $(MORECFLAGS) \ $(TOOLCFLAGS) \ + $(HOSTCFLAGS) \ $(SYSCFLAGS) \ $(INCLUDE) \ -g \ @@ -30,6 +33,7 @@ SCC_CFLAGS = $(MORECFLAGS) \ SCC_LDFLAGS = $(MORELFLAGS) \ $(TOOLLDFLAGS) \ + $(HOSTLDFLAGS) \ $(SYSLDFLAGS) \ -L$(LIBDIR) \ -g \ @@ -37,6 +41,7 @@ SCC_LDFLAGS = $(MORELFLAGS) \ SCC_ASFLAGS = $(MOREASFLAGS) \ $(TOOLASFLAGS) \ + $(HOSTASFLAGS) \ $(SYSASFLAGS) \ $(ASFLAGS)