shithub: scc

Download patch

ref: c34552e1586a5d7069296b343444ac29c2507e66
parent: dd4c403f9a3e673c0d233ba39c20960f11b104df
author: Quentin Rameau <quinq@fifth.space>
date: Mon Mar 13 09:01:02 EDT 2017

[libc] Fix amd64 and i386 target name

diff: cannot open b/libc/src/sys/amd64-sysv-linux//null: file does not exist: 'b/libc/src/sys/amd64-sysv-linux//null' diff: cannot open b/libc/src/sys/i386-sysv-linux//null: file does not exist: 'b/libc/src/sys/i386-sysv-linux//null'
--- a/libc/src/sys/amd64-linux/Makefile
+++ /dev/null
@@ -1,21 +1,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
--- a/libc/src/sys/amd64-linux/syscall.awk
+++ /dev/null
@@ -1,4 +1,0 @@
-/^#/	{next}
-	{name=$2 ".s"
-	 printf "%s:\n\tmov\t%d,%%rax\n\tsyscall\n\tret\n",$2, $1 > name
-	 close(name)}
--- a/libc/src/sys/amd64-linux/syscall.lst
+++ /dev/null
@@ -1,11 +1,0 @@
-#number	name
-0	_read
-1	_write
-2	_open
-3	_close
-3	_lseek
-12	_brk
-13	_rt_sigaction
-38	_getpid
-60	_Exit
-32	_kill
--- /dev/null
+++ b/libc/src/sys/amd64-sysv-linux/Makefile
@@ -1,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
--- /dev/null
+++ b/libc/src/sys/amd64-sysv-linux/syscall.awk
@@ -1,0 +1,4 @@
+/^#/	{next}
+	{name=$2 ".s"
+	 printf "%s:\n\tmov\t%d,%%rax\n\tsyscall\n\tret\n",$2, $1 > name
+	 close(name)}
--- /dev/null
+++ b/libc/src/sys/amd64-sysv-linux/syscall.lst
@@ -1,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
--- /dev/null
+++ b/libc/src/sys/i386-sysv-linux/Makefile
@@ -1,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