ref: f0d96fb56be96e04d26c17a7f7bbb6f6e53ef640
parent: 9d9d7716dbc95db5e4381289debeb2c22ff0a1e9
author: Roberto E. Vargas Caballero <k0ga@shike2.com>
date: Tue Sep 14 13:26:51 EDT 2021
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.
--- 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)
-all: $(ARCH)
+linux: posix
+
+$(BSD): bsd
--- a/src/libc/arch/darwin/Makefile
+++ b/src/libc/arch/darwin/Makefile
@@ -7,3 +7,5 @@
_getheap.$O\
all: $(OBJS)
+
+include deps.mk
--- /dev/null
+++ b/src/libc/arch/darwin/deps.mk
@@ -1,0 +1,1 @@
+#deps
--- /dev/null
+++ b/src/libc/arch/dragonfly/Makefile
@@ -1,0 +1,6 @@
+.POSIX:
+PROJECTDIR = ../../../..
+include $(PROJECTDIR)/scripts/rules.mk
+include ../../rules.mk
+
+NODEP = 1
--- /dev/null
+++ b/src/libc/arch/netbsd/Makefile
@@ -1,0 +1,6 @@
+.POSIX:
+PROJECTDIR = ../../../..
+include $(PROJECTDIR)/scripts/rules.mk
+include ../../rules.mk
+
+NODEP = 1
--- /dev/null
+++ b/src/libc/arch/openbsd/Makefile
@@ -1,0 +1,6 @@
+.POSIX:
+PROJECTDIR = ../../../..
+include $(PROJECTDIR)/scripts/rules.mk
+include ../../rules.mk
+
+NODEP = 1