]> git.karo-electronics.de Git - oswald.git/blobdiff - metawatch/Makefile
Some documentation hints
[oswald.git] / metawatch / Makefile
index e2302113dfa9e578aa4be96c856eca2ae1b341bc..583ccb13520091de31996481b21f244f6623f845 100644 (file)
@@ -22,12 +22,12 @@ MEMMODEL   = -mmemory-model=huge -fdata-sections -ffunction-sections # -mdata-re
 #APPCONFIG = -DDIGITAL -DMW_DEVBOARD_V2 -DCC256x_TRANSP
 APPCONFIG = -DDIGITAL -DMW_DIGITAL_V2
 
-# List all the source files here
-# eg if you have a source file foo.c then list it here
-
 BTCC256x_SCRIPT = bluetooth_init_cc2560_2.44.c
 #BTCC256x_SCRIPT = bluetooth_init_cc2564_2.8.c
 
+# List all the source files here
+# eg if you have a source file foo.c then list it here
+
 OSWALD_SRC = ../ui/oswald_main.c ../ui/oswald_screens.c \
        ../ui/oswald_watch_faces.c \
        ../ui/oswald_strings.c ../ui/calendar.c \
@@ -48,9 +48,12 @@ SOURCES = mw_main.c mw_uart.c mw_lcd.c mw_adc.c mw_bt.c \
 #INCLUDES = $(BT_SMALLTOOTH_INV)
 INCLUDES = -I../ui/
 
+# BUILDNO = \"\#$(shell cat .buildno)-$(shell date +%y%m%d)\"
+BUILDNO = \"$(shell date +%y%m%d)-\#$(shell cat .buildno)\"
+
 # Add or subtract whatever MSPGCC flags you want. There are plenty more
 #######################################################################################
-CFLAGS   = -mmcu=$(MCU) $(MEMMODEL) -g -Os -Wall -Wunused $(INCLUDES) $(APPCONFIG)
+CFLAGS   = -mmcu=$(MCU) $(MEMMODEL) -g -Os -Wall -Wunused $(INCLUDES) $(APPCONFIG) -DBUILDNO=$(BUILDNO)
 ASFLAGS  = -mmcu=$(MCU) $(MEMMODEL) -x assembler-with-cpp -Wa,-gstabs
 LDFLAGS  = -mmcu=$(MCU) $(MEMMODEL) -Wl,-gc-sections -Wl,-Map=$(TARGET).map
 ########################################################################################
@@ -76,7 +79,7 @@ DEPEND = $(SOURCES:.c=.d)
 # all the object files
 OBJECTS = $(SOURCES:.c=.o)
 
-all: $(TARGET).elf $(TARGET).hex $(TARGET).txt 
+all: .buildno $(TARGET).elf $(TARGET).hex $(TARGET).txt
 
 prog: $(TARGET).hex
        mspdebug tilib -d /dev/ttyACM3 -v 2500 "prog $(TARGET).hex"
@@ -126,3 +129,7 @@ clean:
        -$(RM) $(TARGET).*
        -$(RM) $(SOURCES:.c=.lst)
        -$(RM) $(DEPEND)
+
+.buildno: $(OBJECTS)
+       @if ! test -f .buildno; then echo 0 > .buildno; fi
+       @echo $$(($$(cat .buildno) + 1)) > .buildno