File: buildnumber.mak

package info (click to toggle)
memtest86+ 5.01-3
  • links: PTS
  • area: main
  • in suites: buster, sid, stretch
  • size: 1,336 kB
  • ctags: 2,585
  • sloc: ansic: 17,514; asm: 1,805; makefile: 239; sh: 127
file content (10 lines) | stat: -rw-r--r-- 460 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
# Create an auto-incrementing build number.

BUILD_NUMBER_LDFLAGS  = -Xlinker --defsym -Xlinker __BUILD_DATE=$$(date +'%Y%m%d')
BUILD_NUMBER_LDFLAGS += -Xlinker --defsym -Xlinker __BUILD_NUMBER=$$(cat $(BUILD_NUMBER_FILE))

# Build number file.  Increment if any object file changes.
$(BUILD_NUMBER_FILE): $(OBJS)
	@if ! test -f $(BUILD_NUMBER_FILE); then echo 0 > $(BUILD_NUMBER_FILE); fi
	@echo $$(($$(cat $(BUILD_NUMBER_FILE)) + 1)) > $(BUILD_NUMBER_FILE)