1
0
mirror of git://projects.qi-hardware.com/f32xbase.git synced 2024-11-16 19:10:17 +02:00

Add build rules to simplify platform-specific Makefiles.

- fw/common/Makefile.common: integrated object file specific build rules
  that used to live in fw/boot/
- fw/common/Makefile.common: added section titles
- fw/common/Makefile.common (upload): removed obsolete target
This commit is contained in:
Werner Almesberger 2010-08-19 01:11:14 -03:00
parent 3f5ec8aa9e
commit efdacaf589

View File

@ -38,6 +38,10 @@ endif
all: $(MAIN).bin
# ----- automatic build version information -----------------------------------
version version.h:
@if [ -f .version ]; then \
v=`cat .version`; \
@ -54,6 +58,10 @@ version version.h:
version.rel: version
# ----- build rules -----------------------------------------------------------
$(MAIN).ihx: $(OBJS:%=%.rel)
$(GEN) $(CC_normal) $(CFLAGS) $(LDFLAGS) $(OBJS:%=%.rel)
@ -67,6 +75,10 @@ $(MAIN).ihx: $(OBJS:%=%.rel)
.c.rel:
$(CC) $(CFLAGS) -c $<
# ----- dependencies ----------------------------------------------------------
# below, set dummy UART speed to make dependencies build without error
depend .depend:
@ -82,14 +94,32 @@ ifeq (.depend,$(wildcard .depend))
include .depend
endif
# ----- specific object files -------------------------------------------------
boot.rel: $(F32XBASE)/fw/boot/boot.c
$(CC) $(CFLAGS) -o $@ -c $<
usb.rel: $(F32XBASE)/fw/common/usb.c
$(CC) $(CFLAGS) -o $@ -c $<
dfu.rel: $(F32XBASE)/fw/boot/dfu.c
$(CC) $(CFLAGS) -o $@ -c $<
# ----- clean -----------------------------------------------------------------
clean:
rm -f $(OBJS:%=%.rel)
rm -f $(OBJS:%=%.asm) $(OBJS:%=%.lst)
rm -f $(OBJS:%=%.rst) $(OBJS:%=%.sym)
rm -f $(MAIN).ihx $(MAIN).lnk $(MAIN).map $(MAIN).mem
# ----- spotless --------------------------------------------------------------
spotless: clean
rm -f $(MAIN).bin .depend
upload:
ssh lab neo 'cat \>$(MAIN).bin' <$(MAIN).bin