[hackers] [scc] [libc] Add support for multisystem || Roberto E. Vargas Caballero

From: <git_AT_suckless.org>
Date: Wed, 8 Mar 2017 14:51:13 +0100 (CET)

commit b2548524277b4e64afb2f4cc3fc19f4993f7e3b6
Author: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
AuthorDate: Wed Mar 8 10:34:16 2017 +0100
Commit: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
CommitDate: Wed Mar 8 14:49:21 2017 +0100

    [libc] Add support for multisystem
    
    We need the system because with only the abi is not enough
    for library.

diff --git a/config.mk b/config.mk
index bf253f0..28ae830 100644
--- a/config.mk
+++ b/config.mk
_AT_@ -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
index 01e6a7c..ff9ff86 100644
--- a/libc/src/Makefile
+++ b/libc/src/Makefile
_AT_@ -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 \
_AT_@ -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) $_AT_ $?
         ranlib $_AT_
 
 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
index eceec52..b930527 100644
--- a/libc/src/sys/amd64-linux/Makefile
+++ b/libc/src/sys/amd64-linux/Makefile
_AT_@ -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 $_AT_
 
-$(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
new file mode 100644
index 0000000..7835082
--- /dev/null
+++ b/libc/src/sys/amd64-linux/system.mk
_AT_@ -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
Received on Wed Mar 08 2017 - 14:51:13 CET

This archive was generated by hypermail 2.3.0 : Wed Mar 08 2017 - 15:00:35 CET