summaryrefslogtreecommitdiff
path: root/contrib/scalar/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/scalar/Makefile')
-rw-r--r--contrib/scalar/Makefile17
1 files changed, 14 insertions, 3 deletions
diff --git a/contrib/scalar/Makefile b/contrib/scalar/Makefile
index f6f0036f0f..231b1ee179 100644
--- a/contrib/scalar/Makefile
+++ b/contrib/scalar/Makefile
@@ -3,6 +3,7 @@ QUIET_SUBDIR1 =
ifneq ($(findstring s,$(MAKEFLAGS)),s)
ifndef V
+ QUIET_GEN = @echo ' ' GEN $@;
QUIET_SUBDIR0 = +@subdir=
QUIET_SUBDIR1 = ;$(NO_SUBDIR) echo ' ' SUBDIR $$subdir; \
$(MAKE) $(PRINT_DIR) -C $$subdir
@@ -20,7 +21,7 @@ include ../../config.mak.uname
TARGETS = scalar$(X) scalar.o
GITLIBS = ../../common-main.o ../../libgit.a ../../xdiff/lib.a
-all: scalar$(X)
+all: scalar$(X) ../../bin-wrappers/scalar
$(GITLIBS):
$(QUIET_SUBDIR0)../.. $(QUIET_SUBDIR1) $(subst ../../,,$@)
@@ -29,6 +30,16 @@ $(TARGETS): $(GITLIBS) scalar.c
$(QUIET_SUBDIR0)../.. $(QUIET_SUBDIR1) $(patsubst %,contrib/scalar/%,$@)
clean:
- $(RM) $(TARGETS)
+ $(RM) $(TARGETS) ../../bin-wrappers/scalar
-.PHONY: $(GITLIBS) all clean FORCE
+../../bin-wrappers/scalar: ../../wrap-for-bin.sh Makefile
+ @mkdir -p ../../bin-wrappers
+ $(QUIET_GEN)sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \
+ -e 's|@@BUILD_DIR@@|$(shell cd ../.. && pwd)|' \
+ -e 's|@@PROG@@|contrib/scalar/scalar$(X)|' < $< > $@ && \
+ chmod +x $@
+
+test: all
+ $(MAKE) -C t
+
+.PHONY: $(GITLIBS) all clean test FORCE