summaryrefslogtreecommitdiffstats
path: root/driver/Makefile
diff options
context:
space:
mode:
authorSuren A. Chilingaryan <csa@suren.me>2016-02-04 02:13:02 +0100
committerSuren A. Chilingaryan <csa@suren.me>2016-02-04 02:13:02 +0100
commit4f5185b37980bdf962ff7058e9f8fbb06098386c (patch)
treecad958462854e1b72cd838a3aed4de1224768bd4 /driver/Makefile
parentcabe489a2e8e2ee7619924e447221177f4562962 (diff)
downloadpcitool-4f5185b37980bdf962ff7058e9f8fbb06098386c.tar.gz
pcitool-4f5185b37980bdf962ff7058e9f8fbb06098386c.tar.bz2
pcitool-4f5185b37980bdf962ff7058e9f8fbb06098386c.tar.xz
pcitool-4f5185b37980bdf962ff7058e9f8fbb06098386c.zip
Report information about driver revision and build
Diffstat (limited to 'driver/Makefile')
-rw-r--r--driver/Makefile11
1 files changed, 11 insertions, 0 deletions
diff --git a/driver/Makefile b/driver/Makefile
index f2c993e..c26a84a 100644
--- a/driver/Makefile
+++ b/driver/Makefile
@@ -29,6 +29,17 @@ default:
else \
CC=$(CC) ;\
fi ;\
+ build_revision=`bzr revno` ;\
+ build_author=`bzr log -r$$build_revision | grep committer | cut -c 12-` ;\
+ build_path=`pwd` ;\
+ build_branch=`bzr nick` ;\
+ build_lastmod=`find . -type f -name '*.[ch]' -printf '%TY/%Tm/%Td %TH:%TM:%TS %p\n' | grep -E -v 'build.h|mod.c' | sort -n | tail -n 1 | cut -d ' ' -f 1-2 | cut -d '.' -f 1` ;\
+ build_changes=`bzr status -SV | cut -c 5- | tr \\\n " "` ;\
+ build_user=`whoami` ;\
+ build_date=`date "+%Y/%m/%d %H:%M:%S"` ;\
+ build="Built at $$build_date by $$build_user" ;\
+ revision="Revision $$build_revision from $$build_branch by $$build_author at $$build_path, last modification from $$build_lastmod" ;\
+ echo -e "#define PCIDRIVER_BUILD \"$$build\"\\n#define PCIDRIVER_REVISION \"$$revision\"\\n#define PCIDRIVER_CHANGES \"$$build_changes\"\\n" > build.h ;\
$(MAKE) $(CFLAGS) -C $(KERNELDIR) M=$(PWD) CC=$$CC modules
install: