Johannes Schindelin | 0a43fb2 | 2021-12-03 13:34:16 +0000 | [diff] [blame] | 1 | QUIET_SUBDIR0 = +$(MAKE) -C # space to separate -C and subdir |
| 2 | QUIET_SUBDIR1 = |
| 3 | |
| 4 | ifneq ($(findstring s,$(MAKEFLAGS)),s) |
| 5 | ifndef V |
Johannes Schindelin | 9187659 | 2021-12-03 13:34:18 +0000 | [diff] [blame] | 6 | QUIET_GEN = @echo ' ' GEN $@; |
Johannes Schindelin | 0a43fb2 | 2021-12-03 13:34:16 +0000 | [diff] [blame] | 7 | QUIET_SUBDIR0 = +@subdir= |
| 8 | QUIET_SUBDIR1 = ;$(NO_SUBDIR) echo ' ' SUBDIR $$subdir; \ |
| 9 | $(MAKE) $(PRINT_DIR) -C $$subdir |
| 10 | else |
| 11 | export V |
| 12 | endif |
| 13 | endif |
| 14 | |
| 15 | all: |
| 16 | |
| 17 | include ../../config.mak.uname |
| 18 | -include ../../config.mak.autogen |
| 19 | -include ../../config.mak |
| 20 | |
| 21 | TARGETS = scalar$(X) scalar.o |
| 22 | GITLIBS = ../../common-main.o ../../libgit.a ../../xdiff/lib.a |
| 23 | |
Johannes Schindelin | 9187659 | 2021-12-03 13:34:18 +0000 | [diff] [blame] | 24 | all: scalar$(X) ../../bin-wrappers/scalar |
Johannes Schindelin | 0a43fb2 | 2021-12-03 13:34:16 +0000 | [diff] [blame] | 25 | |
| 26 | $(GITLIBS): |
| 27 | $(QUIET_SUBDIR0)../.. $(QUIET_SUBDIR1) $(subst ../../,,$@) |
| 28 | |
| 29 | $(TARGETS): $(GITLIBS) scalar.c |
| 30 | $(QUIET_SUBDIR0)../.. $(QUIET_SUBDIR1) $(patsubst %,contrib/scalar/%,$@) |
| 31 | |
| 32 | clean: |
Johannes Schindelin | 9187659 | 2021-12-03 13:34:18 +0000 | [diff] [blame] | 33 | $(RM) $(TARGETS) ../../bin-wrappers/scalar |
Johannes Schindelin | 0a43fb2 | 2021-12-03 13:34:16 +0000 | [diff] [blame] | 34 | |
Johannes Schindelin | 9187659 | 2021-12-03 13:34:18 +0000 | [diff] [blame] | 35 | ../../bin-wrappers/scalar: ../../wrap-for-bin.sh Makefile |
| 36 | @mkdir -p ../../bin-wrappers |
| 37 | $(QUIET_GEN)sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \ |
| 38 | -e 's|@@BUILD_DIR@@|$(shell cd ../.. && pwd)|' \ |
| 39 | -e 's|@@PROG@@|contrib/scalar/scalar$(X)|' < $< > $@ && \ |
| 40 | chmod +x $@ |
| 41 | |
| 42 | test: all |
| 43 | $(MAKE) -C t |
| 44 | |
| 45 | .PHONY: $(GITLIBS) all clean test FORCE |