summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Moffett <ian@osmora.org>2024-07-22 12:11:19 -0400
committerIan Moffett <ian@osmora.org>2024-07-22 12:11:19 -0400
commitdddc89fc5cf64bd087ff1f43a51850659ae4cd32 (patch)
tree2c68a14aa8c4d7673cf2fe7aa2840b05b2647fb7
parent71ccd7528fa4380b146e71040d9bc246f8a5d82b (diff)
build: Improve copying of headers
- Ensure headers are always copied - Ensure lib/libc/include/*.h are copied Signed-off-by: Ian Moffett <ian@osmora.org>
-rw-r--r--Makefile.in2
-rw-r--r--lib/libc/Makefile10
2 files changed, 8 insertions, 4 deletions
diff --git a/Makefile.in b/Makefile.in
index aeb6911..01fe328 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -74,7 +74,7 @@ base:
mkdir -p base/usr/sbin/
mkdir -p base/boot/
mkdir -p base/usr/include/sys/
- cp sys/include/sys/*.h base/usr/include/sys/
+ cp -f sys/include/sys/*.h base/usr/include/sys/
.PHONY: cross
cross:
diff --git a/lib/libc/Makefile b/lib/libc/Makefile
index af91a87..7ae6bd9 100644
--- a/lib/libc/Makefile
+++ b/lib/libc/Makefile
@@ -5,11 +5,9 @@ LIBC_ASMFILES = $(shell find src/ -name "*.S")
LIBC_OBJ = $(LIBC_CFILES:.c=.o)
LIBC_ASMOBJ = $(LIBC_ASMFILES:.S=.S.o)
-all: $(LIBC_ASMOBJ) $(LIBC_OBJ) build/libc.a
+all: headers $(LIBC_ASMOBJ) $(LIBC_OBJ) build/libc.a
build/libc.a: build/
- mkdir -p include/sys/
- cp -f $(USRDIR)/include/sys/*.h include/sys
ar rcs build/libc.a $(LIBC_OBJ) $(LIBC_ASMOBJ)
%.o: %.c
@@ -18,6 +16,12 @@ build/libc.a: build/
%.S.o: %.S
$(CC) $(CFLAGS) -Iinclude/ $< -o $@
+.PHONY: headers
+headers:
+ mkdir -p include/sys/
+ cp -f $(USRDIR)/include/sys/*.h include/sys
+ cp -f include/*.h $(USRDIR)/include/
+
.PHONY:
build/:
mkdir -p build/