From bb55beef914e7488350ad1d0419d4bc60ad63c99 Mon Sep 17 00:00:00 2001 From: Alex AUVOLAT Date: Fri, 28 Mar 2014 09:10:23 +0100 Subject: Import code for article1, 2, 3, 4 --- sos-code-article4/Makefile | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 sos-code-article4/Makefile (limited to 'sos-code-article4/Makefile') diff --git a/sos-code-article4/Makefile b/sos-code-article4/Makefile new file mode 100644 index 0000000..3a2282a --- /dev/null +++ b/sos-code-article4/Makefile @@ -0,0 +1,45 @@ +CC=gcc +CFLAGS = -Wall -nostdlib -nostdinc -ffreestanding -DKERNEL_SOS +LDFLAGS = --warn-common +OBJECTS = bootstrap/multiboot.o \ + hwcore/idt.o hwcore/gdt.o \ + hwcore/exception.o hwcore/exception_wrappers.o \ + hwcore/irq.o hwcore/irq_wrappers.o hwcore/i8259.o \ + hwcore/paging.o \ + hwcore/i8254.o drivers/x86_videomem.o drivers/bochs.o \ + sos/physmem.o sos/klibc.o sos/main.o + +KERNEL_OBJ = sos.elf +MULTIBOOT_IMAGE = fd.img +PWD := $(shell pwd) + +# Main target +all: $(MULTIBOOT_IMAGE) + +$(MULTIBOOT_IMAGE): $(KERNEL_OBJ) + ./support/build_image.sh $@ $< + +$(KERNEL_OBJ): $(OBJECTS) ./support/sos.lds + $(LD) $(LDFLAGS) -T ./support/sos.lds -o $@ $(OBJECTS) + -nm -C $@ | cut -d ' ' -f 1,3 > sos.map + +-include .mkvars + +# Create objects from C source code +%.o: %.c + $(CC) -I$(PWD) -c $< $(CFLAGS) -o $@ + +# Create objects from assembler (.S) source code +%.o: %.S + $(CC) -I$(PWD) -c $< $(CFLAGS) -DASM_SOURCE=1 -o $@ + +# Clean directory +clean: + $(RM) *.img *.o mtoolsrc *~ menu.txt *.img *.elf *.bin *.map + $(RM) *.log *.out bochs* + $(RM) bootstrap/*.o bootstrap/*~ + $(RM) drivers/*.o drivers/*~ + $(RM) hwcore/*.o hwcore/*~ + $(RM) sos/*.o sos/*~ + $(RM) support/*~ + $(RM) extra/*~ -- cgit v1.2.3