From 118021a0f68ed851e1520ebe62d39e267d20d976 Mon Sep 17 00:00:00 2001 From: josh Date: Tue, 14 Jul 2009 13:50:29 +0000 Subject: [PATCH] added Makefile commands to build a binary and an ELF kernel and do disassemble the ELF version git-svn-id: svn://anubis/hos/trunk@53 5b3e749e-e535-0410-8002-a9bb6afbdfca --- kernel/Makefile | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/kernel/Makefile b/kernel/Makefile index 2d34e68..54aba9c 100644 --- a/kernel/Makefile +++ b/kernel/Makefile @@ -2,6 +2,7 @@ export LD := i586-elf-ld export CC := i586-elf-gcc export CXX := i586-elf-g++ +export OBJDUMP := i586-elf-objdump export NASM := nasm WD := $(shell pwd) @@ -23,8 +24,13 @@ all: $(KERNEL).gz $(KERNEL).gz: $(KERNEL) gzip -c $< > $@ -$(KERNEL): $(SUBDIRS) - $(LD) $(LDFLAGS) -o $@ $(foreach subdir,$(SUBDIRS),$(subdir)/$(subdir)_all.o) $(LDLIBS) +$(KERNEL): $(KERNEL).o + $(LD) $(LDFLAGS) -o $@ $< + $(LD) $(LDFLAGS) --oformat=elf32-i386 -o $@.elf $< + $(OBJDUMP) --disassemble --source $@.elf > $@.dump + +$(KERNEL).o: $(SUBDIRS) + $(LD) -r -o $@ $(foreach subdir,$(SUBDIRS),$(subdir)/$(subdir)_all.o) $(LDLIBS) .PHONY: $(SUBDIRS) $(SUBDIRS): @@ -32,7 +38,7 @@ $(SUBDIRS): .PHONY: clean clean: $(SUBDIRS_clean) - -rm -f *~ $(KERNEL) $(KERNEL).gz + -rm -f *~ $(KERNEL) $(KERNEL).{gz,o,elf,dump,map} %.clean: $(MAKE) -C $* clean clean=1