sbin_PROGRAMS = tincd tinc sptps_test sptps_keypair
+## Make sure version.c is always rebuilt
+.PHONY: version.c
+
if LINUX
sbin_PROGRAMS += sptps_speed
endif
tincd.c \
utils.c utils.h \
xalloc.h \
+ version.c version.h \
$(ed25519_SOURCES) \
$(chacha_poly1305_SOURCES)
tincctl.c tincctl.h \
top.c top.h \
utils.c utils.h \
+ version.c version.h \
$(ed25519_SOURCES) \
$(chacha_poly1305_SOURCES)
#include "subnet.h"
#include "utils.h"
#include "xalloc.h"
+#include "version.h"
/* If zero, don't detach from the terminal. */
bool do_detach = true;
openlogger(identname, use_logfile?LOGMODE_FILE:(do_detach?LOGMODE_SYSLOG:LOGMODE_STDERR));
logger(DEBUG_ALWAYS, LOG_NOTICE, "tincd %s (%s %s) starting, debug level %d",
- VERSION, __DATE__, __TIME__, debug_level);
+ VERSION, BUILD_DATE, BUILD_TIME, debug_level);
return true;
}
#include "utils.h"
#include "tincctl.h"
#include "top.h"
+#include "version.h"
#ifndef MSG_NOSIGNAL
#define MSG_NOSIGNAL 0
static void version(void) {
printf("%s version %s (built %s %s, protocol %d.%d)\n", PACKAGE,
- VERSION, __DATE__, __TIME__, PROT_MAJOR, PROT_MINOR);
+ VERSION, BUILD_DATE, BUILD_TIME, PROT_MAJOR, PROT_MINOR);
printf("Copyright (C) 1998-2012 Ivo Timmermans, Guus Sliepen and others.\n"
"See the AUTHORS file for a complete list.\n\n"
"tinc comes with ABSOLUTELY NO WARRANTY. This is free software,\n"
#include "protocol.h"
#include "utils.h"
#include "xalloc.h"
+#include "version.h"
/* If nonzero, display usage information and exit. */
static bool show_help = false;
if(show_version) {
printf("%s version %s (built %s %s, protocol %d.%d)\n", PACKAGE,
- VERSION, __DATE__, __TIME__, PROT_MAJOR, PROT_MINOR);
+ VERSION, BUILD_DATE, BUILD_TIME, PROT_MAJOR, PROT_MINOR);
printf("Copyright (C) 1998-2014 Ivo Timmermans, Guus Sliepen and others.\n"
"See the AUTHORS file for a complete list.\n\n"
"tinc comes with ABSOLUTELY NO WARRANTY. This is free software,\n"
--- /dev/null
+/*
+ version.c -- version information
+ Copyright (C) 2014 Etienne Dechamps <etienne@edechamps.fr>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+*/
+
+#include "version.h"
+
+/* This file is always rebuilt (even if there are no changes) so that the following is updated */
+const char* const BUILD_DATE = __DATE__;
+const char* const BUILD_TIME = __TIME__;
--- /dev/null
+/*
+ version.h -- header for version.c
+ Copyright (C) 2014 Etienne Dechamps <etienne@edechamps.fr>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+*/
+
+#ifndef __TINC_VERSION_H__
+#define __TINC_VERSION_H__
+
+extern const char* const BUILD_DATE;
+extern const char* const BUILD_TIME;
+
+#endif /* __TINC_VERSION_H__ */