1
0
mirror of git://projects.qi-hardware.com/f32xbase.git synced 2024-11-27 17:56:16 +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 all: $(MAIN).bin
# ----- automatic build version information -----------------------------------
version version.h: version version.h:
@if [ -f .version ]; then \ @if [ -f .version ]; then \
v=`cat .version`; \ v=`cat .version`; \
@ -54,6 +58,10 @@ version version.h:
version.rel: version version.rel: version
# ----- build rules -----------------------------------------------------------
$(MAIN).ihx: $(OBJS:%=%.rel) $(MAIN).ihx: $(OBJS:%=%.rel)
$(GEN) $(CC_normal) $(CFLAGS) $(LDFLAGS) $(OBJS:%=%.rel) $(GEN) $(CC_normal) $(CFLAGS) $(LDFLAGS) $(OBJS:%=%.rel)
@ -67,6 +75,10 @@ $(MAIN).ihx: $(OBJS:%=%.rel)
.c.rel: .c.rel:
$(CC) $(CFLAGS) -c $< $(CC) $(CFLAGS) -c $<
# ----- dependencies ----------------------------------------------------------
# below, set dummy UART speed to make dependencies build without error # below, set dummy UART speed to make dependencies build without error
depend .depend: depend .depend:
@ -82,14 +94,32 @@ ifeq (.depend,$(wildcard .depend))
include .depend include .depend
endif 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: clean:
rm -f $(OBJS:%=%.rel) rm -f $(OBJS:%=%.rel)
rm -f $(OBJS:%=%.asm) $(OBJS:%=%.lst) rm -f $(OBJS:%=%.asm) $(OBJS:%=%.lst)
rm -f $(OBJS:%=%.rst) $(OBJS:%=%.sym) rm -f $(OBJS:%=%.rst) $(OBJS:%=%.sym)
rm -f $(MAIN).ihx $(MAIN).lnk $(MAIN).map $(MAIN).mem rm -f $(MAIN).ihx $(MAIN).lnk $(MAIN).map $(MAIN).mem
# ----- spotless --------------------------------------------------------------
spotless: clean spotless: clean
rm -f $(MAIN).bin .depend rm -f $(MAIN).bin .depend
upload:
ssh lab neo 'cat \>$(MAIN).bin' <$(MAIN).bin