Commit 565514e6 authored by Niels Bunkenburg's avatar Niels Bunkenburg

Fix Makefile #54

parent 585f3205
......@@ -24,6 +24,15 @@ SOURCE_FILES := $(shell find $(SRCDIR) -type f -name "*.curry")
# The load path for the Spicey application:
export CURRYPATH := $(SRCDIR):$(SRCDIR)/Model
# Executable of CPNSD:
CPNSD := $(shell which curry-cpnsd)
# Executable of the CGI registry and submission form:
CURRYCGI := $(shell which curry-cgi)
# Executable of the makecgi:
MAKECGI := $(shell which curry-makecgi)
############################################################################
.PHONY: all
all:
@echo "make: deploy install compile load run clean?"
......@@ -35,6 +44,19 @@ install: .cpm
.cpm:
$(CPM) update
$(CPM) install
# check presence of tools required for deployment and install them:
.PHONY: checkdeploy
checkdeploy:
@if [ ! -x "$(CPNSD)" ] ; then \
echo "Installing required executable 'curry-cpnsd'..." ; \
$(CPM) install cpns ; fi
@if [ ! -x "$(CURRYCGI)" ] ; then \
echo "Installing required executable 'curry-cgi'..." ; \
$(CPM) install html-cgi ; fi
@if [ ! -x "$(MAKECGI)" ] ; then \
echo "Installing required executable 'curry-makecgi'..." ; \
$(CPM) install html ; fi
# Compile the generated Spicey application:
.PHONY: compile
......@@ -57,7 +79,7 @@ run:
$(WEBSERVERDIR)/run.cgi: .cpm $(SOURCE_FILES)
mkdir -p $(WEBSERVERDIR)
-mv $(WEBSERVERDIR)/spicey.cgi $(WEBSERVERDIR)/spicey.cgi.tmp || true
$(CPM) exec $(CURRYBIN)curry makecgi -standalone -m main -o $(WEBSERVERDIR)/spicey.cgi Main.curry
$(CPM) exec $(MAKECGI) -standalone -m main -o $(WEBSERVERDIR)/spicey.cgi Main.curry
mv $(WEBSERVERDIR)/spicey.cgi $@
-mv $(WEBSERVERDIR)/spicey.cgi.tmp $(WEBSERVERDIR)/spicey.cgi || true
......@@ -68,14 +90,10 @@ $(WEBSERVERDIR)/spicey.cgi: $(SRCDIR)/FileUpload/Main.hs
# Deploy the generated Spicey application, i.e., install it in the
# web directory WEBSERVERDIR:
.PHONY: deploy
deploy: $(WEBSERVERDIR)/run.cgi $(WEBSERVERDIR)/spicey.cgi public/*
deploy: checkdeploy $(WEBSERVERDIR)/run.cgi $(WEBSERVERDIR)/spicey.cgi public/*
cp -r public/* $(WEBSERVERDIR)
chmod -R go+rX $(WEBSERVERDIR)
# clean up generated the package directory
.PHONY: clean
clean:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment