diff options
author | Junio C Hamano <junkio@cox.net> | 2005-12-05 11:54:29 -0800 |
---|---|---|
committer | Junio C Hamano <junkio@cox.net> | 2005-12-05 15:50:29 -0800 |
commit | 4050c0df8ec7043315e2192695de432875239775 (patch) | |
tree | 36ea762082320aae037a95157c6c7f0ffc383046 /Makefile | |
parent | cd8c4589473d2a6669cf882ebcd708a2d81e9168 (diff) | |
download | git-4050c0df8ec7043315e2192695de432875239775.tar.gz git-4050c0df8ec7043315e2192695de432875239775.tar.xz |
Clean up compatibility definitions.
This attempts to clean up the way various compatibility
functions are defined and used.
- A new header file, git-compat-util.h, is introduced. This
looks at various NO_XXX and does necessary function name
replacements, equivalent of -Dstrcasestr=gitstrcasestr in the
Makefile.
- Those function name replacements are removed from the Makefile.
- Common features such as usage(), die(), xmalloc() are moved
from cache.h to git-compat-util.h; cache.h includes
git-compat-util.h itself.
Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -162,7 +162,7 @@ LIB_FILE=libgit.a LIB_H = \ blob.h cache.h commit.h count-delta.h csum-file.h delta.h \ diff.h epoch.h object.h pack.h pkt-line.h quote.h refs.h \ - run-command.h strbuf.h tag.h tree.h + run-command.h strbuf.h tag.h tree.h git-compat-util.h DIFF_OBJS = \ diff.o diffcore-break.o diffcore-order.o diffcore-pathspec.o \ @@ -320,15 +320,15 @@ ifdef NEEDS_NSL SIMPLE_LIB += -lnsl endif ifdef NO_STRCASESTR - COMPAT_CFLAGS += -Dstrcasestr=gitstrcasestr -DNO_STRCASESTR=1 + COMPAT_CFLAGS += -DNO_STRCASESTR COMPAT_OBJS += compat/strcasestr.o endif ifdef NO_SETENV - COMPAT_CFLAGS += -Dsetenv=gitsetenv -DNO_SETENV=1 + COMPAT_CFLAGS += -DNO_SETENV COMPAT_OBJS += compat/setenv.o endif ifdef NO_MMAP - COMPAT_CFLAGS += -Dmmap=gitfakemmap -Dmunmap=gitfakemunmap -DNO_MMAP + COMPAT_CFLAGS += -DNO_MMAP COMPAT_OBJS += compat/mmap.o endif ifdef NO_IPV6 @@ -363,9 +363,9 @@ all: $(ALL_PROGRAMS) all: $(MAKE) -C templates -git$(X): git.c $(COMPAT_OBJS) Makefile +git$X: git.c $(LIB_FILE) Makefile $(CC) -DGIT_EXEC_PATH='"$(bindir)"' -DGIT_VERSION='"$(GIT_VERSION)"' \ - $(CFLAGS) $(COMPAT_CFLAGS) -o $@ $(filter %.c,$^) $(filter %.o,$^) + $(CFLAGS) $(COMPAT_CFLAGS) -o $@ $(filter %.c,$^) $(LIB_FILE) $(patsubst %.sh,%,$(SCRIPT_SH)) : % : %.sh rm -f $@ |