summaryrefslogtreecommitdiffabout
authorLars Hjemli <hjemli@gmail.com>2008-03-24 22:10:59 (UTC)
committer Lars Hjemli <hjemli@gmail.com>2008-03-24 22:27:16 (UTC)
commit92908af4558d7362c7deeb05254343a5a5f11a05 (patch) (side-by-side diff)
tree6913a6f567375446fb680bc7e94dbabb5d8e496d
parentdf90b51bafec24336cf30339b2978ff6df22b075 (diff)
downloadcgit-92908af4558d7362c7deeb05254343a5a5f11a05.zip
cgit-92908af4558d7362c7deeb05254343a5a5f11a05.tar.gz
cgit-92908af4558d7362c7deeb05254343a5a5f11a05.tar.bz2
Move cgit_version from shared.c to cgit.c
With the matching Makefile change, this makes sure that only cgit.o and cgit proper needs to be rebuildt when VERSION has been modified. Signed-off-by: Lars Hjemli <hjemli@gmail.com>
Diffstat (more/less context) (show 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
@@ -61,17 +61,19 @@ 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:
diff --git a/cgit.c b/cgit.c
index b3dd119..3943a0f 100644
--- a/cgit.c
+++ b/cgit.c
@@ -5,16 +5,18 @@
* 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);
diff --git a/shared.c b/shared.c
index cd60da5..48002ac 100644
--- a/shared.c
+++ b/shared.c
@@ -7,18 +7,16 @@
*/
#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)