summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--Makefile4
-rw-r--r--cgit.c2
-rw-r--r--shared.c2
3 files changed, 5 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index faf7b98..c9be8fa 100644
--- a/Makefile
+++ b/Makefile
@@ -57,25 +57,27 @@ VERSION: force-version
CFLAGS += -g -Wall -Igit
CFLAGS += -DSHA1_HEADER='$(SHA1_HEADER)'
CFLAGS += -DCGIT_VERSION='"$(CGIT_VERSION)"'
CFLAGS += -DCGIT_CONFIG='"$(CGIT_CONFIG)"'
CFLAGS += -DCGIT_SCRIPT_NAME='"$(CGIT_SCRIPT_NAME)"'
CFLAGS += -DCGIT_CACHE_ROOT='"$(CACHE_ROOT)"'
cgit: $(OBJECTS)
$(CC) $(CFLAGS) -o cgit $(OBJECTS) $(EXTLIBS)
-$(OBJECTS): git/xdiff/lib.a git/libgit.a VERSION
+$(OBJECTS): git/xdiff/lib.a git/libgit.a
+
+cgit.o: VERSION
-include $(OBJECTS:.o=.d)
git/xdiff/lib.a: | git
git/libgit.a: | git
git:
cd git && $(MAKE) xdiff/lib.a
cd git && $(MAKE) libgit.a
test: all
diff --git a/cgit.c b/cgit.c
index b3dd119..3943a0f 100644
--- a/cgit.c
+++ b/cgit.c
@@ -1,24 +1,26 @@
/* cgit.c: cgi for the git scm
*
* Copyright (C) 2006 Lars Hjemli
*
* Licensed under GNU General Public License v2
* (see COPYING for full license text)
*/
#include "cgit.h"
#include "cmd.h"
#include "ui-shared.h"
+const char *cgit_version = CGIT_VERSION;
+
void config_cb(const char *name, const char *value)
{
if (!strcmp(name, "root-title"))
ctx.cfg.root_title = xstrdup(value);
else if (!strcmp(name, "css"))
ctx.cfg.css = xstrdup(value);
else if (!strcmp(name, "logo"))
ctx.cfg.logo = xstrdup(value);
else if (!strcmp(name, "index-header"))
ctx.cfg.index_header = xstrdup(value);
else if (!strcmp(name, "index-info"))
ctx.cfg.index_info = xstrdup(value);
diff --git a/shared.c b/shared.c
index cd60da5..48002ac 100644
--- a/shared.c
+++ b/shared.c
@@ -3,26 +3,24 @@
* Copyright (C) 2006 Lars Hjemli
*
* Licensed under GNU General Public License v2
* (see COPYING for full license text)
*/
#include "cgit.h"
struct cgit_repolist cgit_repolist;
struct cgit_context ctx;
int cgit_cmd;
-const char *cgit_version = CGIT_VERSION;
-
int chk_zero(int result, char *msg)
{
if (result != 0)
die("%s: %s", msg, strerror(errno));
return result;
}
int chk_positive(int result, char *msg)
{
if (result <= 0)
die("%s: %s", msg, strerror(errno));
return result;