Corey Tabaka | 8469724 | 2009-03-26 02:32:01 -0400 | [diff] [blame] | 1 | LOCAL_DIR := $(GET_LOCAL_DIR) |
| 2 | |
| 3 | INCLUDES += \ |
| 4 | -I$(LOCAL_DIR)/include |
| 5 | |
| 6 | BOOTOBJS += \ |
| 7 | $(LOCAL_DIR)/crt0.o |
| 8 | |
| 9 | OBJS += \ |
| 10 | $(LOCAL_DIR)/arch.o \ |
| 11 | $(LOCAL_DIR)/asm.o \ |
| 12 | $(LOCAL_DIR)/cache.o \ |
| 13 | $(LOCAL_DIR)/cache-ops.o \ |
| 14 | $(LOCAL_DIR)/ops.o \ |
| 15 | $(LOCAL_DIR)/thread.o \ |
| 16 | $(LOCAL_DIR)/mmu.o \ |
| 17 | $(LOCAL_DIR)/faults.o \ |
| 18 | $(LOCAL_DIR)/descriptor.o |
| 19 | |
| 20 | # set the default toolchain to x86 elf and set a #define |
Corey Tabaka | 7e9d615 | 2009-03-30 02:49:38 -0400 | [diff] [blame] | 21 | TOOLCHAIN_PREFIX ?= i386-elf- |
Corey Tabaka | 8469724 | 2009-03-26 02:32:01 -0400 | [diff] [blame] | 22 | |
| 23 | LIBGCC := $(shell $(TOOLCHAIN_PREFIX)gcc $(CFLAGS) -print-libgcc-file-name) |
| 24 | #$(info LIBGCC = $(LIBGCC)) |
| 25 | |
Corey Tabaka | 7e9d615 | 2009-03-30 02:49:38 -0400 | [diff] [blame] | 26 | cc-option = $(shell if test -z "`$(1) $(2) -S -o /dev/null -xc /dev/null 2>&1`"; \ |
| 27 | then echo "$(2)"; else echo "$(3)"; fi ;) |
| 28 | |
| 29 | # disable SSP if the compiler supports it; it will break stuff |
| 30 | CFLAGS += $(call cc-option,$(CC),-fno-stack-protector,) |
| 31 | |
Corey Tabaka | 8469724 | 2009-03-26 02:32:01 -0400 | [diff] [blame] | 32 | # potentially generated files that should be cleaned out with clean make rule |
| 33 | GENERATED += \ |
| 34 | $(BUILDDIR)/kernel.ld |
| 35 | |
| 36 | # rules for generating the linker scripts |
| 37 | |
| 38 | $(BUILDDIR)/kernel.ld: $(LOCAL_DIR)/kernel.ld |
| 39 | @echo generating $@ |
| 40 | @$(MKDIR) |
| 41 | $(NOECHO)cp $< $@ |