blob: 231b1ee17963c5d41a1667428ea7e64f8ac285c3 [file] [log] [blame]
Johannes Schindelin0a43fb22021-12-03 13:34:16 +00001QUIET_SUBDIR0 = +$(MAKE) -C # space to separate -C and subdir
2QUIET_SUBDIR1 =
3
4ifneq ($(findstring s,$(MAKEFLAGS)),s)
5ifndef V
Johannes Schindelin91876592021-12-03 13:34:18 +00006 QUIET_GEN = @echo ' ' GEN $@;
Johannes Schindelin0a43fb22021-12-03 13:34:16 +00007 QUIET_SUBDIR0 = +@subdir=
8 QUIET_SUBDIR1 = ;$(NO_SUBDIR) echo ' ' SUBDIR $$subdir; \
9 $(MAKE) $(PRINT_DIR) -C $$subdir
10else
11 export V
12endif
13endif
14
15all:
16
17include ../../config.mak.uname
18-include ../../config.mak.autogen
19-include ../../config.mak
20
21TARGETS = scalar$(X) scalar.o
22GITLIBS = ../../common-main.o ../../libgit.a ../../xdiff/lib.a
23
Johannes Schindelin91876592021-12-03 13:34:18 +000024all: scalar$(X) ../../bin-wrappers/scalar
Johannes Schindelin0a43fb22021-12-03 13:34:16 +000025
26$(GITLIBS):
27 $(QUIET_SUBDIR0)../.. $(QUIET_SUBDIR1) $(subst ../../,,$@)
28
29$(TARGETS): $(GITLIBS) scalar.c
30 $(QUIET_SUBDIR0)../.. $(QUIET_SUBDIR1) $(patsubst %,contrib/scalar/%,$@)
31
32clean:
Johannes Schindelin91876592021-12-03 13:34:18 +000033 $(RM) $(TARGETS) ../../bin-wrappers/scalar
Johannes Schindelin0a43fb22021-12-03 13:34:16 +000034
Johannes Schindelin91876592021-12-03 13:34:18 +000035../../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
42test: all
43 $(MAKE) -C t
44
45.PHONY: $(GITLIBS) all clean test FORCE