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
This commit is contained in:
parent
bf9c7d74eb
commit
118021a0f6
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user