From efdacaf589ffb5138ec02fc15bcef64e04a689b3 Mon Sep 17 00:00:00 2001 From: Werner Almesberger Date: Thu, 19 Aug 2010 01:11:14 -0300 Subject: [PATCH] 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 --- fw/common/Makefile.common | 36 +++++++++++++++++++++++++++++++++--- 1 file changed, 33 insertions(+), 3 deletions(-) diff --git a/fw/common/Makefile.common b/fw/common/Makefile.common index 03e5968..4abb04d 100644 --- a/fw/common/Makefile.common +++ b/fw/common/Makefile.common @@ -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