39 lines
681 B
Makefile
39 lines
681 B
Makefile
TOPDIR := $(dir $(realpath $(lastword $(MAKEFILE_LIST))))
|
|
SYSROOTDIR := $(TOPDIR)/sysroot
|
|
TOOLSDIR := $(TOPDIR)/tools
|
|
|
|
RM = echo
|
|
|
|
SUBDIRS := boot kernel lib bin
|
|
|
|
TARGET = stupid.tar.gz floppy_boot.img
|
|
ifneq ($(OS),Windows_NT)
|
|
TARGET += stupid.iso
|
|
endif
|
|
|
|
.PHONY: all
|
|
all: $(TARGET)
|
|
|
|
GOAL:=install
|
|
clean: GOAL:=clean
|
|
|
|
.PHONY: $(SUBDIRS)
|
|
$(SUBDIRS):
|
|
@echo "📁 $@"
|
|
DESTDIR=$(SYSROOTDIR) $(MAKE) -C $@ $(GOAL)
|
|
|
|
.PHONY: stupid.iso
|
|
stupid.iso: $(SUBDIRS)
|
|
$(TOPDIR)/tools/create-iso $@ sysroot
|
|
|
|
.PHONY: stupid.tar.gz
|
|
stupid.tar.gz: $(SUBDIRS)
|
|
tar -czvf $@ sysroot
|
|
|
|
.PHONY: floppy_boot.img
|
|
floppy_boot.img:
|
|
@ echo
|
|
|
|
.PHONY: clean
|
|
clean: $(SUBDIRS)
|
|
$(RM) $(TARGET) $(SYSROOTDIR)
|