From: Jiang Xin Date: Tue, 28 Feb 2012 04:23:26 +0000 (+0800) Subject: Merge branch 'master' into git-po X-Git-Tag: v1.7.10-rc1~10^2~16 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/508d1244dc8d38188c70e98207efa8a97d16b47c?hp=-c Merge branch 'master' into git-po --- 508d1244dc8d38188c70e98207efa8a97d16b47c diff --combined Makefile index 8826857126,cf2c40b44f..be1957a5e9 --- a/Makefile +++ b/Makefile @@@ -56,6 -56,10 +56,10 @@@ all: # FreeBSD can use either, but MinGW and some others need to use # libcharset.h's locale_charset() instead. # + # Define CHARSET_LIB to you need to link with library other than -liconv to + # use locale_charset() function. On some platforms this needs to set to + # -lcharset + # # Define LIBC_CONTAINS_LIBINTL if your gettext implementation doesn't # need -lintl when linking. # @@@ -342,7 -346,7 +346,7 @@@ pathsep = export prefix bindir sharedir sysconfdir gitwebdir localedir - CC = gcc + CC = cc AR = ar RM = rm -f DIFF = diff @@@ -460,6 -464,9 +464,9 @@@ PROGRAM_OBJS += http-backend. PROGRAM_OBJS += sh-i18n--envsubst.o PROGRAM_OBJS += credential-store.o + # Binary suffix, set to .exe for Windows builds + X = + PROGRAMS += $(patsubst %.o,git-%$X,$(PROGRAM_OBJS)) TEST_PROGRAMS_NEED_X += test-chmtime @@@ -613,6 -620,7 +620,7 @@@ LIB_H += streaming. LIB_H += string-list.h LIB_H += submodule.h LIB_H += tag.h + LIB_H += thread-utils.h LIB_H += transport.h LIB_H += tree.h LIB_H += tree-walk.h @@@ -1698,6 -1706,7 +1706,7 @@@ endi ifdef HAVE_LIBCHARSET_H BASIC_CFLAGS += -DHAVE_LIBCHARSET_H + EXTLIBS += $(CHARSET_LIB) endif ifdef HAVE_DEV_TTY @@@ -1774,6 -1783,26 +1783,26 @@@ ifdef ASCIIDOC export ASCIIDOC7 endif + ### profile feedback build + # + + # Can adjust this to be a global directory if you want to do extended + # data gathering + PROFILE_DIR := $(CURDIR) + + ifeq ("$(PROFILE)","GEN") + CFLAGS += -fprofile-generate=$(PROFILE_DIR) -DNO_NORETURN=1 + EXTLIBS += -lgcov + export CCACHE_DISABLE=t + V=1 + else + ifneq ("$(PROFILE)","") + CFLAGS += -fprofile-use=$(PROFILE_DIR) -fprofile-correction -DNO_NORETURN=1 + export CCACHE_DISABLE=t + V=1 + endif + endif + # Shell quote (do not use $(call) to accommodate ancient setups); SHA1_HEADER_SQ = $(subst ','\'',$(SHA1_HEADER)) @@@ -1830,7 -1859,17 +1859,17 @@@ export DIFF TAR INSTALL DESTDIR SHELL_P SHELL = $(SHELL_PATH) - all:: shell_compatibility_test $(ALL_PROGRAMS) $(SCRIPT_LIB) $(BUILT_INS) $(OTHER_PROGRAMS) GIT-BUILD-OPTIONS + all:: shell_compatibility_test + + ifeq "$(PROFILE)" "BUILD" + ifeq ($(filter all,$(MAKECMDGOALS)),all) + all:: profile-clean + $(MAKE) PROFILE=GEN all + $(MAKE) PROFILE=GEN -j1 test + endif + endif + + all:: $(ALL_PROGRAMS) $(SCRIPT_LIB) $(BUILT_INS) $(OTHER_PROGRAMS) GIT-BUILD-OPTIONS ifneq (,$X) $(QUIET_BUILT_IN)$(foreach p,$(patsubst %$X,%,$(filter %$X,$(ALL_PROGRAMS) $(BUILT_INS) git$X)), test -d '$p' -o '$p' -ef '$p$X' || $(RM) '$p';) endif @@@ -2323,6 -2362,10 +2362,10 @@@ GIT-BUILD-OPTIONS: FORC @echo USE_LIBPCRE=\''$(subst ','\'',$(subst ','\'',$(USE_LIBPCRE)))'\' >>$@ @echo NO_PERL=\''$(subst ','\'',$(subst ','\'',$(NO_PERL)))'\' >>$@ @echo NO_PYTHON=\''$(subst ','\'',$(subst ','\'',$(NO_PYTHON)))'\' >>$@ + @echo NO_UNIX_SOCKETS=\''$(subst ','\'',$(subst ','\'',$(NO_UNIX_SOCKETS)))'\' >>$@ + ifdef GIT_TEST_OPTS + @echo GIT_TEST_OPTS=\''$(subst ','\'',$(subst ','\'',$(GIT_TEST_OPTS)))'\' >>$@ + endif ifdef GIT_TEST_CMP @echo GIT_TEST_CMP=\''$(subst ','\'',$(subst ','\'',$(GIT_TEST_CMP)))'\' >>$@ endif @@@ -2331,7 -2374,18 +2374,18 @@@ ifdef GIT_TEST_CMP_USE_COPIED_CONTEX endif @echo NO_GETTEXT=\''$(subst ','\'',$(subst ','\'',$(NO_GETTEXT)))'\' >>$@ @echo GETTEXT_POISON=\''$(subst ','\'',$(subst ','\'',$(GETTEXT_POISON)))'\' >>$@ - @echo NO_UNIX_SOCKETS=\''$(subst ','\'',$(subst ','\'',$(NO_UNIX_SOCKETS)))'\' >>$@ + ifdef GIT_PERF_REPEAT_COUNT + @echo GIT_PERF_REPEAT_COUNT=\''$(subst ','\'',$(subst ','\'',$(GIT_PERF_REPEAT_COUNT)))'\' >>$@ + endif + ifdef GIT_PERF_REPO + @echo GIT_PERF_REPO=\''$(subst ','\'',$(subst ','\'',$(GIT_PERF_REPO)))'\' >>$@ + endif + ifdef GIT_PERF_LARGE_REPO + @echo GIT_PERF_LARGE_REPO=\''$(subst ','\'',$(subst ','\'',$(GIT_PERF_LARGE_REPO)))'\' >>$@ + endif + ifdef GIT_PERF_MAKE_OPTS + @echo GIT_PERF_MAKE_OPTS=\''$(subst ','\'',$(subst ','\'',$(GIT_PERF_MAKE_OPTS)))'\' >>$@ + endif ### Detect Tck/Tk interpreter path changes ifndef NO_TCLTK @@@ -2367,6 -2421,11 +2421,11 @@@ export NO_SVN_TEST test: all $(MAKE) -C t/ all + perf: all + $(MAKE) -C t/perf/ all + + .PHONY: test perf + test-ctype$X: ctype.o test-date$X: date.o ctype.o @@@ -2576,8 -2635,13 +2635,12 @@@ dist-doc distclean: clean $(RM) configure - $(RM) po/git.pot - clean: + profile-clean: + $(RM) $(addsuffix *.gcda,$(addprefix $(PROFILE_DIR)/, $(object_dirs))) + $(RM) $(addsuffix *.gcno,$(addprefix $(PROFILE_DIR)/, $(object_dirs))) + + clean: profile-clean $(RM) *.o block-sha1/*.o ppc/*.o compat/*.o compat/*/*.o xdiff/*.o vcs-svn/*.o \ builtin/*.o $(LIB_FILE) $(XDIFF_LIB) $(VCSSVN_LIB) $(RM) $(ALL_PROGRAMS) $(SCRIPT_LIB) $(BUILT_INS) git$X @@@ -2607,7 -2671,7 +2670,7 @@@ ifndef NO_TCLT endif $(RM) GIT-VERSION-FILE GIT-CFLAGS GIT-LDFLAGS GIT-GUI-VARS GIT-BUILD-OPTIONS - .PHONY: all install clean strip + .PHONY: all install profile-clean clean strip .PHONY: shell_compatibility_test please_set_SHELL_PATH_to_a_more_modern_shell .PHONY: FORCE cscope @@@ -2717,18 -2781,3 +2780,3 @@@ cover_db: coverage-repor cover_db_html: cover_db cover -report html -outputdir cover_db_html cover_db - ### profile feedback build - # - .PHONY: profile-all profile-clean - - PROFILE_GEN_CFLAGS := $(CFLAGS) -fprofile-generate -DNO_NORETURN=1 - PROFILE_USE_CFLAGS := $(CFLAGS) -fprofile-use -fprofile-correction -DNO_NORETURN=1 - - profile-clean: - $(RM) $(addsuffix *.gcda,$(object_dirs)) - $(RM) $(addsuffix *.gcno,$(object_dirs)) - - profile-all: profile-clean - $(MAKE) CFLAGS="$(PROFILE_GEN_CFLAGS)" all - $(MAKE) CFLAGS="$(PROFILE_GEN_CFLAGS)" -j1 test - $(MAKE) CFLAGS="$(PROFILE_USE_CFLAGS)" all