-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | Makefile | 29 | ||||
-rw-r--r-- | cgit.c | 3 | ||||
-rw-r--r-- | cgit.h | 2 | ||||
-rwxr-xr-x | gen-version.sh | 4 | ||||
-rw-r--r-- | shared.c | 2 | ||||
-rw-r--r-- | ui-shared.c | 2 |
7 files changed, 27 insertions, 16 deletions
@@ -2,2 +2,3 @@ | |||
2 | cgit | 2 | cgit |
3 | VERSION | ||
3 | *.o | 4 | *.o |
@@ -1,5 +1,2 @@ | |||
1 | CGIT_VERSION = 0.5 | ||
2 | |||
3 | prefix = /var/www/htdocs/cgit | 1 | prefix = /var/www/htdocs/cgit |
4 | |||
5 | SHA1_HEADER = <openssl/sha.h> | 2 | SHA1_HEADER = <openssl/sha.h> |
@@ -14,2 +11,13 @@ CGIT_SCRIPT_NAME = cgit.cgi | |||
14 | 11 | ||
12 | |||
13 | CGIT_VERSION = 0.5 | ||
14 | |||
15 | all: cgit | ||
16 | |||
17 | VERSION: | ||
18 | gen-version.sh | ||
19 | |||
20 | -include VERSION | ||
21 | |||
22 | |||
15 | EXTLIBS = git/libgit.a git/xdiff/lib.a -lz -lcrypto | 23 | EXTLIBS = git/libgit.a git/xdiff/lib.a -lz -lcrypto |
@@ -44,8 +52,3 @@ endif | |||
44 | 52 | ||
45 | # | 53 | cgit: cgit.c cgit.h VERSION $(OBJECTS) |
46 | # basic build rules | ||
47 | # | ||
48 | all: cgit | ||
49 | |||
50 | cgit: cgit.c cgit.h $(OBJECTS) | ||
51 | $(CC) $(CFLAGS) cgit.c -o cgit $(OBJECTS) $(EXTLIBS) | 54 | $(CC) $(CFLAGS) cgit.c -o cgit $(OBJECTS) $(EXTLIBS) |
@@ -67,3 +70,3 @@ install: all clean-cache | |||
67 | clean-cgit: | 70 | clean-cgit: |
68 | rm -f cgit *.o | 71 | rm -f cgit VERSION *.o |
69 | 72 | ||
@@ -85,3 +88,7 @@ distclean: distclean-cgit distclean-sub | |||
85 | 88 | ||
89 | version: clean-cgit | ||
90 | ./gen-version.sh | ||
91 | make | ||
92 | |||
86 | .PHONY: all install clean clean-cgit clean-sub clean-cache \ | 93 | .PHONY: all install clean clean-cgit clean-sub clean-cache \ |
87 | distclean distclean-cgit distclean-sub | 94 | distclean distclean-cgit distclean-sub release version |
@@ -10,5 +10,2 @@ | |||
10 | 10 | ||
11 | const char cgit_version[] = CGIT_VERSION; | ||
12 | |||
13 | |||
14 | static int cgit_prepare_cache(struct cacheitem *item) | 11 | static int cgit_prepare_cache(struct cacheitem *item) |
@@ -100,3 +100,3 @@ struct taginfo { | |||
100 | 100 | ||
101 | extern const char cgit_version[]; | 101 | extern const char *cgit_version; |
102 | 102 | ||
diff --git a/gen-version.sh b/gen-version.sh new file mode 100755 index 0000000..4c60f60 --- a/dev/null +++ b/gen-version.sh | |||
@@ -0,0 +1,4 @@ | |||
1 | v=$(git-describe --abbrev=4 HEAD | sed -e 's/-/./g') | ||
2 | test -z "$v" && exit 1 | ||
3 | echo "CGIT_VERSION = $v" | ||
4 | echo "CGIT_VERSION = $v" > VERSION | ||
@@ -14,2 +14,4 @@ int cgit_cmd; | |||
14 | 14 | ||
15 | const char *cgit_version = CGIT_VERSION; | ||
16 | |||
15 | char *cgit_root_title = "Git repository browser"; | 17 | char *cgit_root_title = "Git repository browser"; |
diff --git a/ui-shared.c b/ui-shared.c index 15d8254..110c696 100644 --- a/ui-shared.c +++ b/ui-shared.c | |||
@@ -264,3 +264,3 @@ void cgit_print_docstart(char *title, struct cacheitem *item) | |||
264 | html("</title>\n"); | 264 | html("</title>\n"); |
265 | htmlf("<meta name='generator' content='cgit v%s'/>\n", cgit_version); | 265 | htmlf("<meta name='generator' content='cgit %s'/>\n", cgit_version); |
266 | html("<link rel='stylesheet' type='text/css' href='"); | 266 | html("<link rel='stylesheet' type='text/css' href='"); |