LIB_OBJS =
PROGRAMS =
SCRIPT_PERL =
+ SCRIPT_PYTHON =
SCRIPT_SH =
--TEST_PROGRAMS =
++TEST_PROGRAMS_NEED_X =
SCRIPT_SH += git-am.sh
SCRIPT_SH += git-bisect.sh
# ... and all the rest that could be moved out of bindir to gitexecdir
PROGRAMS += $(EXTRA_PROGRAMS)
PROGRAMS += git-fast-import$X
- PROGRAMS += git-hash-object$X
PROGRAMS += git-imap-send$X
- PROGRAMS += git-index-pack$X
- PROGRAMS += git-merge-index$X
- PROGRAMS += git-merge-tree$X
- PROGRAMS += git-mktag$X
- PROGRAMS += git-pack-redundant$X
- PROGRAMS += git-patch-id$X
PROGRAMS += git-shell$X
PROGRAMS += git-show-index$X
- PROGRAMS += git-unpack-file$X
PROGRAMS += git-upload-pack$X
- PROGRAMS += git-var$X
PROGRAMS += git-http-backend$X
- TEST_PROGRAMS += test-chmtime$X
- TEST_PROGRAMS += test-ctype$X
- TEST_PROGRAMS += test-date$X
- TEST_PROGRAMS += test-delta$X
- TEST_PROGRAMS += test-dump-cache-tree$X
- TEST_PROGRAMS += test-genrandom$X
- TEST_PROGRAMS += test-match-trees$X
- TEST_PROGRAMS += test-parse-options$X
- TEST_PROGRAMS += test-path-utils$X
- TEST_PROGRAMS += test-sha1$X
- TEST_PROGRAMS += test-sigchain$X
++TEST_PROGRAMS_NEED_X += test-chmtime
++TEST_PROGRAMS_NEED_X += test-ctype
++TEST_PROGRAMS_NEED_X += test-date
++TEST_PROGRAMS_NEED_X += test-delta
++TEST_PROGRAMS_NEED_X += test-dump-cache-tree
++TEST_PROGRAMS_NEED_X += test-genrandom
++TEST_PROGRAMS_NEED_X += test-match-trees
++TEST_PROGRAMS_NEED_X += test-parse-options
++TEST_PROGRAMS_NEED_X += test-path-utils
++TEST_PROGRAMS_NEED_X += test-run-command
++TEST_PROGRAMS_NEED_X += test-sha1
++TEST_PROGRAMS_NEED_X += test-sigchain
++TEST_PROGRAMS_NEED_X += test-index-version
++
++TEST_PROGRAMS := $(patsubst %,%$X,$(TEST_PROGRAMS_NEED_X))
+
# List built-in command $C whose implementation cmd_$C() is not in
# builtin-$C.o but is linked in as part of some other command.
BUILT_INS += $(patsubst builtin-%.o,git-%$X,$(BUILTIN_OBJS))
%.o: %.c GIT-CFLAGS
$(QUIET_CC)$(CC) -o $*.o -c $(ALL_CFLAGS) $<
- %.s: %.c GIT-CFLAGS
+ %.s: %.c GIT-CFLAGS FORCE
$(QUIET_CC)$(CC) -S $(ALL_CFLAGS) $<
- %.o: %.S
+ %.o: %.S GIT-CFLAGS
$(QUIET_CC)$(CC) -o $*.o -c $(ALL_CFLAGS) $<
- exec_cmd.o: exec_cmd.c GIT-CFLAGS
- $(QUIET_CC)$(CC) -o $*.o -c $(ALL_CFLAGS) \
- '-DGIT_EXEC_PATH="$(gitexecdir_SQ)"' \
- '-DBINDIR="$(bindir_relative_SQ)"' \
- '-DPREFIX="$(prefix_SQ)"' \
- $<
+ exec_cmd.s exec_cmd.o: ALL_CFLAGS += \
+ '-DGIT_EXEC_PATH="$(gitexecdir_SQ)"' \
+ '-DBINDIR="$(bindir_relative_SQ)"' \
+ '-DPREFIX="$(prefix_SQ)"'
- builtin-init-db.o: builtin-init-db.c GIT-CFLAGS
- $(QUIET_CC)$(CC) -o $*.o -c $(ALL_CFLAGS) -DDEFAULT_GIT_TEMPLATE_DIR='"$(template_dir_SQ)"' $<
+ builtin-init-db.s builtin-init-db.o: ALL_CFLAGS += \
+ -DDEFAULT_GIT_TEMPLATE_DIR='"$(template_dir_SQ)"'
- config.o: config.c GIT-CFLAGS
- $(QUIET_CC)$(CC) -o $*.o -c $(ALL_CFLAGS) -DETC_GITCONFIG='"$(ETC_GITCONFIG_SQ)"' $<
+ config.s config.o: ALL_CFLAGS += -DETC_GITCONFIG='"$(ETC_GITCONFIG_SQ)"'
- http.o: http.c GIT-CFLAGS
- $(QUIET_CC)$(CC) -o $*.o -c $(ALL_CFLAGS) -DGIT_USER_AGENT='"git/$(GIT_VERSION)"' $<
+ http.s http.o: ALL_CFLAGS += -DGIT_USER_AGENT='"git/$(GIT_VERSION)"'
ifdef NO_EXPAT
- http-walker.o: http-walker.c GIT-CFLAGS
- $(QUIET_CC)$(CC) -o $*.o -c $(ALL_CFLAGS) -DNO_EXPAT $<
-http-walker.o: http.h
+ http-walker.s http-walker.o: ALL_CFLAGS += -DNO_EXPAT
endif
git-%$X: %.o $(GITLIBS)
echo 1>&2 " * new Tcl/Tk interpreter location"; \
echo "$$VARS" >$@; \
fi
-
- .PHONY: .FORCE-GIT-GUI-VARS
endif
--### Testing rules
-
-TEST_PROGRAMS_NEED_X += test-chmtime
-TEST_PROGRAMS_NEED_X += test-ctype
-TEST_PROGRAMS_NEED_X += test-date
-TEST_PROGRAMS_NEED_X += test-delta
-TEST_PROGRAMS_NEED_X += test-dump-cache-tree
-TEST_PROGRAMS_NEED_X += test-genrandom
-TEST_PROGRAMS_NEED_X += test-match-trees
-TEST_PROGRAMS_NEED_X += test-parse-options
-TEST_PROGRAMS_NEED_X += test-path-utils
-TEST_PROGRAMS_NEED_X += test-run-command
-TEST_PROGRAMS_NEED_X += test-sha1
-TEST_PROGRAMS_NEED_X += test-sigchain
-TEST_PROGRAMS_NEED_X += test-index-version
-
-TEST_PROGRAMS = $(patsubst %,%$X,$(TEST_PROGRAMS_NEED_X))
-
+ test_bindir_programs := $(patsubst %,bin-wrappers/%,$(BINDIR_PROGRAMS_NEED_X) $(BINDIR_PROGRAMS_NO_X) $(TEST_PROGRAMS_NEED_X))
- all:: $(TEST_PROGRAMS)
+ all:: $(TEST_PROGRAMS) $(test_bindir_programs)
+
+ bin-wrappers/%: wrap-for-bin.sh
+ @mkdir -p bin-wrappers
+ $(QUIET_GEN)sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \
+ -e 's|@@BUILD_DIR@@|$(shell pwd)|' \
+ -e 's|@@PROG@@|$(@F)|' < $< > $@ && \
+ chmod +x $@
# GNU make supports exporting all variables by "export" without parameters.
# However, the environment gets quite big, and some programs have problems
export NO_SVN_TESTS
++### Testing rules
++
test: all
$(MAKE) -C t/ all