commit 43ee14f992b220a888e32a73ef7062c9a2c0892b
parent 2f6204fc7d4ae7434dc79322254f323c8e73a7cf
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date: Tue, 14 Sep 2021 17:26:51 +0200
libc: Fix BSD systems
BSD systems have common behaviour and some code can be
refactored in a common place instead of having duplicates
in every system directory. The bad part is that it
generates dummy makefiles in the system directories but
it is not a big problem.
Diffstat:
6 files changed, 39 insertions(+), 3 deletions(-)
diff --git a/src/libc/arch/Makefile b/src/libc/arch/Makefile
@@ -1,16 +1,31 @@
.POSIX:
+PROJECTDIR = ../../..
+
DIRS =\
amd64\
arm64\
arm\
+ darwin\
+ dragonfly\
i386\
+ linux\
+ netbsd\
+ openbsd\
+ posix\
ppc\
-PROJECTDIR =../../..
+BSD =\
+ netbsd\
+ openbsd\
+ darwin\
+ dragonfly\
+
include $(PROJECTDIR)/scripts/rules.mk
include ../rules.mk
-NODEP = 1
+all: $(ARCH) $(SYS)
+
+linux: posix
-all: $(ARCH)
+$(BSD): bsd
diff --git a/src/libc/arch/darwin/Makefile b/src/libc/arch/darwin/Makefile
@@ -7,3 +7,5 @@ OBJS=\
_getheap.$O\
all: $(OBJS)
+
+include deps.mk
diff --git a/src/libc/arch/darwin/deps.mk b/src/libc/arch/darwin/deps.mk
@@ -0,0 +1 @@
+#deps
diff --git a/src/libc/arch/dragonfly/Makefile b/src/libc/arch/dragonfly/Makefile
@@ -0,0 +1,6 @@
+.POSIX:
+PROJECTDIR = ../../../..
+include $(PROJECTDIR)/scripts/rules.mk
+include ../../rules.mk
+
+NODEP = 1
diff --git a/src/libc/arch/netbsd/Makefile b/src/libc/arch/netbsd/Makefile
@@ -0,0 +1,6 @@
+.POSIX:
+PROJECTDIR = ../../../..
+include $(PROJECTDIR)/scripts/rules.mk
+include ../../rules.mk
+
+NODEP = 1
diff --git a/src/libc/arch/openbsd/Makefile b/src/libc/arch/openbsd/Makefile
@@ -0,0 +1,6 @@
+.POSIX:
+PROJECTDIR = ../../../..
+include $(PROJECTDIR)/scripts/rules.mk
+include ../../rules.mk
+
+NODEP = 1