2010-09-20 22:28:22 +02:00
|
|
|
# Hey Emacs, this is a -*- makefile -*-
|
|
|
|
|
|
|
|
CFLAGS += -I$(MC1322X)/src
|
|
|
|
|
|
|
|
ISR ?= $(MC1322X)/src/isr.o
|
|
|
|
SRC_OBJS += $(MC1322X)/src/default_lowlevel.o $(ISR)
|
|
|
|
|
|
|
|
# Two libraries, one with ROM variable space reserved, one without
|
|
|
|
START_ROMVARS ?= $(MC1322X)/src/start-romvars.o
|
|
|
|
SRCLIB_ROMVARS = $(MC1322X)/src/src-romvars.a
|
2010-09-28 21:48:57 +02:00
|
|
|
$(SRCLIB_ROMVARS): $(SRC_OBJS) $(START_ROMVARS)
|
|
|
|
$(call pretty,AR,$@)
|
|
|
|
@rm -f $@
|
|
|
|
$Q$(AR) $(ARFLAGS) $@ $^
|
2010-09-20 22:28:22 +02:00
|
|
|
|
|
|
|
START ?= $(MC1322X)/src/start.o
|
|
|
|
SRCLIB = $(MC1322X)/src/src.a
|
2010-09-28 21:48:57 +02:00
|
|
|
$(SRCLIB): $(SRC_OBJS) $(START)
|
|
|
|
$(call pretty,AR,$@)
|
|
|
|
@rm -f $@
|
|
|
|
$Q$(AR) $(ARFLAGS) $@ $^
|
2010-09-20 22:28:22 +02:00
|
|
|
|
|
|
|
# ISR is built without thumb
|
|
|
|
$(ISR): $(ISR:.o=.c)
|
2010-09-25 00:21:29 +02:00
|
|
|
$(call pretty,CC (isr),$@)
|
|
|
|
$Q$(CC) $(CFLAGS) -MMD -c -o $@ $<
|
2010-09-20 22:28:22 +02:00
|
|
|
@$(FINALIZE_DEPENDENCY)
|
|
|
|
|
|
|
|
# start-romvars.o is built from start.S with the right flags
|
|
|
|
$(MC1322X)/src/start-romvars.o: $(MC1322X)/src/start.S
|
2010-09-25 00:21:29 +02:00
|
|
|
$(call pretty,CC (romvars),$@)
|
|
|
|
$Q$(CC) $(AFLAGS) -MMD -DUSE_ROM_VARS -c -o $@ $<
|
2010-09-20 22:28:22 +02:00
|
|
|
@$(FINALIZE_DEPENDENCY)
|
|
|
|
|
|
|
|
ifneq ($(MAKECMDGOALS),clean)
|
|
|
|
-include $(wildcard $(MC1322X)/src/*.d)
|
|
|
|
endif
|
|
|
|
|
|
|
|
clean::
|
|
|
|
rm -f $(MC1322X)/src/*.{o,d,a}
|
|
|
|
|