2010-02-22 00:47:12 +01:00
|
|
|
LINKERSCRIPT = $(MC1322X)/mc1322x.lds
|
|
|
|
LIBMC1322X = $(MC1322X)/libmc1322x
|
2010-02-21 23:34:27 +01:00
|
|
|
|
2010-02-22 00:47:12 +01:00
|
|
|
include $(MC1322X)/config.mk
|
2010-02-21 23:34:27 +01:00
|
|
|
|
2010-02-22 00:47:12 +01:00
|
|
|
include $(MC1322X)/board/Makefile.board
|
|
|
|
|
|
|
|
include $(MC1322X)/libmc1322x/Makefile.lib
|
2010-02-21 23:34:27 +01:00
|
|
|
|
2010-02-22 18:19:39 +01:00
|
|
|
# default start and isr
|
|
|
|
ifndef START
|
|
|
|
START = $(MC1322X)/src/start.o
|
|
|
|
endif
|
|
|
|
ifndef ISR
|
|
|
|
ISR = $(MC1322X)/src/isr.o
|
|
|
|
endif
|
|
|
|
|
2010-02-21 23:34:27 +01:00
|
|
|
ARCH = arm
|
|
|
|
CPU = arm7tdmi-s
|
|
|
|
export ARCH CPU VENDOR
|
|
|
|
|
2010-02-22 18:19:39 +01:00
|
|
|
%.s: %.S
|
|
|
|
$(CPP) $(AFLAGS) -o $@ $(CURDIR)/$<
|
|
|
|
%.o: %.S
|
|
|
|
$(CC) $(AFLAGS) -c -o $@ $(CURDIR)/$<
|
|
|
|
%.o: %.c
|
|
|
|
$(CC) $(CFLAGS) $(THUMB_FLAGS) -c -o $@ $<
|
2010-02-21 23:34:27 +01:00
|
|
|
|
2010-02-22 18:19:39 +01:00
|
|
|
$(ISR): $(ISR:.o=.c)
|
|
|
|
$(CC) $(CFLAGS) $(ARM_FLAGS) $< -c -o $@
|
2010-02-21 23:34:27 +01:00
|
|
|
|
2010-02-22 18:19:39 +01:00
|
|
|
%.elf: $(START) $(ISR) %.o $(LINKERSCRIPT)
|
|
|
|
$(LD) $(LDFLAGS) $(AOBJS) \
|
|
|
|
--start-group $(PLATFORM_LIBS) --end-group \
|
|
|
|
$(filter %.o %.a,$+) -o $@
|
2010-02-21 23:34:27 +01:00
|
|
|
|
|
|
|
clean:
|
2010-02-22 18:24:56 +01:00
|
|
|
find $(MC1322X) -type f \
|
2010-02-21 23:34:27 +01:00
|
|
|
\( -name 'core' -o -name '*.bak' -o -name '*~' \
|
2010-02-22 18:24:56 +01:00
|
|
|
-o -name '*.o' -o -name '*.a' -o -name '*.obj' -o -name '*.elf' \) -print \
|
2010-02-21 23:34:27 +01:00
|
|
|
| xargs rm -f
|
2010-02-22 18:24:56 +01:00
|
|
|
rm -fr *.*~
|
2010-02-21 23:34:27 +01:00
|
|
|
|
2010-02-22 18:24:56 +01:00
|
|
|
clobber \
|
2010-02-21 23:34:27 +01:00
|
|
|
mrproper \
|
2010-02-22 18:24:56 +01:00
|
|
|
distclean: clean
|