Add a compile time version string definition.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
master
Richard Cochran 2012-12-09 09:42:47 +01:00
parent 02f5b741e7
commit 0c49d16244
1 changed files with 3 additions and 1 deletions

View File

@ -25,7 +25,8 @@ endif
DEBUG = DEBUG =
CC = $(CROSS_COMPILE)gcc CC = $(CROSS_COMPILE)gcc
INC = -I$(KBUILD_OUTPUT)/usr/include INC = -I$(KBUILD_OUTPUT)/usr/include
CFLAGS = -Wall $(INC) $(DEBUG) $(FEAT_CFLAGS) $(EXTRA_CFLAGS) VER = -DVER=$(version)
CFLAGS = -Wall $(VER) $(INC) $(DEBUG) $(FEAT_CFLAGS) $(EXTRA_CFLAGS)
LDLIBS = -lm -lrt $(EXTRA_LDFLAGS) LDLIBS = -lm -lrt $(EXTRA_LDFLAGS)
PRG = ptp4l pmc phc2sys hwstamp_ctl PRG = ptp4l pmc phc2sys hwstamp_ctl
OBJ = bmc.o clock.o config.o fsm.o ptp4l.o mave.o msg.o phc.o pi.o port.o \ OBJ = bmc.o clock.o config.o fsm.o ptp4l.o mave.o msg.o phc.o pi.o port.o \
@ -35,6 +36,7 @@ OBJECTS = $(OBJ) pmc.o phc2sys.o hwstamp_ctl.o sysoff.o
SRC = $(OBJECTS:.o=.c) SRC = $(OBJECTS:.o=.c)
DEPEND = $(OBJECTS:.o=.d) DEPEND = $(OBJECTS:.o=.d)
srcdir := $(dir $(lastword $(MAKEFILE_LIST))) srcdir := $(dir $(lastword $(MAKEFILE_LIST)))
version := $(shell $(srcdir)/version.sh $(srcdir))
VPATH = $(srcdir) VPATH = $(srcdir)
prefix = /usr/local prefix = /usr/local