Merge pull request #4 from avpatel/master

Minor refactor in build process to support adding of new board directories under ARMv7a
This commit is contained in:
Kelvin Lawson
2011-07-31 05:44:15 -07:00
2 changed files with 6 additions and 2 deletions

View File

@@ -13,8 +13,12 @@ endif
src_dir=$(CURDIR)
# Configuration
ifndef CPU
CPU=cortex-a8
endif
ifndef BOARD
BOARD=pb-a8
endif
CC=$(CROSS_COMPILE)gcc
OBJCOPY=$(CROSS_COMPILE)objcopy
# Enable stack-checking. WARNING: the full automated test suite currently
@@ -107,10 +111,10 @@ $(build_dir)/%.bin: $(build_dir)/%.elf
$(if $(V), @echo " (OBJCOPY) $(subst $(build_dir)/,,$@)")
$(V)$(OBJCOPY) -O binary $< $@
$(build_dir)/%.elf: $(build_dir)/%.o $(build_objs)
$(build_dir)/%.elf: $(build_dir)/%.o $(build_objs) $(board_dir)/linker.ld
$(V)mkdir -p `dirname $@`
$(if $(V), @echo " (ELF) $(subst $(build_dir)/,,$@)")
$(V)$(CC) $(CFLAGS) $(build_objs) $< -static-libgcc -lgcc -Wl -T linker.ld -o $@
$(V)$(CC) $(CFLAGS) $(build_objs) $< -static-libgcc -lgcc -Wl -T $(board_dir)/linker.ld -o $@
$(build_dir)/%.o: $(src_dir)/%.S
$(V)mkdir -p `dirname $@`