for i in $(SUBDIRS); \
do echo; echo $$i; $(MAKE) $(MFLAGS) -C $$i; done
+.PHONY: clean clobber distclean check cscope version
+
help:
@echo "Make Targets:"
@echo " all - build binaries"
@echo " install - install binaries on local machine"
@echo " check - run tests"
@echo " cscope - build cscope database"
- @echo " snapshot - generate version number header"
+ @echo " version - update version"
@echo ""
@echo "Make Arguments:"
@echo " V=[0|1] - set build verbosity level"
install -m 0644 bash-completion/devlink $(DESTDIR)$(BASH_COMPDIR)
install -m 0644 include/bpf_elf.h $(DESTDIR)$(HDRDIR)
-snapshot:
- echo "static const char SNAPSHOT[] = \""`date +%y%m%d`"\";" \
- > include/SNAPSHOT.h
+version:
+ echo "static const char version[] = \""`git describe --tags --long`"\";" \
+ > include/version.h
clean:
@for i in $(SUBDIRS) testsuite; \
#include <string.h>
#include <errno.h>
-#include "SNAPSHOT.h"
+#include "version.h"
#include "utils.h"
#include "br_common.h"
#include "namespace.h"
#include <sys/socket.h>
#include <sys/types.h>
-#include "SNAPSHOT.h"
+#include "version.h"
#include "list.h"
#include "mnlg.h"
#include "json_print.h"
switch (opt) {
case 'V':
- printf("devlink utility, iproute2-ss%s\n", SNAPSHOT);
+ printf("devlink utility, iproute2-%s\n", version);
ret = EXIT_SUCCESS;
goto dl_free;
case 'f':
#include <errno.h>
#include <linux/netlink.h>
#include <linux/rtnetlink.h> /* until we put our own header */
-#include "SNAPSHOT.h"
+#include "version.h"
#include "utils.h"
#include "genl_utils.h"
} else if (matches(argv[1], "-raw") == 0) {
++show_raw;
} else if (matches(argv[1], "-Version") == 0) {
- printf("genl utility, iproute2-ss%s\n", SNAPSHOT);
+ printf("genl utility, iproute2-%s\n", version);
exit(0);
} else if (matches(argv[1], "-help") == 0) {
usage();
+++ /dev/null
-static const char SNAPSHOT[] = "200602";
--- /dev/null
+static const char version[] = "v5.7.0-77-gb687d1067169";
#include <string.h>
#include <errno.h>
-#include "SNAPSHOT.h"
+#include "version.h"
#include "utils.h"
#include "ip_common.h"
#include "namespace.h"
++timestamp;
++timestamp_short;
} else if (matches(opt, "-Version") == 0) {
- printf("ip utility, iproute2-ss%s\n", SNAPSHOT);
+ printf("ip utility, iproute2-%s\n", version);
exit(0);
} else if (matches(opt, "-force") == 0) {
++force;
#include <netinet/in.h>
#include <string.h>
-#include "SNAPSHOT.h"
+#include "version.h"
#include "utils.h"
#include "libnetlink.h"
} else if (strcmp(argv[1], "-0") == 0) {
family = AF_PACKET;
} else if (matches(argv[1], "-Version") == 0) {
- printf("rtmon utility, iproute2-ss%s\n", SNAPSHOT);
+ printf("rtmon utility, iproute2-%s\n", version);
exit(0);
} else if (matches(argv[1], "file") == 0) {
argc--;
#include "libnetlink.h"
#include "json_writer.h"
-#include "SNAPSHOT.h"
+#include "version.h"
#include "utils.h"
int dump_zeros;
break;
case 'v':
case 'V':
- printf("ifstat utility, iproute2-ss%s\n", SNAPSHOT);
+ printf("ifstat utility, iproute2-%s\n", version);
exit(0);
case 'h':
case '?':
#include <getopt.h>
#include <json_writer.h>
-#include <SNAPSHOT.h>
+#include "version.h"
#include "utils.h"
int dump_zeros;
break;
case 'v':
case 'V':
- printf("nstat utility, iproute2-ss%s\n", SNAPSHOT);
+ printf("nstat utility, iproute2-%s\n", version);
exit(0);
case 'h':
case '?':
#include "rt_names.h"
-#include <SNAPSHOT.h>
+#include "version.h"
int reset_history;
int ignore_history;
break;
case 'v':
case 'V':
- printf("rtacct utility, iproute2-ss%s\n", SNAPSHOT);
+ printf("rtacct utility, iproute2-%s\n", version);
exit(0);
case 'M':
/* Some secret undocumented option, nobody
#include "ll_map.h"
#include "libnetlink.h"
#include "namespace.h"
-#include "SNAPSHOT.h"
+#include "version.h"
#include "rt_names.h"
#include "cg_map.h"
break;
case 'v':
case 'V':
- printf("ss utility, iproute2-ss%s\n", SNAPSHOT);
+ printf("ss utility, iproute2-%s\n", version);
exit(0);
case 'z':
show_sock_ctx++;
*/
#include "rdma.h"
-#include "SNAPSHOT.h"
+#include "version.h"
#include "color.h"
static void help(char *name)
long_options, NULL)) >= 0) {
switch (opt) {
case 'V':
- printf("%s utility, iproute2-ss%s\n",
- filename, SNAPSHOT);
+ printf("%s utility, iproute2-%s\n",
+ filename, version);
return EXIT_SUCCESS;
case 'p':
pretty = 1;
#include <string.h>
#include <errno.h>
-#include "SNAPSHOT.h"
+#include "version.h"
#include "utils.h"
#include "tc_util.h"
#include "tc_common.h"
} else if (matches(argv[1], "-graph") == 0) {
show_graph = 1;
} else if (matches(argv[1], "-Version") == 0) {
- printf("tc utility, iproute2-ss%s\n", SNAPSHOT);
+ printf("tc utility, iproute2-%s\n", version);
return 0;
} else if (matches(argv[1], "-iec") == 0) {
++use_iec;