Skip to content

Commit 66e39cf

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 8015c8e commit 66e39cf

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
@@ -3199,8 +3199,7 @@ test_bindir_programs := $(patsubst %,bin-wrappers/%,$(BINDIR_PROGRAMS_NEED_X) $(
31993199

32003200
all:: $(TEST_PROGRAMS) $(test_bindir_programs) $(UNIT_TEST_PROGS) $(CLAR_TEST_PROG)
32013201

3202-
bin-wrappers/%: wrap-for-bin.sh
3203-
$(call mkdir_p_parent_template)
3202+
$(test_bindir_programs): bin-wrappers/%: bin-wrappers/wrap-for-bin.sh
32043203
$(QUIET_GEN)sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \
32053204
-e 's|@BUILD_DIR@|$(shell pwd)|' \
32063205
-e 's|@PROG@|$(patsubst test-%,t/helper/test-%,$(@F))$(if $(filter-out $(BINDIR_PROGRAMS_NO_X),$(@F)),$(X),)|' < $< > $@ && \
@@ -3696,7 +3695,8 @@ clean: profile-clean coverage-clean cocciclean
36963695
$(RM) $(FUZZ_PROGRAMS)
36973696
$(RM) $(SP_OBJ)
36983697
$(RM) $(HCC)
3699-
$(RM) -r bin-wrappers $(dep_dirs) $(compdb_dir) compile_commands.json
3698+
$(RM) -r $(dep_dirs) $(compdb_dir) compile_commands.json
3699+
$(RM) $(test_bindir_programs)
37003700
$(RM) -r po/build/
37013701
$(RM) *.pyc *.pyo */*.pyc */*.pyo $(GENERATED_H) $(ETAGS_TARGET) tags cscope*
37023702
$(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

contrib/buildsystems/CMakeLists.txt

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

10621062

10631063
foreach(script ${wrapper_scripts})
1064-
file(STRINGS ${CMAKE_SOURCE_DIR}/wrap-for-bin.sh content NEWLINE_CONSUME)
1064+
file(STRINGS ${CMAKE_SOURCE_DIR}/bin-wrappers/wrap-for-bin.sh content NEWLINE_CONSUME)
10651065
string(REPLACE "@BUILD_DIR@" "${CMAKE_BINARY_DIR}" content "${content}")
10661066
string(REPLACE "@PROG@" "${script}${EXE_EXTENSION}" content "${content}")
10671067
file(WRITE ${CMAKE_BINARY_DIR}/bin-wrappers/${script} ${content})
10681068
endforeach()
10691069

10701070
foreach(script ${wrapper_test_scripts})
1071-
file(STRINGS ${CMAKE_SOURCE_DIR}/wrap-for-bin.sh content NEWLINE_CONSUME)
1071+
file(STRINGS ${CMAKE_SOURCE_DIR}/bin-wrappers/wrap-for-bin.sh content NEWLINE_CONSUME)
10721072
string(REPLACE "@BUILD_DIR@" "${CMAKE_BINARY_DIR}" content "${content}")
10731073
string(REPLACE "@PROG@" "t/helper/${script}${EXE_EXTENSION}" content "${content}")
10741074
file(WRITE ${CMAKE_BINARY_DIR}/bin-wrappers/${script} ${content})
10751075
endforeach()
10761076

1077-
file(STRINGS ${CMAKE_SOURCE_DIR}/wrap-for-bin.sh content NEWLINE_CONSUME)
1077+
file(STRINGS ${CMAKE_SOURCE_DIR}/bin-wrappers/wrap-for-bin.sh content NEWLINE_CONSUME)
10781078
string(REPLACE "@BUILD_DIR@" "${CMAKE_BINARY_DIR}" content "${content}")
10791079
string(REPLACE "@PROG@" "git-cvsserver" content "${content}")
10801080
file(WRITE ${CMAKE_BINARY_DIR}/bin-wrappers/git-cvsserver ${content})

0 commit comments

Comments
 (0)