Add sw makefile which compiles all subtargets

Usefull now that we have like 4 different folders that need to be
compiled slightly differently
This commit is contained in:
Byron Lathi
2022-04-18 20:27:05 -05:00
parent 72b83d739d
commit 0fadc6a80f

View File

@@ -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)
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 $@