summaryrefslogtreecommitdiff
path: root/contrib/scalar/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/scalar/Makefile')
-rw-r--r--contrib/scalar/Makefile35
1 files changed, 35 insertions, 0 deletions
diff --git a/contrib/scalar/Makefile b/contrib/scalar/Makefile
new file mode 100644
index 0000000000..5e86d78e19
--- /dev/null
+++ b/contrib/scalar/Makefile
@@ -0,0 +1,35 @@
+# The default target of this Makefile is...
+all::
+
+# Import tree-wide shared Makefile behavior and libraries
+include ../../shared.mak
+
+include ../../config.mak.uname
+-include ../../config.mak.autogen
+-include ../../config.mak
+
+TARGETS = scalar$(X) scalar.o
+GITLIBS = ../../common-main.o ../../libgit.a ../../xdiff/lib.a
+
+all: scalar$(X) ../../bin-wrappers/scalar
+
+$(GITLIBS):
+ $(QUIET_SUBDIR0)../.. $(QUIET_SUBDIR1) $(subst ../../,,$@)
+
+$(TARGETS): $(GITLIBS) scalar.c
+ $(QUIET_SUBDIR0)../.. $(QUIET_SUBDIR1) $(patsubst %,contrib/scalar/%,$@)
+
+clean:
+ $(RM) $(TARGETS) ../../bin-wrappers/scalar
+
+../../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