Makefile: allow "bin-wrappers/" directory to exist
The "bin-wrappers/" directory gets created by our build system and is populated with one script for each of our binaries. There isn't anything inherently wrong with the current layout, but it is somewhat hard to adapt for out-of-tree build systems. Adapt the layout such that our "bin-wrappers/" directory always exists and contains our "wrap-for-bin.sh" script to make things a little bit easier for subsequent steps. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
3f145a4fe3
commit
95bcd6f0b7
1
.gitignore
vendored
1
.gitignore
vendored
@@ -12,7 +12,6 @@
|
|||||||
/GIT-TEST-SUITES
|
/GIT-TEST-SUITES
|
||||||
/GIT-USER-AGENT
|
/GIT-USER-AGENT
|
||||||
/GIT-VERSION-FILE
|
/GIT-VERSION-FILE
|
||||||
/bin-wrappers/
|
|
||||||
/git
|
/git
|
||||||
/git-add
|
/git-add
|
||||||
/git-am
|
/git-am
|
||||||
|
|||||||
@@ -583,7 +583,7 @@ For C programs:
|
|||||||
Run `GIT_DEBUGGER=1 ./bin-wrappers/git foo` to simply use gdb as is, or
|
Run `GIT_DEBUGGER=1 ./bin-wrappers/git foo` to simply use gdb as is, or
|
||||||
run `GIT_DEBUGGER="<debugger> <debugger-args>" ./bin-wrappers/git foo` to
|
run `GIT_DEBUGGER="<debugger> <debugger-args>" ./bin-wrappers/git foo` to
|
||||||
use your own debugger and arguments. Example: `GIT_DEBUGGER="ddd --gdb"
|
use your own debugger and arguments. Example: `GIT_DEBUGGER="ddd --gdb"
|
||||||
./bin-wrappers/git log` (See `wrap-for-bin.sh`.)
|
./bin-wrappers/git log` (See `bin-wrappers/wrap-for-bin.sh`.)
|
||||||
|
|
||||||
- The primary data structure that a subsystem 'S' deals with is called
|
- The primary data structure that a subsystem 'S' deals with is called
|
||||||
`struct S`. Functions that operate on `struct S` are named
|
`struct S`. Functions that operate on `struct S` are named
|
||||||
|
|||||||
6
Makefile
6
Makefile
@@ -3202,8 +3202,7 @@ test_bindir_programs := $(patsubst %,bin-wrappers/%,$(BINDIR_PROGRAMS_NEED_X) $(
|
|||||||
|
|
||||||
all:: $(TEST_PROGRAMS) $(test_bindir_programs) $(UNIT_TEST_PROGS) $(CLAR_TEST_PROG)
|
all:: $(TEST_PROGRAMS) $(test_bindir_programs) $(UNIT_TEST_PROGS) $(CLAR_TEST_PROG)
|
||||||
|
|
||||||
bin-wrappers/%: wrap-for-bin.sh
|
$(test_bindir_programs): bin-wrappers/%: bin-wrappers/wrap-for-bin.sh
|
||||||
$(call mkdir_p_parent_template)
|
|
||||||
$(QUIET_GEN)sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \
|
$(QUIET_GEN)sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \
|
||||||
-e 's|@BUILD_DIR@|$(shell pwd)|' \
|
-e 's|@BUILD_DIR@|$(shell pwd)|' \
|
||||||
-e 's|@PROG@|$(patsubst test-%,t/helper/test-%,$(@F))$(if $(filter-out $(BINDIR_PROGRAMS_NO_X),$(@F)),$(X),)|' < $< > $@ && \
|
-e 's|@PROG@|$(patsubst test-%,t/helper/test-%,$(@F))$(if $(filter-out $(BINDIR_PROGRAMS_NO_X),$(@F)),$(X),)|' < $< > $@ && \
|
||||||
@@ -3700,7 +3699,8 @@ clean: profile-clean coverage-clean cocciclean
|
|||||||
$(RM) $(SP_OBJ)
|
$(RM) $(SP_OBJ)
|
||||||
$(RM) $(HCC)
|
$(RM) $(HCC)
|
||||||
$(RM) version-def.h
|
$(RM) version-def.h
|
||||||
$(RM) -r bin-wrappers $(dep_dirs) $(compdb_dir) compile_commands.json
|
$(RM) -r $(dep_dirs) $(compdb_dir) compile_commands.json
|
||||||
|
$(RM) $(test_bindir_programs)
|
||||||
$(RM) -r po/build/
|
$(RM) -r po/build/
|
||||||
$(RM) *.pyc *.pyo */*.pyc */*.pyo $(GENERATED_H) $(ETAGS_TARGET) tags cscope*
|
$(RM) *.pyc *.pyo */*.pyc */*.pyo $(GENERATED_H) $(ETAGS_TARGET) tags cscope*
|
||||||
$(RM) -r .dist-tmp-dir .doc-tmp-dir
|
$(RM) -r .dist-tmp-dir .doc-tmp-dir
|
||||||
|
|||||||
9
bin-wrappers/.gitignore
vendored
Normal file
9
bin-wrappers/.gitignore
vendored
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
/git
|
||||||
|
/git-cvsserver
|
||||||
|
/git-receive-pack
|
||||||
|
/git-shell
|
||||||
|
/git-upload-archive
|
||||||
|
/git-upload-pack
|
||||||
|
/scalar
|
||||||
|
/test-fake-ssh
|
||||||
|
/test-tool
|
||||||
0
wrap-for-bin.sh → bin-wrappers/wrap-for-bin.sh
Normal file → Executable file
0
wrap-for-bin.sh → bin-wrappers/wrap-for-bin.sh
Normal file → Executable file
@@ -1095,20 +1095,20 @@ set(wrapper_test_scripts
|
|||||||
|
|
||||||
|
|
||||||
foreach(script ${wrapper_scripts})
|
foreach(script ${wrapper_scripts})
|
||||||
file(STRINGS ${CMAKE_SOURCE_DIR}/wrap-for-bin.sh content NEWLINE_CONSUME)
|
file(STRINGS ${CMAKE_SOURCE_DIR}/bin-wrappers/wrap-for-bin.sh content NEWLINE_CONSUME)
|
||||||
string(REPLACE "@BUILD_DIR@" "${CMAKE_BINARY_DIR}" content "${content}")
|
string(REPLACE "@BUILD_DIR@" "${CMAKE_BINARY_DIR}" content "${content}")
|
||||||
string(REPLACE "@PROG@" "${script}${EXE_EXTENSION}" content "${content}")
|
string(REPLACE "@PROG@" "${script}${EXE_EXTENSION}" content "${content}")
|
||||||
file(WRITE ${CMAKE_BINARY_DIR}/bin-wrappers/${script} ${content})
|
file(WRITE ${CMAKE_BINARY_DIR}/bin-wrappers/${script} ${content})
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
foreach(script ${wrapper_test_scripts})
|
foreach(script ${wrapper_test_scripts})
|
||||||
file(STRINGS ${CMAKE_SOURCE_DIR}/wrap-for-bin.sh content NEWLINE_CONSUME)
|
file(STRINGS ${CMAKE_SOURCE_DIR}/bin-wrappers/wrap-for-bin.sh content NEWLINE_CONSUME)
|
||||||
string(REPLACE "@BUILD_DIR@" "${CMAKE_BINARY_DIR}" content "${content}")
|
string(REPLACE "@BUILD_DIR@" "${CMAKE_BINARY_DIR}" content "${content}")
|
||||||
string(REPLACE "@PROG@" "t/helper/${script}${EXE_EXTENSION}" content "${content}")
|
string(REPLACE "@PROG@" "t/helper/${script}${EXE_EXTENSION}" content "${content}")
|
||||||
file(WRITE ${CMAKE_BINARY_DIR}/bin-wrappers/${script} ${content})
|
file(WRITE ${CMAKE_BINARY_DIR}/bin-wrappers/${script} ${content})
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
file(STRINGS ${CMAKE_SOURCE_DIR}/wrap-for-bin.sh content NEWLINE_CONSUME)
|
file(STRINGS ${CMAKE_SOURCE_DIR}/bin-wrappers/wrap-for-bin.sh content NEWLINE_CONSUME)
|
||||||
string(REPLACE "@BUILD_DIR@" "${CMAKE_BINARY_DIR}" content "${content}")
|
string(REPLACE "@BUILD_DIR@" "${CMAKE_BINARY_DIR}" content "${content}")
|
||||||
string(REPLACE "@PROG@" "git-cvsserver" content "${content}")
|
string(REPLACE "@PROG@" "git-cvsserver" content "${content}")
|
||||||
file(WRITE ${CMAKE_BINARY_DIR}/bin-wrappers/git-cvsserver ${content})
|
file(WRITE ${CMAKE_BINARY_DIR}/bin-wrappers/git-cvsserver ${content})
|
||||||
|
|||||||
Reference in New Issue
Block a user