X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;ds=sidebyside;f=Makefile;h=a291bb157ec9eb14037bcc2a2f7b238527dc7adb;hb=8e76c79f4a1e66ed8e371d1232e879f45141dce1;hp=fa0cd8315fcc855e84b8c409f88d5e1a910e8ef4;hpb=7cb038a692ec0bdc0f442380678e8e87e26d4e68;p=git.git diff --git a/Makefile b/Makefile index fa0cd831..a291bb15 100644 --- a/Makefile +++ b/Makefile @@ -23,6 +23,9 @@ all: # # Define NO_SETENV if you don't have setenv in the C library. # +# Define USE_SYMLINK_HEAD if you want .git/HEAD to be a symbolic link. +# Don't enable it on Windows. +# # Define PPC_SHA1 environment variable when running make to make use of # a bundled SHA1 routine optimized for PowerPC. # @@ -65,9 +68,11 @@ CFLAGS = -g -O2 -Wall LDFLAGS = ALL_CFLAGS = $(CFLAGS) ALL_LDFLAGS = $(LDFLAGS) +STRIP ?= strip prefix = $(HOME) bindir = $(prefix)/bin +gitexecdir = $(prefix)/bin template_dir = $(prefix)/share/git-core/templates/ GIT_PYTHON_DIR = $(prefix)/share/git-core/python # DESTDIR= @@ -112,14 +117,14 @@ SCRIPT_PYTHON = \ SCRIPTS = $(patsubst %.sh,%,$(SCRIPT_SH)) \ $(patsubst %.perl,%,$(SCRIPT_PERL)) \ $(patsubst %.py,%,$(SCRIPT_PYTHON)) \ - gitk git-cherry-pick + git-cherry-pick # The ones that do not have to link with lcrypto nor lz. SIMPLE_PROGRAMS = \ git-get-tar-commit-id$X git-mailinfo$X git-mailsplit$X \ git-stripspace$X git-daemon$X -# ... and all the rest +# ... and all the rest that could be moved out of bindir to gitexecdir PROGRAMS = \ git-apply$X git-cat-file$X \ git-checkout-index$X git-clone-pack$X git-commit-tree$X \ @@ -140,8 +145,8 @@ PROGRAMS = \ git-name-rev$X git-pack-redundant$X git-repo-config$X git-var$X \ git-describe$X -# what 'all' will build and 'install' will install. -ALL_PROGRAMS = $(PROGRAMS) $(SIMPLE_PROGRAMS) $(SCRIPTS) git$X +# what 'all' will build and 'install' will install, in gitexecdir +ALL_PROGRAMS = $(PROGRAMS) $(SIMPLE_PROGRAMS) $(SCRIPTS) # Backward compatibility -- to be removed after 1.0 PROGRAMS += git-ssh-pull$X git-ssh-push$X @@ -173,7 +178,7 @@ DIFF_OBJS = \ LIB_OBJS = \ blob.o commit.o connect.o count-delta.o csum-file.o \ - date.o diff-delta.o entry.o ident.o index.o \ + date.o diff-delta.o entry.o exec_cmd.o ident.o index.o \ object.o pack-check.o patch-delta.o path.o pkt-line.o \ quote.o read-cache.o refs.o run-command.o \ server-info.o setup.o sha1_file.o sha1_name.o strbuf.o \ @@ -234,7 +239,6 @@ ifeq ($(uname_O),Cygwin) # NO_MMAP = YesPlease NO_IPV6 = YesPlease X = .exe - ALL_CFLAGS += -DUSE_SYMLINK_HEAD=0 endif ifeq ($(uname_S),OpenBSD) NO_STRCASESTR = YesPlease @@ -366,13 +370,16 @@ LIB_OBJS += $(COMPAT_OBJS) export prefix TAR INSTALL DESTDIR SHELL_PATH template_dir ### Build rules -all: $(ALL_PROGRAMS) +all: $(ALL_PROGRAMS) git$X gitk all: $(MAKE) -C templates +strip: $(PROGRAMS) git$X + $(STRIP) $(STRIP_OPTS) $(PROGRAMS) git$X + git$X: git.c $(LIB_FILE) - $(CC) -DGIT_EXEC_PATH='"$(bindir)"' -DGIT_VERSION='"$(GIT_VERSION)"' \ + $(CC) -DGIT_VERSION='"$(GIT_VERSION)"' \ $(CFLAGS) $(COMPAT_CFLAGS) -o $@ $(filter %.c,$^) $(LIB_FILE) $(patsubst %.sh,%,$(SCRIPT_SH)) : % : %.sh @@ -412,6 +419,8 @@ git$X git.spec \ %.o: %.S $(CC) -o $*.o -c $(ALL_CFLAGS) $< +exec_cmd.o: ALL_CFLAGS += -DGIT_EXEC_PATH=\"$(gitexecdir)\" + git-%$X: %.o $(LIB_FILE) $(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(LIBS) @@ -468,7 +477,9 @@ check: install: all $(INSTALL) -d -m755 $(call shellquote,$(DESTDIR)$(bindir)) - $(INSTALL) $(ALL_PROGRAMS) $(call shellquote,$(DESTDIR)$(bindir)) + $(INSTALL) -d -m755 $(call shellquote,$(DESTDIR)$(gitexecdir)) + $(INSTALL) $(ALL_PROGRAMS) $(call shellquote,$(DESTDIR)$(gitexecdir)) + $(INSTALL) git$X gitk $(call shellquote,$(DESTDIR)$(bindir)) $(MAKE) -C templates install $(INSTALL) -d -m755 $(call shellquote,$(DESTDIR)$(GIT_PYTHON_DIR)) $(INSTALL) $(PYMODULES) $(call shellquote,$(DESTDIR)$(GIT_PYTHON_DIR)) @@ -502,8 +513,7 @@ rpm: dist clean: rm -f *.o mozilla-sha1/*.o arm/*.o ppc/*.o compat/*.o $(LIB_FILE) - rm -f $(PROGRAMS) $(SIMPLE_PROGRAMS) git$X - rm -f $(filter-out gitk,$(SCRIPTS)) + rm -f $(ALL_PROGRAMS) git$X rm -f *.spec *.pyc *.pyo */*.pyc */*.pyo rm -rf $(GIT_TARNAME) rm -f $(GIT_TARNAME).tar.gz git-core_$(GIT_VERSION)-*.tar.gz @@ -512,6 +522,6 @@ clean: $(MAKE) -C t/ clean rm -f GIT-VERSION-FILE -.PHONY: all install clean +.PHONY: all install clean strip .PHONY: .FORCE-GIT-VERSION-FILE