From ddf972cf48f5e73998b12cf64c96bde46ee57d63 Mon Sep 17 00:00:00 2001 From: Tissevert Date: Thu, 14 Feb 2019 19:17:54 +0100 Subject: [PATCH] Add a Makefile to compile all the lib into a single module --- Makefile | 15 +++++++++++++++ unit.js.tpl | 16 ++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 Makefile create mode 100755 unit.js.tpl diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..9d6aeec --- /dev/null +++ b/Makefile @@ -0,0 +1,15 @@ +BUILD_DIR=dist +TARGET=$(BUILD_DIR)/unit.js +SRC=$(wildcard *.js) +TEMPLATE=unit.js.tpl + +all: $(TARGET) + +$(BUILD_DIR): + mkdir -p $@ + +$(TARGET): $(SRC) $(BUILD_DIR) + ./$(TEMPLATE) $(SRC) > $@ + +mrproper: + rm -rf $(BUILD_DIR) diff --git a/unit.js.tpl b/unit.js.tpl new file mode 100755 index 0000000..2263e4c --- /dev/null +++ b/unit.js.tpl @@ -0,0 +1,16 @@ +#!/bin/bash + +indent() +{ + local tabs="$(printf '\t%.0s' `seq 1 $1`)" + sed "s|^|${tabs}|" +} + +cat <