about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--Makefile11
-rw-r--r--cgit.c2
2 files changed, 8 insertions, 5 deletions
diff --git a/Makefile b/Makefile
index a36eede..3d8edb8 100644
--- a/Makefile
+++ b/Makefile
@@ -3,8 +3,9 @@ CGIT_VERSION = 0.4
 prefix = /var/www/htdocs/cgit
 
 SHA1_HEADER = <openssl/sha.h>
-
 CACHE_ROOT = /var/cache/cgit
+CGIT_CONFIG = /etc/cgitrc
+
 EXTLIBS = git/libgit.a git/xdiff/lib.a -lz -lcrypto
 OBJECTS = shared.o cache.o parsing.o html.o ui-shared.o ui-repolist.o \
 	ui-summary.o ui-log.o ui-view.o ui-tree.o ui-commit.o ui-diff.o \
@@ -16,7 +17,10 @@ ifdef DEBUG
 	CFLAGS += -g
 endif
 
-CFLAGS += -Igit -DSHA1_HEADER='$(SHA1_HEADER)'
+CFLAGS += -Igit
+CFLAGS += -DSHA1_HEADER='$(SHA1_HEADER)'
+CFLAGS += -DCGIT_VERSION='"$(CGIT_VERSION)"'
+CFLAGS += -DCGIT_CONFIG='"$(CGIT_CONFIG)"'
 
 
 #
@@ -39,8 +43,7 @@ endif
 all: cgit
 
 cgit: cgit.c cgit.h $(OBJECTS)
-	$(CC) $(CFLAGS) -DCGIT_VERSION='"$(CGIT_VERSION)"' cgit.c -o cgit \
-		$(OBJECTS) $(EXTLIBS)
+	$(CC) $(CFLAGS) cgit.c -o cgit $(OBJECTS) $(EXTLIBS)
 
 $(OBJECTS): cgit.h git/libgit.a
 
diff --git a/cgit.c b/cgit.c
index 1d7a83f..67ad103 100644
--- a/cgit.c
+++ b/cgit.c
@@ -243,7 +243,7 @@ int main(int argc, const char **argv)
 	cgit_repolist.count = 0;
 	cgit_repolist.repos = NULL;
 
-	cgit_read_config("/etc/cgitrc", cgit_global_config_cb);
+	cgit_read_config(CGIT_CONFIG, cgit_global_config_cb);
 	if (getenv("QUERY_STRING"))
 		cgit_querystring = xstrdup(getenv("QUERY_STRING"));
 	cgit_parse_args(argc, argv);
19-02-20Set man_hard_wrap in nvimJune McEnroe 2019-02-18Use hi -o anchor in upJune McEnroe 2019-02-18Don't match nested parentheses in Tag for CJune McEnroe 2019-02-18Match whitespace between * [] {}June McEnroe 2019-02-18Fix function-like #define regexJune McEnroe 2019-02-18Match Tag in RustJune McEnroe 2019-02-18Match sh functions as TagJune McEnroe 2019-02-18Match Sh and Ss as Tag in mdocJune McEnroe 2019-02-18Match statics and typedefs as TagJune McEnroe 2019-02-18Clean up htmlHeaderJune McEnroe 2019-02-18Remove hi line numberingJune McEnroe 2019-02-18Add Tag class to hiJune McEnroe 2019-02-17Generate HTML with hi -n -f html -o anchorJune McEnroe 2019-02-17Add hi -f html -o anchor for line number linksJune McEnroe 2019-02-17Simplify temp trap in upJune McEnroe 2019-02-17Add line numbers to hiJune McEnroe 2019-02-17Always split spans after newlinesJune McEnroe 2019-02-15Color format specifiers light cyan in vimJune McEnroe 2019-02-15Highlight Interp as yellowJune McEnroe 2019-02-15Highlight strings in sh command substitutionsJune McEnroe 2019-02-15Add nmap gpJune McEnroe 2019-02-14Avoid newline when copying URL to pasteboardJune McEnroe 2019-02-13Add forgotten "sixth" book of H2G2June McEnroe