scc

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

commit d6f97eef2009ef0d18f75ee9748581a0d8c0c66f
parent 5869868f726867caa7d35045ea773975eec30430
Author: Quentin Rameau <quinq@fifth.space>
Date:   Mon, 13 Mar 2017 13:01:02 +0100

[libc] Fix amd64 and i386 target name

Diffstat:
libc/src/sys/amd64-linux/Makefile | 21---------------------
libc/src/sys/amd64-linux/syscall.awk | 4----
libc/src/sys/amd64-linux/syscall.lst | 11-----------
libc/src/sys/amd64-sysv-linux/Makefile | 21+++++++++++++++++++++
libc/src/sys/amd64-sysv-linux/syscall.awk | 4++++
libc/src/sys/amd64-sysv-linux/syscall.lst | 11+++++++++++
libc/src/sys/i386-sysv-linux/Makefile | 33+++++++++++++++++++++++++++++++++
libc/src/sys/i386-sysv-linux/syscall.lst | 0
8 files changed, 69 insertions(+), 36 deletions(-)

diff --git a/libc/src/sys/amd64-linux/Makefile b/libc/src/sys/amd64-linux/Makefile @@ -1,21 +0,0 @@ -# See LICENSE file for copyright and license details. -.POSIX: - -include ../../../../config.mk - -OBJ_GEN = _read.o _write.o _open.o _close.o _lseek.o _brk.o\ - _rt_sigaction.o _getpid.o _Exit.o _kill.o - -ASM_GEN = $(OBJ_GEN:.o=.s) -OBJ = $(OBJ_GEN) - -all: $(OBJ) system.mk - -system.mk: Makefile - echo '$$(SYSOBJ)' = $(OBJ) > system.mk - -$(ASM_GEN): syscall.lst - awk -f syscall.awk < syscall.lst - -clean: - rm -f *.s *.o diff --git a/libc/src/sys/amd64-linux/syscall.awk b/libc/src/sys/amd64-linux/syscall.awk @@ -1,4 +0,0 @@ -/^#/ {next} - {name=$2 ".s" - printf "%s:\n\tmov\t%d,%%rax\n\tsyscall\n\tret\n",$2, $1 > name - close(name)} diff --git a/libc/src/sys/amd64-linux/syscall.lst b/libc/src/sys/amd64-linux/syscall.lst @@ -1,11 +0,0 @@ -#number name -0 _read -1 _write -2 _open -3 _close -3 _lseek -12 _brk -13 _rt_sigaction -38 _getpid -60 _Exit -32 _kill diff --git a/libc/src/sys/amd64-sysv-linux/Makefile b/libc/src/sys/amd64-sysv-linux/Makefile @@ -0,0 +1,21 @@ +# See LICENSE file for copyright and license details. +.POSIX: + +include ../../../../config.mk + +OBJ_GEN = _read.o _write.o _open.o _close.o _lseek.o _brk.o\ + _rt_sigaction.o _getpid.o _Exit.o _kill.o + +ASM_GEN = $(OBJ_GEN:.o=.s) +OBJ = $(OBJ_GEN) + +all: $(OBJ) system.mk + +system.mk: Makefile + echo '$$(SYSOBJ)' = $(OBJ) > system.mk + +$(ASM_GEN): syscall.lst + awk -f syscall.awk < syscall.lst + +clean: + rm -f *.s *.o diff --git a/libc/src/sys/amd64-sysv-linux/syscall.awk b/libc/src/sys/amd64-sysv-linux/syscall.awk @@ -0,0 +1,4 @@ +/^#/ {next} + {name=$2 ".s" + printf "%s:\n\tmov\t%d,%%rax\n\tsyscall\n\tret\n",$2, $1 > name + close(name)} diff --git a/libc/src/sys/amd64-sysv-linux/syscall.lst b/libc/src/sys/amd64-sysv-linux/syscall.lst @@ -0,0 +1,11 @@ +#number name +0 _read +1 _write +2 _open +3 _close +3 _lseek +12 _brk +13 _rt_sigaction +38 _getpid +60 _Exit +32 _kill diff --git a/libc/src/sys/i386-sysv-linux/Makefile b/libc/src/sys/i386-sysv-linux/Makefile @@ -0,0 +1,33 @@ +# See LICENSE file for copyright and license details. +.POSIX: + +include ../../../../config.mk +-include system.mk +-include sysgen.mk + +GENASM = $(GENOBJ:.o=.s) +OBJ = + +all: all.bootstrap +all.start: $(SYSOBJ) + +clean: clean.bootstrap +clean.start: + rm -f *.o $(GENASM) system.mk sysgen.mk + +all.bootstrap clean.bootstrap: system.mk sysgen.mk + $(MAKE) -e $(@:%.bootstrap=%.start) + +system.mk: Makefile syscall.lst + printf '%s ' 'SYSOBJ =' \ + "$$(awk '/^#/{next}{printf "%s.o ", $$2}' syscall.lst)" \ + $(OBJ) \ + > $@ + +sysgen.mk: syscall.lst + printf '%s ' 'GENOBJ =' \ + "$$(awk '/^#/{next}{printf "%s.o ", $$2}' syscall.lst)" \ + > $@ + +$(GENASM): syscall.lst + awk -f syscall.awk < syscall.lst diff --git a/libc/src/sys/i386-sysv-linux/syscall.lst b/libc/src/sys/i386-sysv-linux/syscall.lst