4a77cb7d76
need to clean it up, get the different boards going and add in the lib build.
55 lines
1.1 KiB
Text
55 lines
1.1 KiB
Text
LINKERSCRIPT = $(MC1322X)/mc1322x.lds
|
|
LIBMC1322X = $(MC1322X)/libmc1322x
|
|
|
|
include $(MC1322X)/config.mk
|
|
|
|
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
|
|
|
|
%.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 $@
|
|
|
|
%.elf: $(START) $(ISR) %.o $(LINKERSCRIPT)
|
|
$(LD) $(LDFLAGS) $(AOBJS) \
|
|
--start-group $(PLATFORM_LIBS) --end-group \
|
|
$(filter %.o %.a,$+) -o $@
|
|
|
|
clean:
|
|
find . -type f \
|
|
\( -name 'core' -o -name '*.bak' -o -name '*~' \
|
|
-o -name '*.o' -o -name '*.a' -o -name '*.obj' \) -print \
|
|
| xargs rm -f
|
|
rm -f $(ALL) $(OBJS)
|
|
|
|
clobber: clean
|
|
find . -type f \
|
|
\( -name .depend -o -name '*.srec' -o -name '*.bin' -o -name '*.dis' -o -name '*.map' -o -name '*.obj' \) \
|
|
-print \
|
|
| xargs rm -f
|
|
rm -f $(OBJS) *.bak tags TAGS
|
|
rm -fr *.*~
|
|
rm -f $(ALL)
|
|
|
|
mrproper \
|
|
distclean: clobber
|