summaryrefslogtreecommitdiffstats
path: root/ship
diff options
context:
space:
mode:
authorlassulus <lassulus@googlemail.com>2013-11-06 18:22:50 +0100
committerlassulus <lassulus@googlemail.com>2013-11-06 18:22:50 +0100
commitb8035a82c362d24c2adf464a1c99fcc098b743c4 (patch)
tree039ebc8342f5889ba2344df74e7fd0bc65792bfb /ship
parent401ca308d6f1c501788729433a9e3c58ddfab590 (diff)
parent1afa7f72d3eae517b3eb742228931694910a087a (diff)
Merge branch 'master' of github.com:krebscode/painload
Diffstat (limited to 'ship')
-rw-r--r--ship/Makefile32
-rw-r--r--ship/README1
-rw-r--r--ship/README.markdown20
-rwxr-xr-xship/deploy9
-rw-r--r--ship/develop5
-rwxr-xr-xship/src/punani (renamed from ship/bin/punani)0
-rw-r--r--ship/tmp/.placeholder (renamed from ship/out/.placeholder)0
7 files changed, 52 insertions, 15 deletions
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 $< $@
diff --git a/ship/README b/ship/README
deleted file mode 100644
index b824b503..00000000
--- a/ship/README
+++ /dev/null
@@ -1 +0,0 @@
-# ship - shellscript installation processor
diff --git a/ship/README.markdown b/ship/README.markdown
new file mode 100644
index 00000000..2882f732
--- /dev/null
+++ b/ship/README.markdown
@@ -0,0 +1,20 @@
+# ship - shellscript installation processor
+
+
+## Make Interface
+
+ Build all executables from `src/` into `tmp/`:
+
+ make [all]
+
+ Build all executables into `tmp/` and `//bin/`:
+
+ make install
+
+ Undo `make [all]`:
+
+ make clean
+
+ Undo `make install`:
+
+ make distclean
diff --git a/ship/deploy b/ship/deploy
deleted file mode 100755
index 411f8eec..00000000
--- a/ship/deploy
+++ /dev/null
@@ -1,9 +0,0 @@
-#!/bin/sh
-set -xeuf
-cd $(dirname $0)
-bindir=$PWD/bin
-libdir=$PWD/lib
-outdir=$PWD/out
-for file in `ls -1 $bindir`;do
- BUILD_PATH=$libdir ./build compile $bindir/$file $outdir/$file
-done
diff --git a/ship/develop b/ship/develop
deleted file mode 100644
index a961f9c2..00000000
--- a/ship/develop
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/bin/sh
-source_all(){
- LIBDIR=${1:-.}
- for i in $LIBDIR/*; do . "$i"; done
-}
diff --git a/ship/bin/punani b/ship/src/punani
index ceabd667..ceabd667 100755
--- a/ship/bin/punani
+++ b/ship/src/punani
diff --git a/ship/out/.placeholder b/ship/tmp/.placeholder
index e69de29b..e69de29b 100644
--- a/ship/out/.placeholder
+++ b/ship/tmp/.placeholder