From e9f5935d484f6ca63f7a3125de7ddeed6d1ad1aa Mon Sep 17 00:00:00 2001 From: Michael Shaw Date: Tue, 13 Feb 2024 14:16:07 -0500 Subject: [PATCH] Makefile: change usr.bin build system --- Makefile | 5 +++-- usr.bin/Makefile | 24 ------------------------ usr.bin/ftest/Makefile | 2 +- usr.bin/make.sh | 5 +++++ 4 files changed, 9 insertions(+), 27 deletions(-) delete mode 100644 usr.bin/Makefile create mode 100755 usr.bin/make.sh diff --git a/Makefile b/Makefile index ca96a04..72c74d1 100644 --- a/Makefile +++ b/Makefile @@ -46,7 +46,7 @@ HEADER_DEPS := $(CFILES:.c=.d) $(ASFILES:.S=.d) all: $(KERNEL) $(KERNEL): $(OBJ) linker.ld - @$(MAKE) --no-print-directory -C usr.bin -j1 + @cd usr.bin && ./make.sh install @$(LD) $(OBJ) $(LDFLAGS) -o $@ @echo " LD $@" @@ -64,7 +64,8 @@ $(KERNEL): $(OBJ) linker.ld clean: @rm -rf $(KERNEL) $(OBJ) $(HEADER_DEPS) bin @echo " CLEAN kernel" - @$(MAKE) --no-print-directory -C usr.bin clean + @cd usr.bin && ./make.sh clean + @echo " CLEAN usr.bin" .PHONY: distclean distclean: clean diff --git a/usr.bin/Makefile b/usr.bin/Makefile deleted file mode 100644 index c8857fb..0000000 --- a/usr.bin/Makefile +++ /dev/null @@ -1,24 +0,0 @@ -# SPDX-License-Identifier: GPL-2.0-only - -# usr.bin/Makefile -# -# Compile all user programs. - -UPRG := test1 ftest vfs -UPRGCLEAN := $(addsuffix clean,$(UPRG)) -UPRGBUILD := $(addsuffix build,$(UPRG)) -UPRGINSTALL := $(addsuffix install,$(UPRG)) - -all: $(UPRGBUILD) $(UPRGINSTALL) - -%build: % - @$(MAKE) --no-print-directory -C $< & - -clean: $(UPRGCLEAN) -%clean: % - @$(MAKE) -C $< clean - @echo " CLEAN usr.bin/$<" - -%install: % - @mkdir -p ../bin - @$(MAKE) --no-print-directory -C $< install diff --git a/usr.bin/ftest/Makefile b/usr.bin/ftest/Makefile index ea4cbc9..def76f0 100644 --- a/usr.bin/ftest/Makefile +++ b/usr.bin/ftest/Makefile @@ -1,4 +1,4 @@ -# SPDX-License-Identifier: GPL-2.0-only + CC := x86_64-elf-gcc LD := x86_64-elf-ld diff --git a/usr.bin/make.sh b/usr.bin/make.sh new file mode 100755 index 0000000..9fff20a --- /dev/null +++ b/usr.bin/make.sh @@ -0,0 +1,5 @@ +usrprog=('ftest' 'test1' 'vfs') + +for prog in ${usrprog[@]}; do + make -C $prog $1 --no-print-directory +done