summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortv <tv@nomic.retiolum>2013-11-06 17:31:48 +0100
committertv <tv@nomic.retiolum>2013-11-06 17:31:48 +0100
commit38255554031cc8d0a52bd9e1731a0a873b3349c7 (patch)
treea10504096c131fac742f97b6cd410b928929b999
parentabc1cda02e3968c8cf19c0fc4cfaf00ed976983f (diff)
ship: s/deploy/make {,inst}all {,dist}clean/
-rwxr-xr-x.graveyard/ship/deploy (renamed from ship/deploy)0
-rw-r--r--ship/Makefile32
2 files changed, 32 insertions, 0 deletions
diff --git a/ship/deploy b/.graveyard/ship/deploy
index cb71d570..cb71d570 100755
--- a/ship/deploy
+++ b/.graveyard/ship/deploy
diff --git a/ship/Makefile b/ship/Makefile
new file mode 100644
index 00000000..0e9b8edf
--- /dev/null
+++ b/ship/Makefile
@@ -0,0 +1,32 @@
+exesrcdir := src
+libsrcdir := lib
+tmpoutdir := tmp
+finoutdir := ../bin
+
+exesrcs := $(notdir $(wildcard $(exesrcdir)/*))
+exetmpouts := $(addprefix $(tmpoutdir)/,$(exesrcs))
+exefinouts := $(addprefix $(finoutdir)/,$(exesrcs))
+
+build := BUILD_PATH=$(libsrcdir) ./build
+
+.PHONY: all install clean distclean
+
+all: $(exetmpouts)
+
+install: $(exefinouts)
+
+clean:
+ rm -f $(exetmpouts)
+
+distclean: clean
+ rm -f $(exefinouts)
+
+define buildrule
+$(tmpoutdir)/$(1): $(exesrcdir)/$(1) $(shell $(build) deps $(exesrcdir)/$(1))
+ $(build) compile $$< $$@
+endef
+
+$(foreach exe, $(exesrcs), $(eval $(call buildrule,$(exe))))
+
+$(finoutdir)/%: $(tmpoutdir)/%
+ cp $< $@