aboutsummaryrefslogtreecommitdiff
path: root/contrib/shunit2-2.0.3/Makefile
diff options
context:
space:
mode:
authorPjotr Prins2017-08-20 09:22:43 +0000
committerPjotr Prins2017-08-20 09:22:43 +0000
commit2e76646998df0ca1b7d160329c0f3ac8cdda2fe0 (patch)
tree8a1ba0770e2344469c58290d4192db186d9439cb /contrib/shunit2-2.0.3/Makefile
parent7fc4e3c0a0d6e32ca6685647e107473f1d96c3e5 (diff)
downloadpangemma-2e76646998df0ca1b7d160329c0f3ac8cdda2fe0.tar.gz
Move shunit2 into ./contrib and add catch-1.8.7
Diffstat (limited to 'contrib/shunit2-2.0.3/Makefile')
-rw-r--r--contrib/shunit2-2.0.3/Makefile89
1 files changed, 89 insertions, 0 deletions
diff --git a/contrib/shunit2-2.0.3/Makefile b/contrib/shunit2-2.0.3/Makefile
new file mode 100644
index 0000000..effbcca
--- /dev/null
+++ b/contrib/shunit2-2.0.3/Makefile
@@ -0,0 +1,89 @@
+# $Id$
+
+PROG=shunit2
+
+BIN_DIR=$(PWD)/bin
+BUILD_DIR=$(PWD)/build
+DIST_DIR=$(PWD)/dist
+LIB_DIR=$(PWD)/lib
+SHARE_DIR=$(PWD)/share
+SRC_DIR=$(PWD)/src
+TEST_DIR=$(PWD)/test
+TMP_DIR=$(PWD)/tmp
+
+DOCBOOK_BUILD_DIR=$(BUILD_DIR)/docbook
+DOCBOOK_SHARE_DIR=$(SHARE_DIR)/docbook
+
+DOCBOOK_SRC_DIR=$(SRC_DIR)/docbook
+EXAMPLES_SRC_DIR=$(SRC_DIR)/examples
+SHELL_SRC_DIR=$(SRC_DIR)/shell
+TEST_SRC_DIR=$(SRC_DIR)/test
+
+HTML_XSL=$(SHARE_DIR)/docbook/tldp-xsl/21MAR2004/html/tldp-one-page.xsl
+
+all: build docs
+
+build: build-prep
+ cp -p $(SHELL_SRC_DIR)/$(PROG) $(BUILD_DIR)
+
+build-clean:
+ rm -fr $(BUILD_DIR)
+
+build-prep:
+ @mkdir -p $(BUILD_DIR)
+
+docs: docs-transform-shelldoc docs-transform-docbook
+
+docs-prep:
+ @mkdir -p $(DOCBOOK_BUILD_DIR)
+ @echo "Preparing documentation for parsing"
+ @isoDate=`date "+%Y-%m-%d"`; \
+ find $(DOCBOOK_SRC_DIR) -name "*.xml" |\
+ while read f; do \
+ bn=`basename $$f`; \
+ sed -e "s/@@ISO_DATE@@/$$isoDate/g" $$f >$(DOCBOOK_BUILD_DIR)/$$bn; \
+ done
+
+docs-extract-shelldoc: docs-prep
+ @echo "Extracting the ShellDoc"
+ @$(BIN_DIR)/extractDocs.pl $(SHELL_SRC_DIR)/$(PROG) >$(BUILD_DIR)/$(PROG)_shelldoc.xml
+
+docs-transform-shelldoc: docs-prep docs-extract-shelldoc
+ @echo "Parsing the extracted ShellDoc"
+ @xsltproc $(SHARE_DIR)/resources/shelldoc.xslt $(BUILD_DIR)/$(PROG)_shelldoc.xml >$(DOCBOOK_BUILD_DIR)/functions.xml
+
+docs-transform-docbook: docs-docbook-prep docs-prep
+ @echo "Parsing the documentation with DocBook"
+ @xsltproc $(HTML_XSL) $(DOCBOOK_BUILD_DIR)/$(PROG).xml >$(BUILD_DIR)/$(PROG).html
+
+docs-docbook-prep:
+ @if [ ! -d "$(DOCBOOK_SHARE_DIR)/docbook-xml" \
+ -o ! -d "$(DOCBOOK_SHARE_DIR)/docbook-xsl" ]; \
+ then \
+ echo "Preparing DocBook structure"; \
+ $(BIN_DIR)/docbookPrep.sh "$(DOCBOOK_SHARE_DIR)"; \
+ fi
+
+test: test-prep
+ @echo "executing $(PROG) unit tests"
+ ( cd $(TEST_DIR); $(TEST_SRC_DIR)/run-test-suite )
+
+test-clean:
+ rm -fr $(TEST_DIR)
+
+test-prep: build test-clean
+ @mkdir -p $(TEST_DIR)
+ cp -p $(TEST_SRC_DIR)/test* $(TEST_DIR)
+ cp -p $(TEST_SRC_DIR)/run-test-suite $(TEST_DIR)
+ cp -p $(BUILD_DIR)/$(PROG) $(TEST_DIR)
+
+dist: dist-clean build docs
+ @mkdir $(DIST_DIR)
+ cp -p $(BUILD_DIR)/$(PROG) $(DIST_DIR)
+ cp -p $(BUILD_DIR)/$(PROG).html $(DIST_DIR)
+
+clean: build-clean test-clean
+ rm -fr $(TMP_DIR)
+
+dist-clean: clean
+ rm -fr $(DIST_DIR)