From 0c49d16244e4052ed95bccede0be00d460220d3c Mon Sep 17 00:00:00 2001 From: Richard Cochran Date: Sun, 9 Dec 2012 09:42:47 +0100 Subject: [PATCH] Add a compile time version string definition. Signed-off-by: Richard Cochran --- makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/makefile b/makefile index afa5021..2689660 100644 --- a/makefile +++ b/makefile @@ -25,7 +25,8 @@ endif DEBUG = CC = $(CROSS_COMPILE)gcc 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) 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 \ @@ -35,6 +36,7 @@ OBJECTS = $(OBJ) pmc.o phc2sys.o hwstamp_ctl.o sysoff.o SRC = $(OBJECTS:.o=.c) DEPEND = $(OBJECTS:.o=.d) srcdir := $(dir $(lastword $(MAKEFILE_LIST))) +version := $(shell $(srcdir)/version.sh $(srcdir)) VPATH = $(srcdir) prefix = /usr/local