hos/kernel/Makefile
josh be17cde305 added devices and lang directories, added skeleton kio and string modules
git-svn-id: svn://anubis/hos/trunk@43 5b3e749e-e535-0410-8002-a9bb6afbdfca
2009-07-13 15:34:39 +00:00

38 lines
849 B
Makefile

export LD := i586-elf-ld
export CC := i586-elf-gcc
export CXX := i586-elf-g++
export NASM := nasm
WD := $(shell pwd)
export HOS_TOPLEVEL := $(WD)
LDSCRIPT := link.ld
KERNEL := hos
export CPPFLAGS := -I$(HOS_TOPLEVEL) -I$(HOS_TOPLEVEL)/include
export CFLAGS := -Wall -O2
export CXXFLAGS := -Wall -O2 -fno-rtti -fno-exceptions
export LDFLAGS := -T $(LDSCRIPT) -Map $(KERNEL).map
SUBDIRS := boot mm lang
SUBDIRS_clean := $(SUBDIRS:%=%.clean)
.PHONY: all
all: $(KERNEL).gz
$(KERNEL).gz: $(KERNEL)
gzip -c $< > $@
$(KERNEL): $(SUBDIRS)
$(LD) $(LDFLAGS) -o $@ $(foreach subdir,$(SUBDIRS),$(subdir)/$(subdir)_all.o)
.PHONY: $(SUBDIRS)
$(SUBDIRS):
$(MAKE) -C $@ SUBDIR=$@
.PHONY: clean
clean: $(SUBDIRS_clean)
-rm -f *~ $(KERNEL) $(KERNEL).gz
%.clean:
$(MAKE) -C $* clean clean=1