2008-12-03 05:40:16 +00:00
|
|
|
|
2008-12-03 13:22:20 +00:00
|
|
|
|
|
|
|
##############################################################################
|
|
|
|
# rules for buildung AVR objects
|
|
|
|
|
2008-12-03 06:10:03 +00:00
|
|
|
OBJECTS += $(patsubst %.c,obj_avr/%.o,${SRC})
|
|
|
|
OBJECTS += $(patsubst %.S,obj_avr/%.o,${ASRC})
|
2008-12-03 05:40:16 +00:00
|
|
|
|
2008-12-03 06:10:03 +00:00
|
|
|
./obj_avr/%.o: %.S
|
|
|
|
@ if [ ! -d obj_avr ]; then mkdir obj_avr ; fi
|
|
|
|
@ echo "assembling $<"
|
|
|
|
@ $(CC) -o $@ $(CPPFLAGS) $(ASFLAGS) -c $<
|
|
|
|
|
|
|
|
./obj_avr/%.o: %.c
|
|
|
|
@ if [ ! -d obj_avr ]; then mkdir obj_avr ; fi
|
|
|
|
@ echo "compiling $<"
|
|
|
|
@ $(CC) -o $@ $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -c $<
|
2008-12-03 05:40:16 +00:00
|
|
|
|
2008-12-03 13:22:20 +00:00
|
|
|
objects_avr: $(OBJECTS)
|
2011-05-23 21:29:36 +00:00
|
|
|
@ if [ -d obj_avr ]; then echo "writing object inventory" ; echo $(OBJECTS) > obj_avr/.objects ; fi
|
2008-12-03 13:22:20 +00:00
|
|
|
|
|
|
|
##############################################################################
|
|
|
|
# rules for buildung simulator objects
|
|
|
|
|
2008-12-04 03:34:55 +00:00
|
|
|
SRC_SIM ?= $(SRC)
|
2008-12-03 13:22:20 +00:00
|
|
|
OBJECTS_SIM += $(patsubst %.c,obj_sim/%.o,${SRC_SIM})
|
|
|
|
|
|
|
|
./obj_sim/%.o: %.c
|
|
|
|
@ if [ ! -d obj_sim ]; then mkdir obj_sim ; fi
|
|
|
|
@ echo "compiling $<"
|
|
|
|
@ $(HOSTCC) -o $@ $(CFLAGS_SIM) -c $<
|
|
|
|
|
|
|
|
objects_sim: $(OBJECTS_SIM)
|
|
|
|
@ echo "writing object ineventory"
|
2008-12-04 03:34:55 +00:00
|
|
|
@ if [ ! -d obj_sim ]; then mkdir obj_sim ; fi
|
|
|
|
@ echo $(OBJECTS_SIM) > obj_sim/.objects
|
2008-12-03 13:22:20 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-12-03 05:40:16 +00:00
|
|
|
clean-common:
|
|
|
|
$(RM) $(TARGET) *.[odasE] *.d.new *~
|
2008-12-03 06:10:03 +00:00
|
|
|
$(RM) -r ./obj_avr
|
2008-12-03 13:22:20 +00:00
|
|
|
$(RM) -r ./obj_sim
|
2008-12-03 05:40:16 +00:00
|
|
|
|
|
|
|
clean: clean-common
|
|
|
|
|
|
|
|
all:
|
2012-12-27 16:55:13 +00:00
|
|
|
$(MAKE) -C $(TOPDIR) all
|
2008-12-03 05:40:16 +00:00
|
|
|
|
|
|
|
include $(TOPDIR)/depend.mk
|