summaryrefslogtreecommitdiffabout
path: root/Makefile
Side-by-side diff
Diffstat (limited to 'Makefile') (more/less context) (ignore whitespace changes)
-rw-r--r--Makefile28
1 files changed, 24 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index 2dae3ac..dda743d 100644
--- a/Makefile
+++ b/Makefile
@@ -8,14 +8,22 @@ SHA1_HEADER = <openssl/sha.h>
GIT_VER = 1.7.3
GIT_URL = http://www.kernel.org/pub/software/scm/git/git-$(GIT_VER).tar.bz2
INSTALL = install
# Define NO_STRCASESTR if you don't have strcasestr.
#
+# Define NO_OPENSSL to disable linking with OpenSSL and use bundled SHA1
+# implementation (slower).
+#
# Define NEEDS_LIBICONV if linking with libc is not enough (eg. Darwin).
#
+# Define NO_C99_FORMAT if your formatted IO functions (printf/scanf et.al.)
+# do not support the 'size specifiers' introduced by C99, namely ll, hh,
+# j, z, t. (representing long long int, char, intmax_t, size_t, ptrdiff_t).
+# some C compilers supported these specifiers prior to C99 as an extension.
+#
#-include config.mak
#
# Platform specific tweaks
#
@@ -65,13 +73,13 @@ endif
# Define a pattern rule for silent object building
#
%.o: %.c
$(QUIET_CC)$(CC) -o $*.o -c $(CFLAGS) $<
-EXTLIBS = git/libgit.a git/xdiff/lib.a -lz -lcrypto -lpthread
+EXTLIBS = git/libgit.a git/xdiff/lib.a -lz -lpthread
OBJECTS =
OBJECTS += cache.o
OBJECTS += cgit.o
OBJECTS += cmd.o
OBJECTS += configfile.o
OBJECTS += html.o
@@ -87,12 +95,13 @@ OBJECTS += ui-log.o
OBJECTS += ui-patch.o
OBJECTS += ui-plain.o
OBJECTS += ui-refs.o
OBJECTS += ui-repolist.o
OBJECTS += ui-shared.o
OBJECTS += ui-snapshot.o
+OBJECTS += ui-ssdiff.o
OBJECTS += ui-stats.o
OBJECTS += ui-summary.o
OBJECTS += ui-tag.o
OBJECTS += ui-tree.o
ifdef NEEDS_LIBICONV
@@ -120,23 +129,34 @@ CFLAGS += -DCGIT_CACHE_ROOT='"$(CACHE_ROOT)"'
ifdef NO_ICONV
CFLAGS += -DNO_ICONV
endif
ifdef NO_STRCASESTR
CFLAGS += -DNO_STRCASESTR
endif
+ifdef NO_C99_FORMAT
+ CFLAGS += -DNO_C99_FORMAT
+endif
+ifdef NO_OPENSSL
+ CFLAGS += -DNO_OPENSSL
+ GIT_OPTIONS += NO_OPENSSL=1
+else
+ EXTLIBS += -lcrypto
+endif
cgit: $(OBJECTS) libgit
$(QUIET_CC)$(CC) $(CFLAGS) $(LDFLAGS) -o cgit $(OBJECTS) $(EXTLIBS)
cgit.o: VERSION
--include $(OBJECTS:.o=.d)
+ifneq "$(MAKECMDGOALS)" "clean"
+ -include $(OBJECTS:.o=.d)
+endif
libgit:
- $(QUIET_SUBDIR0)git $(QUIET_SUBDIR1) NO_CURL=1 libgit.a
- $(QUIET_SUBDIR0)git $(QUIET_SUBDIR1) NO_CURL=1 xdiff/lib.a
+ $(QUIET_SUBDIR0)git $(QUIET_SUBDIR1) NO_CURL=1 $(GIT_OPTIONS) libgit.a
+ $(QUIET_SUBDIR0)git $(QUIET_SUBDIR1) NO_CURL=1 $(GIT_OPTIONS) xdiff/lib.a
test: all
$(QUIET_SUBDIR0)tests $(QUIET_SUBDIR1) all
install: all
$(INSTALL) -m 0755 -d $(DESTDIR)$(CGIT_SCRIPT_PATH)