-LDFLAGS ?=
-CFLAGS ?= -g -Wall
-CFLAGS += -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)"'
-
-ifeq ($(uname_O),Cygwin)
- NO_STRCASESTR = YesPlease
- NEEDS_LIBICONV = YesPlease
-endif
-
-ifeq ($(uname_S),$(filter $(uname_S),FreeBSD OpenBSD))
- # Apparantly libiconv is installed in /usr/local on BSD
- LDFLAGS += -L/usr/local/lib
- CFLAGS += -I/usr/local/include
- NEEDS_LIBICONV = yes
-endif
-
-GIT_OPTIONS = prefix=/usr
-OBJECTS =
-
-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
- LDLIBS += -lcrypto
-endif
-
-ifdef NEEDS_LIBICONV
- LDLIBS += -liconv
-endif
-
-LDLIBS += git/libgit.a git/xdiff/lib.a -lz -lpthread
-
-OBJECTS += cgit.o
-OBJECTS += cache.o
-OBJECTS += cmd.o
-OBJECTS += configfile.o
-OBJECTS += html.o
-OBJECTS += parsing.o
-OBJECTS += scan-tree.o
-OBJECTS += shared.o
-OBJECTS += ui-atom.o
-OBJECTS += ui-blob.o
-OBJECTS += ui-clone.o
-OBJECTS += ui-commit.o
-OBJECTS += ui-diff.o
-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
-OBJECTS += vector.o
-
-dep_files := $(foreach f,$(OBJECTS),$(dir $f).deps/$(notdir $f).d)
-dep_dirs := $(addsuffix .deps,$(sort $(dir $OBJECTS)))
-
-$(dep_dirs):
- @mkdir -p $@
-
-missing_dep_dirs := $(filter-out $(wildcard $(dep_dirs)),$(dep_dirs))
-dep_file = $(dir $@).deps/$(notdir $@).d
-dep_args = -MF $(dep_file) -MMD -MP
-