]> git.karo-electronics.de Git - oswald.git/blobdiff - metawatch/Makefile
Add version information and info screen, some more work on the accel screen
[oswald.git] / metawatch / Makefile
index e2302113dfa9e578aa4be96c856eca2ae1b341bc..70a7775fae64e59181cf3400378443366d431933 100644 (file)
@@ -17,10 +17,10 @@ MEMMODEL   = -mmemory-model=huge -fdata-sections -ffunction-sections # -mdata-re
 # MEMMODEL   = -mmemory-model=medium -misr20
 #MEMMODEL   = -mmemory-model=medium
 
-#APPCONFIG = -DDIGITAL -DMW_DEVBOARD_V2
+APPCONFIG = -DDIGITAL -DMW_DEVBOARD_V2
 #APPCONFIG = -DDIGITAL -DMW_DEVBOARD_V2 -DWITH_BTSTACK
 #APPCONFIG = -DDIGITAL -DMW_DEVBOARD_V2 -DCC256x_TRANSP
-APPCONFIG = -DDIGITAL -DMW_DIGITAL_V2
+#APPCONFIG = -DDIGITAL -DMW_DIGITAL_V2
 
 # List all the source files here
 # eg if you have a source file foo.c then list it here
@@ -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