this is working kind of correctly.

need to clean it up, get the different boards going and add in the lib
build.
This commit is contained in:
Mariano Alvira 2010-02-22 12:19:39 -05:00
parent 1759ff01a0
commit 4a77cb7d76
3 changed files with 25 additions and 16 deletions

View File

@ -7,18 +7,33 @@ include $(MC1322X)/board/Makefile.board
include $(MC1322X)/libmc1322x/Makefile.lib
# default start and isr
ifndef START
START = $(MC1322X)/src/start.o
endif
ifndef ISR
ISR = $(MC1322X)/src/isr.o
endif
ARCH = arm
CPU = arm7tdmi-s
export ARCH CPU VENDOR
$(OBJDIR)/isr.o: isr.c
%.s: %.S
$(CPP) $(AFLAGS) -o $@ $(CURDIR)/$<
%.o: %.S
$(CC) $(AFLAGS) -c -o $@ $(CURDIR)/$<
%.o: %.c
$(CC) $(CFLAGS) $(THUMB_FLAGS) -c -o $@ $<
$(ISR): $(ISR:.o=.c)
$(CC) $(CFLAGS) $(ARM_FLAGS) $< -c -o $@
%.o: %.c
$(CC) $(CFLAGS) $(THUMB_FLAGS) $< -c
$(OBJDIR)/%.o: %.c
$(CC) $(CFLAGS) $(THUMB_FLAGS) -c $< -o $@
%.elf: $(START) $(ISR) %.o $(LINKERSCRIPT)
$(LD) $(LDFLAGS) $(AOBJS) \
--start-group $(PLATFORM_LIBS) --end-group \
$(filter %.o %.a,$+) -o $@
clean:
find . -type f \

View File

@ -27,6 +27,8 @@ OBJCFLAGS += --gap-fill=0xff
gccincdir := $(shell $(CC) -print-file-name=include)
PLATFORM_LIBS += --no-warn-mismatch -L $(shell dirname `$(CC) $(CFLAGS) -print-libgcc-file-name`) -lgcc
CPPFLAGS := $(DBGFLAGS) $(OPTFLAGS) $(RELFLAGS) \
-D__KERNEL__ -DTEXT_BASE=$(TEXT_BASE) \
-fno-builtin -ffreestanding -nostdinc -isystem \
@ -37,7 +39,7 @@ CFLAGS := $(CPPFLAGS) -Wall -Wstrict-prototypes -Wcast-align -Wcast-align
AFLAGS_DEBUG := -Wa,-gstabs
AFLAGS := $(AFLAGS_DEBUG) -D__ASSEMBLY__ $(CPPFLAGS)
LDFLAGS += -T $(LINKERSCRIPT) -nostartfiles -static -Wl,-Map=$@-$(BOARD).map,-export-dynamic
LDFLAGS += -T $(LINKERSCRIPT) -nostartfiles -static #-Wl,-Map=$*-$(BOARD).map,-export-dynamic
#########################################################################
@ -46,11 +48,3 @@ export TEXT_BASE PLATFORM_CPPFLAGS PLATFORM_RELFLAGS CPPFLAGS CFLAGS AFLAGS
#########################################################################
%.s: %.S
$(CPP) $(AFLAGS) -o $@ $(CURDIR)/$<
%.o: %.S
$(CC) $(AFLAGS) -c -o $@ $(CURDIR)/$<
%.o: %.c
$(CC) $(CFLAGS) $(THUMB_FLAGS) -c -o $@ $<
#########################################################################

View File

@ -19,7 +19,7 @@ HEAP_SIZE = 1024;
PROVIDE (__executable_start = 0x00400000); . = 0x00400000;
.text :
{
*startup.o (.text)
*start.o (.text)
*(.irq)
*(.text .stub .text.* .gnu.linkonce.t.*)
/* .gnu.warning sections are handled specially by elf32.em. */