Browse Source

Add RELEASE file and define version strings.

Georgi Chorbadzhiyski 12 years ago
parent
commit
dae2618a4f
3 changed files with 17 additions and 2 deletions
  1. 12
    1
      Makefile
  2. 1
    0
      RELEASE
  3. 4
    1
      fjfs.c

+ 12
- 1
Makefile View File

1
+CC = $(CROSS)$(TARGET)gcc
2
+
3
+BUILD_ID = $(shell date +%F_%R)
4
+VERSION = $(shell cat RELEASE)
5
+GIT_VER = $(shell git describe --tags --dirty --always 2>/dev/null)
6
+ifeq "$(GIT_VER)" ""
7
+GIT_VER = "release"
8
+endif
9
+
10
+CFLAGS_BUILD = -DBUILD_ID=\"$(BUILD_ID)\" -DVERSION=\"$(VERSION)\" -DGIT_VER=\"$(GIT_VER)\"
11
+
1
 CFLAGS_DBG?=	-ggdb
12
 CFLAGS_DBG?=	-ggdb
2
 CFLAGS_OPT?=	-O2
13
 CFLAGS_OPT?=	-O2
3
 CFLAGS_WARN?=	-Wall -W -Wextra -Wshadow -Wformat-security \
14
 CFLAGS_WARN?=	-Wall -W -Wextra -Wshadow -Wformat-security \
7
 		-Wredundant-decls -Wstrict-prototypes
18
 		-Wredundant-decls -Wstrict-prototypes
8
 
19
 
9
 CFLAGS?=	${CFLAGS_DBG} ${CFLAGS_OPT}
20
 CFLAGS?=	${CFLAGS_DBG} ${CFLAGS_OPT}
10
-CFLAGS+=	${CFLAGS_WARN}
21
+CFLAGS+=	${CFLAGS_WARN} ${CFLAGS_BUILD}
11
 
22
 
12
 CFLAGS+=	`pkg-config --cflags fuse`
23
 CFLAGS+=	`pkg-config --cflags fuse`
13
 LIBS+=		`pkg-config --libs fuse`
24
 LIBS+=		`pkg-config --libs fuse`

+ 1
- 0
RELEASE View File

1
+1.0

+ 4
- 1
fjfs.c View File

40
 #include <fnmatch.h>
40
 #include <fnmatch.h>
41
 #include <fuse.h>
41
 #include <fuse.h>
42
 
42
 
43
+static const char *program_id = "fjfs v" VERSION " (" GIT_VER ", build " BUILD_ID ")";
44
+
43
 /* Handle list of files */
45
 /* Handle list of files */
44
 struct fileinfo {
46
 struct fileinfo {
45
 	int		fd;
47
 	int		fd;
300
 };
302
 };
301
 
303
 
302
 static void show_usage(void) {
304
 static void show_usage(void) {
303
-	printf("fjfs - FUSE module for virtual joining of multiple files into one.\n");
305
+	printf("%s\n", program_id);
306
+	printf("FUSE module for virtual joining of multiple files into one.\n");
304
 	printf("\n");
307
 	printf("\n");
305
 	printf("Usage: fjfs [file-list-options] [options] mount-point-file file-list\n");
308
 	printf("Usage: fjfs [file-list-options] [options] mount-point-file file-list\n");
306
 	printf("\n");
309
 	printf("\n");

Loading…
Cancel
Save