altos: always rebuild ao_product.c to track git version
authorKeith Packard <keithp@keithp.com>
Thu, 26 Aug 2010 22:57:09 +0000 (15:57 -0700)
committerKeith Packard <keithp@keithp.com>
Thu, 26 Aug 2010 22:57:09 +0000 (15:57 -0700)
The git version is built into ao_product.c and saved in eeprom log
files, providing useful diagnostics about the firmware revision used
for each flight. However, if ao_product.c isn't recompiled, then the
updated version won't be included. Force recompilation of this file
each time make is run to ensure that the final output contains an
updated version number.

Signed-off-by: Keith Packard <keithp@keithp.com>
src/Makefile.proto

index 8bc8b0e174fc2008f5ac36e4e49bff26a0041dba..59a3b8a616d7969a80f0ba24f12f85703aa6b6a3 100644 (file)
@@ -214,9 +214,11 @@ all: ../$(PROG)
 ../altitude.h: make-altitude
        nickle $< > $@
 
 ../altitude.h: make-altitude
        nickle $< > $@
 
-ao_product.h: ao-make-product.5c
+ao_product.h: ao-make-product.5c always
        $(call quiet,NICKLE,$<) $< -m altusmetrum.org -i $(IDPRODUCT) -p $(PRODUCT) -v $(VERSION) > $@
 
        $(call quiet,NICKLE,$<) $< -m altusmetrum.org -i $(IDPRODUCT) -p $(PRODUCT) -v $(VERSION) > $@
 
+always:
+
 ao_product.rel: ao_product.c ao_product.h
        $(call quiet,CC) -c $(CFLAGS) -D PRODUCT_DEFS='\"ao_product.h\"' -o$@ $<
 
 ao_product.rel: ao_product.c ao_product.h
        $(call quiet,CC) -c $(CFLAGS) -D PRODUCT_DEFS='\"ao_product.h\"' -o$@ $<