mirror of
https://github.com/paboyle/Grid.git
synced 2025-04-11 22:50:45 +01:00
better Version.h implementation
This commit is contained in:
parent
ee630d2e8b
commit
b52d8eb1e3
1
.gitignore
vendored
1
.gitignore
vendored
@ -114,4 +114,3 @@ gh-pages/
|
|||||||
#####################
|
#####################
|
||||||
Grid/qcd/spin/gamma-gen/*.h
|
Grid/qcd/spin/gamma-gen/*.h
|
||||||
Grid/qcd/spin/gamma-gen/*.cc
|
Grid/qcd/spin/gamma-gen/*.cc
|
||||||
Grid/version.h
|
|
||||||
|
@ -21,6 +21,28 @@ if BUILD_HDF5
|
|||||||
extra_headers+=serialisation/Hdf5Type.h
|
extra_headers+=serialisation/Hdf5Type.h
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
all: version-cache
|
||||||
|
|
||||||
|
version-cache:
|
||||||
|
if [ `git status --porcelain | wc -l` -gt 0 ]; then\
|
||||||
|
a="uncommited changes";\
|
||||||
|
else\
|
||||||
|
a="no uncommitted changes";\
|
||||||
|
fi;\
|
||||||
|
echo "`git log -n 1 --format=format:"#define GITHASH \\"%H:%d $$a\\"%n" HEAD`" > vertmp;\
|
||||||
|
if [ -e version-cache ]; then\
|
||||||
|
d=`diff vertmp version-cache`;\
|
||||||
|
[ "${d}" != "" ] && mv vertmp version-cache;\
|
||||||
|
else\
|
||||||
|
mv vertmp version-cache;\
|
||||||
|
fi;\
|
||||||
|
rm -f vertmp
|
||||||
|
|
||||||
|
Version.h:
|
||||||
|
echo "`git log -n 1 --format=format:"#define GITHASH \\"%H:%d $$a\\"%n" HEAD`" > Version.h
|
||||||
|
|
||||||
|
.PHONY: version-cache
|
||||||
|
|
||||||
#
|
#
|
||||||
# Libraries
|
# Libraries
|
||||||
#
|
#
|
||||||
@ -30,8 +52,8 @@ include Eigen.inc
|
|||||||
lib_LIBRARIES = libGrid.a
|
lib_LIBRARIES = libGrid.a
|
||||||
|
|
||||||
CCFILES += $(extra_sources)
|
CCFILES += $(extra_sources)
|
||||||
HFILES += $(extra_headers)
|
HFILES += $(extra_headers) Config.h Version.h
|
||||||
|
|
||||||
libGrid_a_SOURCES = $(CCFILES)
|
libGrid_a_SOURCES = $(CCFILES)
|
||||||
libGrid_adir = $(includedir)/Grid
|
libGrid_adir = $(includedir)/Grid
|
||||||
nobase_dist_pkginclude_HEADERS = $(HFILES) $(eigen_files) $(eigen_unsupp_files) Config.h
|
nobase_dist_pkginclude_HEADERS = $(HFILES) $(eigen_files) $(eigen_unsupp_files)
|
||||||
|
@ -49,7 +49,6 @@ Author: paboyle <paboyle@ph.ed.ac.uk>
|
|||||||
#include <Grid/Grid.h>
|
#include <Grid/Grid.h>
|
||||||
|
|
||||||
#include <Grid/util/CompilerCompatible.h>
|
#include <Grid/util/CompilerCompatible.h>
|
||||||
#include <version.h>
|
|
||||||
|
|
||||||
|
|
||||||
#include <fenv.h>
|
#include <fenv.h>
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <version.h>
|
#include "Version.h"
|
||||||
namespace Grid {
|
namespace Grid {
|
||||||
void printHash(){
|
void printHash(){
|
||||||
#ifdef GITHASH
|
#ifdef GITHASH
|
||||||
|
@ -5,11 +5,6 @@ include $(top_srcdir)/doxygen.inc
|
|||||||
|
|
||||||
bin_SCRIPTS=grid-config
|
bin_SCRIPTS=grid-config
|
||||||
|
|
||||||
BUILT_SOURCES = version.h
|
|
||||||
|
|
||||||
version.h:
|
|
||||||
if [ `git status --porcelain | wc -l` -gt 0 ]; then a="uncommited changes"; else a="no uncommitted changes"; fi; echo "`git log -n 1 --format=format:"#define GITHASH \\"%H:%d $$a\\"%n" HEAD`" > $(srcdir)/Grid/version.h
|
|
||||||
|
|
||||||
.PHONY: bench check tests doxygen-run doxygen-doc $(DX_PS_GOAL) $(DX_PDF_GOAL)
|
.PHONY: bench check tests doxygen-run doxygen-doc $(DX_PS_GOAL) $(DX_PDF_GOAL)
|
||||||
|
|
||||||
tests-local: all
|
tests-local: all
|
||||||
|
Loading…
x
Reference in New Issue
Block a user