borgware-2d/rules.mk

47 lines
1.2 KiB
Makefile
Raw Normal View History

2008-12-03 13:22:20 +00:00
##############################################################################
# rules for buildung AVR objects
OBJECTS += $(patsubst %.c,obj_avr/%.o,${SRC})
OBJECTS += $(patsubst %.S,obj_avr/%.o,${ASRC})
./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 13:22:20 +00:00
objects_avr: $(OBJECTS)
@ 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
clean-common:
$(RM) $(TARGET) *.[odasE] *.d.new *~
$(RM) -r obj_avr
$(RM) -r obj_sim
clean: clean-common
all:
2012-12-27 16:55:13 +00:00
$(MAKE) -C $(TOPDIR) all
#include depend.mk