scc

simple C compiler
git clone git://git.2f30.org/scc
Log | Files | Refs | README | LICENSE

commit b2548524277b4e64afb2f4cc3fc19f4993f7e3b6
parent 982d310e61b0677f980b01ef4614c43ab461ec81
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Wed,  8 Mar 2017 10:34:16 +0100

[libc] Add support for multisystem

We need the system because with only the abi is not enough
for library.

Diffstat:
Mconfig.mk | 1+
Mlibc/src/Makefile | 9++++++++-
Mlibc/src/sys/amd64-linux/Makefile | 7+++++--
Alibc/src/sys/amd64-linux/system.mk | 1+
4 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/config.mk b/config.mk @@ -5,6 +5,7 @@ VERSION = 0.1 ARCHS = z80 i386-sysv amd64-sysv qbe # default architecure used in nested makefiles ARCH = qbe +SYS = linux DRIVER = posix # Can be c89 or c99 diff --git a/libc/src/Makefile b/libc/src/Makefile @@ -2,6 +2,7 @@ .POSIX: include ../../config.mk +include sys/$(ARCH)-$(SYS)/system.mk LIBCOBJ = assert.o strcpy.o strcmp.o strlen.o strchr.o \ strrchr.o strcat.o strncmp.o strncpy.o strncat.o strcoll.o \ @@ -14,11 +15,17 @@ LIBCOBJ = assert.o strcpy.o strcmp.o strlen.o strchr.o \ printf.o fprintf.o vfprintf.o \ realloc.o calloc.o malloc.o +OBJ = $(LIBCOBJ) $(SYSOBJ) + all: libc.a -libc.a: $(LIBCOBJ) +$(SYSOJB): + cd sys/$(ARCH)-$(SYS) && make all + +libc.a: $(OBJ) $(AR) $(ARFLAGS) $@ $? ranlib $@ clean: rm -f *.o libc.a + cd sys/$(ARCH)-$(SYS) && make clean diff --git a/libc/src/sys/amd64-linux/Makefile b/libc/src/sys/amd64-linux/Makefile @@ -9,12 +9,15 @@ OBJ_GEN = _read.o _write.o _open.o _close.o _lseek.o _brk.o\ ASM_GEN = $(OBJ_GEN:.o=.s) OBJ = $(OBJ_GEN) -all: $(OBJ) +all: $(OBJ) system.mk .s.o: $(AS) $< -o $@ -$(SRC): +system.mk: Makefile + echo '$$(SYSOBJ)' = $(OBJ) > system.mk + +$(ASM_GEN): syscall.lst awk -f syscall.awk < syscall.lst clean: diff --git a/libc/src/sys/amd64-linux/system.mk b/libc/src/sys/amd64-linux/system.mk @@ -0,0 +1 @@ +$(SYSOBJ) = _read.o _write.o _open.o _close.o _lseek.o _brk.o _rt_sigaction.o _getpid.o _Exit.o _kill.o _sbrk.o