From 596d9b6e4bb1c524a8d197b01f7e7268884955b5 Mon Sep 17 00:00:00 2001 From: goodale Date: Fri, 15 Dec 2000 18:04:01 +0000 Subject: Tidied up the versioning stuff a bit. Tom git-svn-id: http://svn.cactuscode.org/flesh/trunk@1954 17b73243-c579-4c4c-a9d2-2d5706c11dac --- lib/make/make.configuration | 12 ++++++------ src/datestamp.c | 25 ++++++++++++++++--------- src/include/cctk_Version.h | 40 ++++++++++++++++++++++++++++++++++++++++ src/main/CommandLine.c | 15 ++++++--------- 4 files changed, 68 insertions(+), 24 deletions(-) create mode 100644 src/include/cctk_Version.h diff --git a/lib/make/make.configuration b/lib/make/make.configuration index a060f7da..f32acb37 100644 --- a/lib/make/make.configuration +++ b/lib/make/make.configuration @@ -75,10 +75,10 @@ endif UTIL_DIR=$(EXEDIR)$(DIRSEP)$(CONFIG_NAME) # Build the executable -$(EXEDIR)$(DIRSEP)$(EXE): $(CONFIG)/make.thornlist $(CONFIG)/cctk_version.h $(patsubst %,$(CCTK_LIBDIR)/$(LIBNAME_PREFIX)%$(LIBNAME_SUFFIX),$(notdir $(THORNS) $(CACTUSLIBS))) +$(EXEDIR)$(DIRSEP)$(EXE): $(CONFIG)/make.thornlist $(CONFIG)/cctki_version.h $(patsubst %,$(CCTK_LIBDIR)/$(LIBNAME_PREFIX)%$(LIBNAME_SUFFIX),$(notdir $(THORNS) $(CACTUSLIBS))) @echo $(DIVIDER) @echo Creating $(EXE) in $(EXEDIR) from $(THORNS) - $(CC) $(OPTIMISE_C) $(DEBUG_C) $(CFLAGS) $(CCOMPILEONLY)$(OPTIONSEP)$(TOP)$(DIRSEP)datestamp.o -I$(CONFIG) $(subst /,$(DIRSEP),$(DATESTAMP)) + $(CC) $(OPTIMISE_C) $(DEBUG_C) $(CFLAGS) $(CCOMPILEONLY)$(OPTIONSEP)$(TOP)$(DIRSEP)datestamp.o -I$(subst /,$(DIRSEP), $(CCTK_HOME)/src/include) -I$(CONFIG) $(subst /,$(DIRSEP),$(DATESTAMP)) if [ ! -d $(EXEDIR) ]; then $(MKDIR) $(MKDIRFLAGS) $(EXEDIR) ; fi $(LD) $(CREATEEXE)$(OPTIONSEP)$(subst /,$(DIRSEP),$@) $(DEBUG_LD) $(LDFLAGS) $(EXTRAFLAGS) $(subst /,$(DIRSEP), $(TOP)/datestamp.o) $(CACTUSLIBLINKLINE) $(GENERAL_LIBRARIES) @echo $(DIVIDER) @@ -86,14 +86,14 @@ $(EXEDIR)$(DIRSEP)$(EXE): $(CONFIG)/make.thornlist $(CONFIG)/cctk_version.h $(pa @echo $(DIVIDER) # Version file -$(CONFIG)/cctk_version.h: $(CCTK_HOME)/Makefile - echo "#ifndef _CCTK_VERSION_H_" > $@ - echo "#define _CCTK_VERSION_H_" >> $@ +$(CONFIG)/cctki_version.h: $(CCTK_HOME)/Makefile + echo "#ifndef _CCTKI_VERSION_H_" > $@ + echo "#define _CCTKI_VERSION_H_" >> $@ echo "#define CCTK_VERSION_MAJOR $(CCTK_VERSION_MAJOR)" >> $@ echo "#define CCTK_VERSION_MINOR $(CCTK_VERSION_MINOR)" >> $@ echo "#define CCTK_VERSION_OTHER $(CCTK_VERSION_OTHER)" >> $@ echo "#define CCTK_VERSION $(CCTK_VERSION)" >> $@ - echo "#endif /* _CCTK_VERSION_H_*/" >> $@ + echo "#endif /* _CCTKI_VERSION_H_*/" >> $@ # Build a thorn library # Libraries go into the appropriate library directory diff --git a/src/datestamp.c b/src/datestamp.c index e85ac999..40a215bb 100644 --- a/src/datestamp.c +++ b/src/datestamp.c @@ -5,17 +5,21 @@ @desc @enddesc + #version $Header$ @@*/ #include -#include "cctk_version.h" + +#include "cctk_Version.h" +#include "cctki_version.h" static char *rcsid = "$Header$"; +const char *CCTKi_version_src_datestamp_c(void); const char *CCTKi_version_src_datestamp_c(void) { return rcsid; } /*@@ - @routine datastamp + @routine CCTKi_DataStamp @date Mon May 11 10:20:58 1998 @author Paul Walker @desc @@ -28,12 +32,13 @@ const char *CCTKi_version_src_datestamp_c(void) { return rcsid; } @endhistory @@*/ -void datestamp(void) { +void CCTKi_DateStamp(void) +{ printf (" Compiled on %s at %s\n", __DATE__, __TIME__); } /*@@ - @routine compileTime + @routine CCTK_CompileTime @date Mon May 11 10:20:58 1998 @author Paul Walker @desc @@ -46,12 +51,13 @@ void datestamp(void) { @endhistory @@*/ -const char *compileTime(void) { +const char *CCTK_CompileTime(void) +{ return (__TIME__); } /*@@ - @routine compileDate + @routine CCTK_CompileDate @date Mon May 11 10:20:58 1998 @author Paul Walker @desc @@ -64,7 +70,8 @@ const char *compileTime(void) { @endhistory @@*/ -const char *compileDate(void) { +const char *CCTK_CompileDate(void) +{ return (__DATE__); } @@ -91,9 +98,9 @@ const char *CCTK_MinorVersion(void) return (STRINGIFY(CCTK_VERSION_MINOR)); } -const char *CCTK_OtherVersion(void) +const char *CCTK_MicroVersion(void) { - return (STRINGIFY(CCTK_VERSION_OTHER)); + return (STRINGIFY(CCTK_VERSION_MICRO)); } /*#define MAKETEST*/ diff --git a/src/include/cctk_Version.h b/src/include/cctk_Version.h new file mode 100644 index 00000000..d010c9a3 --- /dev/null +++ b/src/include/cctk_Version.h @@ -0,0 +1,40 @@ + /*@@ + @header cctk_Version.h + @date Fri Dec 15 18:44:56 2000 + @author Tom Goodale + @desc + Version info about this Cactus + @enddesc + @version $Header$ + @@*/ + +#ifndef _CCTK_VERSION_H_ +#define _CCTK_VERSION_H_ 1 + +#ifdef __cplusplus +extern "C" +{ +#endif + +/* Version Stuff */ +const char *CCTK_FullVersion(void); + +const char *CCTK_MajorVersion(void); + +const char *CCTK_MinorVersion(void); + +const char *CCTK_MicroVersion(void); + +/* Compile date and time stuff */ + +void CCTKi_DateStamp(void); + +const char *CCTK_CompileTime(void); + +const char *CCTK_CompileDate(void); + +#ifdef __cplusplus +} +#endif + +#endif /* _CCTK_VERSION_H_ */ diff --git a/src/main/CommandLine.c b/src/main/CommandLine.c index 07619daf..7a12b0b5 100644 --- a/src/main/CommandLine.c +++ b/src/main/CommandLine.c @@ -16,6 +16,7 @@ #include "cctk_Flesh.h" #include "cGH.h" +#include "cctk_Version.h" #include "cctk_ActiveThorns.h" #include "cctk_Comm.h" #include "cctk_Misc.h" @@ -48,9 +49,6 @@ static void CommandLinePrintParameter(const cParamData *properties); /* FIXME: these should be put in a header somewhere */ -char *compileTime(void); -char *compileDate(void); -char *CCTK_FullVersion(void); int CCTK_CommandLine(char ***outargv); /******************************************************************** @@ -402,7 +400,7 @@ void CCTKi_CommandLineListThorns(void) @desc Prints version info @enddesc - @calls CCTK_FullVersion + @calls CCTK_FullVersion CCTK_CompileDate CCTK_CompileTime @calledby @history @@ -419,11 +417,10 @@ void CCTKi_CommandLineVersion(void) { CCTK_CommandLine(&argv); - version = (const char *)CCTK_FullVersion(); + version = CCTK_FullVersion(); printf("%s: Version %s. Compiled on %s at %s\n", argv[0], version, - compileDate(), compileTime()); - + CCTK_CompileDate(), CCTK_CompileTime()); } CCTK_Exit(NULL,1); @@ -436,7 +433,7 @@ void CCTKi_CommandLineVersion(void) @desc Prints a help message @enddesc - @calls CCTK_CommandLine + @calls CCTK_CommandLine CCTK_CompileDate CCTK_CompileTime @calledby @history @@ -451,7 +448,7 @@ void CCTKi_CommandLineHelp(void) { CCTK_CommandLine(&argv); - printf("%s, compiled on %s at %s\n", argv[0], compileDate(), compileTime()); + printf("%s, compiled on %s at %s\n", argv[0], CCTK_CompileDate(), CCTK_CompileTime()); printf("Usage: %s [-h] [-O] [-o paramname] [-x [nprocs]] [-W n] [-E n] [-r] [-T] [-t name] [-v] \n", argv[0]); printf("\n"); -- cgit v1.2.3