From 0fadc6a80f728a97cf3c835420e61349aae75ffa Mon Sep 17 00:00:00 2001 From: Byron Lathi Date: Mon, 18 Apr 2022 20:27:05 -0500 Subject: [PATCH] Add sw makefile which compiles all subtargets Usefull now that we have like 4 different folders that need to be compiled slightly differently --- sw/Makefile | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/sw/Makefile b/sw/Makefile index 57f62b1..d362cdb 100644 --- a/sw/Makefile +++ b/sw/Makefile @@ -1,9 +1,22 @@ -TOPTARGETS := all clean +.PHONY: all install bios bootloader kernel clean -SUBDIRS := $(wildcard */.) +all: bios bootloader kernel -$(TOPTARGETS): $(SUBDIRS) -$(SUBDIRS): - $(MAKE) -C $@ $(MAKECMDGOALS) +install: all + sh script/format_disk.sh + sh script/copy_files.sh -.PHONY: $(TOPTARGETS) $(SUBDIRS) \ No newline at end of file +bios: + @$(MAKE) -C bios + +bootloader: + @$(MAKE) -C bootloader + +kernel: + @$(MAKE) -C kernel + + +clean: + @$(MAKE) -C bios --no-print-directory $@ + @$(MAKE) -C bootloader --no-print-directory $@ + @$(MAKE) -C kernel --no-print-directory $@ \ No newline at end of file