Skip to content

Commit 95bcd6f

Browse files
pks-tgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 3f145a4 commit 95bcd6f

File tree

6 files changed

+16
-8
lines changed

6 files changed

+16
-8
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
/GIT-TEST-SUITES
1313
/GIT-USER-AGENT
1414
/GIT-VERSION-FILE
15-
/bin-wrappers/
1615
/git
1716
/git-add
1817
/git-am

Documentation/CodingGuidelines

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -583,7 +583,7 @@ For C programs:
583583
Run `GIT_DEBUGGER=1 ./bin-wrappers/git foo` to simply use gdb as is, or
584584
run `GIT_DEBUGGER="<debugger> <debugger-args>" ./bin-wrappers/git foo` to
585585
use your own debugger and arguments. Example: `GIT_DEBUGGER="ddd --gdb"
586-
./bin-wrappers/git log` (See `wrap-for-bin.sh`.)
586+
./bin-wrappers/git log` (See `bin-wrappers/wrap-for-bin.sh`.)
587587

588588
- The primary data structure that a subsystem 'S' deals with is called
589589
`struct S`. Functions that operate on `struct S` are named

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3202,8 +3202,7 @@ test_bindir_programs := $(patsubst %,bin-wrappers/%,$(BINDIR_PROGRAMS_NEED_X) $(
32023202

32033203
all:: $(TEST_PROGRAMS) $(test_bindir_programs) $(UNIT_TEST_PROGS) $(CLAR_TEST_PROG)
32043204

3205-
bin-wrappers/%: wrap-for-bin.sh
3206-
$(call mkdir_p_parent_template)
3205+
$(test_bindir_programs): bin-wrappers/%: bin-wrappers/wrap-for-bin.sh
32073206
$(QUIET_GEN)sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \
32083207
-e 's|@BUILD_DIR@|$(shell pwd)|' \
32093208
-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
37003699
$(RM) $(SP_OBJ)
37013700
$(RM) $(HCC)
37023701
$(RM) version-def.h
3703-
$(RM) -r bin-wrappers $(dep_dirs) $(compdb_dir) compile_commands.json
3702+
$(RM) -r $(dep_dirs) $(compdb_dir) compile_commands.json
3703+
$(RM) $(test_bindir_programs)
37043704
$(RM) -r po/build/
37053705
$(RM) *.pyc *.pyo */*.pyc */*.pyo $(GENERATED_H) $(ETAGS_TARGET) tags cscope*
37063706
$(RM) -r .dist-tmp-dir .doc-tmp-dir

bin-wrappers/.gitignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/git
2+
/git-cvsserver
3+
/git-receive-pack
4+
/git-shell
5+
/git-upload-archive
6+
/git-upload-pack
7+
/scalar
8+
/test-fake-ssh
9+
/test-tool
File renamed without changes.

contrib/buildsystems/CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1095,20 +1095,20 @@ set(wrapper_test_scripts
10951095

10961096

10971097
foreach(script ${wrapper_scripts})
1098-
file(STRINGS ${CMAKE_SOURCE_DIR}/wrap-for-bin.sh content NEWLINE_CONSUME)
1098+
file(STRINGS ${CMAKE_SOURCE_DIR}/bin-wrappers/wrap-for-bin.sh content NEWLINE_CONSUME)
10991099
string(REPLACE "@BUILD_DIR@" "${CMAKE_BINARY_DIR}" content "${content}")
11001100
string(REPLACE "@PROG@" "${script}${EXE_EXTENSION}" content "${content}")
11011101
file(WRITE ${CMAKE_BINARY_DIR}/bin-wrappers/${script} ${content})
11021102
endforeach()
11031103

11041104
foreach(script ${wrapper_test_scripts})
1105-
file(STRINGS ${CMAKE_SOURCE_DIR}/wrap-for-bin.sh content NEWLINE_CONSUME)
1105+
file(STRINGS ${CMAKE_SOURCE_DIR}/bin-wrappers/wrap-for-bin.sh content NEWLINE_CONSUME)
11061106
string(REPLACE "@BUILD_DIR@" "${CMAKE_BINARY_DIR}" content "${content}")
11071107
string(REPLACE "@PROG@" "t/helper/${script}${EXE_EXTENSION}" content "${content}")
11081108
file(WRITE ${CMAKE_BINARY_DIR}/bin-wrappers/${script} ${content})
11091109
endforeach()
11101110

1111-
file(STRINGS ${CMAKE_SOURCE_DIR}/wrap-for-bin.sh content NEWLINE_CONSUME)
1111+
file(STRINGS ${CMAKE_SOURCE_DIR}/bin-wrappers/wrap-for-bin.sh content NEWLINE_CONSUME)
11121112
string(REPLACE "@BUILD_DIR@" "${CMAKE_BINARY_DIR}" content "${content}")
11131113
string(REPLACE "@PROG@" "git-cvsserver" content "${content}")
11141114
file(WRITE ${CMAKE_BINARY_DIR}/bin-wrappers/git-cvsserver ${content})

0 commit comments

Comments
 (0)