Commit 4f52a318 authored by Björn Peemöller 's avatar Björn Peemöller
Browse files

Established new Makefile structure with new targets - fixes #1249

parent 02945349
......@@ -4,14 +4,10 @@
# - root location of the Curry System specified by variable ROOT
# directories
LIBDIR = $(ROOT)/lib
METADIR = $(LIBDIR)/meta
ANADIR = ../analysis
ANADIR = ../analysis
# binaries
REPL = $(ROOT)/bin/curry
CLEANCURRY = $(ROOT)/bin/cleancurry
INSTALLBIN = $(ROOT)/bin/cass
# binary
TOOL = $(BINDIR)/cass
# Source modules of CASS:
DEPS = Analysis.curry AnalysisCollection.curry AnalysisDependencies.curry \
......@@ -27,14 +23,22 @@ DEPS = Analysis.curry AnalysisCollection.curry AnalysisDependencies.curry \
$(ANADIR)/Demandedness.curry $(ANADIR)/Groundness.curry \
$(ANADIR)/RequiredValues.curry
.PHONY: install
install: cass_worker cass
$(MAKE) uninstall
ln -s $(CURDIR)/cass $(INSTALLBIN)
.PHONY: all compile install clean uninstall
all: compile install clean
compile: cass_worker cass
install: cass
rm -f $(TOOL)
ln -s $(CURDIR)/cass $(TOOL)
clean:
$(CLEANCURRY) -r
.PHONY: uninstall
uninstall:
rm -f $(INSTALLBIN)
rm -f $(TOOL)
rm -f cass_worker cass
# generate executable for analysis worker:
cass_worker: $(DEPS)
......@@ -50,8 +54,3 @@ cass: $(DEPS)
.PHONY: load
load: $(DEPS)
$(REPL) $(REPL_OPTS) :set path $(ANADIR) :l AnalysisServer
.PHONY: clean
clean: uninstall
$(CLEANCURRY) -r
rm -f cass_worker cass
......@@ -13,18 +13,19 @@ export REPL = $(BINDIR)/curry
.PHONY: all
all:
@cd optimize && $(MAKE)
@cd addtypes && $(MAKE)
@cd analysis && $(MAKE)
@cd browser && $(MAKE)
@cd CASS && $(MAKE)
@cd currydoc && $(MAKE)
@cd createmakefile && $(MAKE)
@cd curry2js && $(MAKE)
@cd currydoc && $(MAKE)
@cd currypp && $(MAKE)
@cd createmakefile && $(MAKE)
@cd currytest && $(MAKE)
@cd erd2curry && $(MAKE)
@cd genint && $(MAKE)
@cd importcalls && $(MAKE)
@cd optimize && $(MAKE)
@cd spicey && $(MAKE)
@cd typeinference && $(MAKE)
@cd xmldata && $(MAKE)
......@@ -37,21 +38,59 @@ currydoc:
typeinference:
cd typeinference && $(MAKE)
.PHONY: compile
compile:
@cd addtypes && $(MAKE) compile
@cd analysis && $(MAKE) compile
@cd browser && $(MAKE) compile
@cd CASS && $(MAKE) compile
@cd createmakefile && $(MAKE) compile
@cd curry2js && $(MAKE) compile
@cd currydoc && $(MAKE) compile
@cd currypp && $(MAKE) compile
@cd currytest && $(MAKE) compile
@cd erd2curry && $(MAKE) compile
@cd genint && $(MAKE) compile
@cd importcalls && $(MAKE) compile
@cd optimize && $(MAKE) compile
@cd spicey && $(MAKE) compile
@cd typeinference && $(MAKE) compile
@cd xmldata && $(MAKE) compile
.PHONY: install
install:
@cd addtypes && $(MAKE) install
@cd analysis && $(MAKE) install
@cd browser && $(MAKE) install
@cd CASS && $(MAKE) install
@cd createmakefile && $(MAKE) install
@cd curry2js && $(MAKE) install
@cd currydoc && $(MAKE) install
@cd currypp && $(MAKE) install
@cd currytest && $(MAKE) install
@cd erd2curry && $(MAKE) install
@cd genint && $(MAKE) install
@cd importcalls && $(MAKE) install
@cd optimize && $(MAKE) install
@cd spicey && $(MAKE) install
@cd typeinference && $(MAKE) install
@cd xmldata && $(MAKE) install
.PHONY: clean
clean:
cd optimize && $(MAKE) clean
cd addtypes && $(MAKE) clean
cd analysis && $(MAKE) clean
cd browser && $(MAKE) clean
cd CASS && $(MAKE) clean
cd currydoc && $(MAKE) clean
cd curry2js && $(MAKE) clean
cd currypp && $(MAKE) clean
cd createmakefile && $(MAKE) clean
cd currytest && $(MAKE) clean
cd erd2curry && $(MAKE) clean
cd genint && $(MAKE) clean
cd importcalls && $(MAKE) clean
cd spicey && $(MAKE) clean
cd typeinference && $(MAKE) clean
cd xmldata && $(MAKE) clean
@cd addtypes && $(MAKE) clean
@cd analysis && $(MAKE) clean
@cd browser && $(MAKE) clean
@cd CASS && $(MAKE) clean
@cd createmakefile && $(MAKE) clean
@cd curry2js && $(MAKE) clean
@cd currydoc && $(MAKE) clean
@cd currypp && $(MAKE) clean
@cd currytest && $(MAKE) clean
@cd erd2curry && $(MAKE) clean
@cd genint && $(MAKE) clean
@cd importcalls && $(MAKE) clean
@cd optimize && $(MAKE) clean
@cd spicey && $(MAKE) clean
@cd typeinference && $(MAKE) clean
@cd xmldata && $(MAKE) clean
# Makefile for generating AddTypes tool
TOOL=$(BINDIR)/addtypes
TOOL = $(BINDIR)/addtypes
$(TOOL): AddTypes.curry $(METADIR)/AbstractCurry.curry \
$(LIBDIR)/List.curry $(LIBDIR)/AllSolutions.curry
$(REPL) $(REPL_OPTS) :load AddTypes :save :quit
mv AddTypes $@
.PHONY: all compile install clean uninstall
all: compile install clean
compile: AddTypes
install: AddTypes
mv AddTypes $(TOOL)
.PHONY: clean
clean:
$(CLEANCURRY)
rm -f AddTypes $(TOOL)
rm -f AddTypes
uninstall:
rm -f $(TOOL)
AddTypes: AddTypes.curry $(METADIR)/AbstractCurry.curry \
$(LIBDIR)/List.curry $(LIBDIR)/AllSolutions.curry
$(REPL) $(REPL_OPTS) :load AddTypes :save :quit
# Makefile for cleaning analysis files
.PHONY: clean
ANALYSES = $(wildcard *.curry)
CASS = ../CASS
.PHONY: all compile install clean uninstall
all: compile install clean
compile:
for a in $(ANALYSES); do $(REPL) $(REPL_OPTS) :set path $(CASS) :load $$a :quit; done
install: # nothing to do
clean:
$(CLEANCURRY)
uninstall: # nothing to do
......@@ -4,12 +4,12 @@
# - installed Curry System (PAKCS or KiCS2) specified by variable REPL
# - root location of the Curry System specified by variable ROOT
CURRYTOOLS = $(ROOT)/currytools
CURRYTOOLS = ..
CASS = $(CURRYTOOLS)/CASS
ANADIR = $(CURRYTOOLS)/analysis
# binaries
TOOL = $(BINDIR)/currybrowse
# binary
TOOL = $(BINDIR)/currybrowse
# source modules of the Curry Browser:
DEPS = BrowserGUI.curry ShowFlatCurry.curry Imports.curry \
......@@ -23,29 +23,32 @@ DEPS = BrowserGUI.curry ShowFlatCurry.curry Imports.curry \
LOADPATH = analysis:$(CASS):$(ANADIR):$(CURRYTOOLS)/importcalls:$(CURRYTOOLS)/addtypes
.PHONY: install
install: BrowserGUI SourceProgGUI
$(MAKE) uninstall
ln -s $(CURDIR)/BrowserGUI $(TOOL)
.PHONY: all compile install clean uninstall
all: compile install clean
compile: BrowserGUI SourceProgGUI
install: BrowserGUI
rm -f $(TOOL)
ln -s BrowserGUI $(TOOL)
clean:
$(CLEANCURRY) -r
.PHONY: uninstall
uninstall:
rm -f $(TOOL)
rm -f BrowserGUI SourceProgGUI
# generate executable for Curry Browser:
BrowserGUI: $(DEPS)
$(REPL) $(REPL_OPTS) :set path $(LOADPATH) \
:load BrowserGUI :eval "patchReadmeVersion" :save :quit
SourceProgGUI: SourceProgGUI.curry $(LIBDIR)/GUI.curry
$(REPL) $(REPL_OPTS) :load SourceProgGUI :save :quit
# load the Curry Browser program into the Curry system:
.PHONY: load
load: $(DEPS)
$(REPL) $(REPL_OPTS) :set path $(LOADPATH) :load BrowserGUI
SourceProgGUI: SourceProgGUI.curry $(LIBDIR)/GUI.curry
$(REPL) $(REPL_OPTS) :load SourceProgGUI :save :quit
.PHONY: clean
clean: uninstall
$(CLEANCURRY) -r
rm -f BrowserGUI SourceProgGUI
......@@ -2,8 +2,24 @@
TOOL = $(BINDIR)/currycreatemake
.PHONY: all compile install clean uninstall
all: compile install clean
compile: CreateMakefile
install: CreateMakefile
mv CreateMakefile $(TOOL)
clean:
$(CLEANCURRY)
rm -f CreateMakefile
uninstall:
rm -f $(TOOL)
# generate executable for CreateMakefile program
$(TOOL): CreateMakefile.curry \
CreateMakefile: CreateMakefile.curry \
$(METADIR)/FlatCurry.curry $(METADIR)/FlatCurryRead.curry \
$(LIBDIR)/FilePath.curry \
$(LIBDIR)/PropertyFile.curry \
......@@ -21,9 +37,3 @@ $(TOOL): CreateMakefile.curry \
$(LIBDIR)/System.curry
# create saved state for top-level function "main":
$(REPL) $(REPL_OPTS) :load CreateMakefile :save :quit
mv CreateMakefile $@
.PHONY: clean
clean:
$(CLEANCURRY)
rm -f CreateMakefile $(TOOL)
......@@ -4,14 +4,25 @@
# - installed Curry System (PAKCS or KiCS2) specified by variable REPL
# - root location of the Curry System specified by variable ROOT
TOOL = Curry2JS
TOOL = $(BINDIR)/Curry2JS
# generate executable for the Curry2JavaScript translator
$(TOOL): Curry2JS.curry $(LIBDIR)/JavaScript.curry \
$(METADIR)/CompactFlatCurry.curry $(METADIR)/FlatCurry.curry
$(REPL) $(REPL_OPTS) :load Curry2JS :save :quit
.PHONY: all compile install clean uninstall
all: compile install clean
compile: Curry2JS
install: Curry2JS
mv Curry2JS $(TOOL)
clean:
$(CLEANCURRY)
$(CLEANCURRY) -r
rm -f Curry2JS
uninstall:
rm -f $(TOOL)
# generate executable for the Curry2JavaScript translator
Curry2JS: Curry2JS.curry $(LIBDIR)/JavaScript.curry \
$(METADIR)/CompactFlatCurry.curry $(METADIR)/FlatCurry.curry
$(REPL) $(REPL_OPTS) :load Curry2JS :save :quit
......@@ -25,12 +25,21 @@ DEPS = CurryDoc.curry CurryDocRead.curry CurryDocHtml.curry \
$(ANADIR)/Deterministic.curry $(ANADIR)/TotallyDefined.curry \
$(ANADIR)/Indeterministic.curry $(ANADIR)/SolutionCompleteness.curry
# generate executable for currydoc program
$(TOOL): $(DEPS)
$(REPL) $(REPL_OPTS) :set path $(CASS):$(ANADIR) :load CurryDoc :save :quit
mv CurryDoc $@
.PHONY: all compile install clean uninstall
all: compile install clean
compile: CurryDoc
install: CurryDoc
mv CurryDoc $(TOOL)
.PHONY: clean
clean:
$(CLEANCURRY)
rm -f CurryDoc $(TOOL)
rm -f CurryDoc
uninstall:
rm -f $(TOOL)
# generate executable for currydoc program
CurryDoc: $(DEPS)
$(REPL) $(REPL_OPTS) :set path $(CASS):$(ANADIR) :load CurryDoc :save :quit
......@@ -32,12 +32,20 @@ PARSEDIR = $(SRCDIR)/Parser
MLDIR = $(PARSEDIR)/ML
MAIN = $(SRCDIR)/Translator.curry
.PHONY: install
.PHONY: all compile install clean uninstall
all: compile install clean
compile: Translator
install: Translator
$(MAKE) uninstall
ln -s $(CURDIR)/Translator $(TOOL)
rm -f $(TOOL)
ln -s Translator $(TOOL)
clean:
$(CLEANCURRY) -r
rm -f Translator
.PHONY: uninstall
uninstall:
rm -f $(TOOL)
......@@ -48,13 +56,3 @@ Translator: $(MAIN) $(PARSEDIR)/*.curry $(MLDIR)/*.curry
:load $(MAIN) :save :quit
@echo Compilation finished ...
@echo Version: $(VERSION)
# clean project
.PHONY: clean
clean: uninstall
@echo Cleaning the Curry Integrated Code Translator Project Folder ...
$(CLEANCURRY) -r
rm -f Translator
......@@ -2,14 +2,26 @@
TOOL = $(BINDIR)/currytest
$(TOOL): CurryTest.curry $(METADIR)/FlatCurry.curry \
.PHONY: all compile install clean uninstall
all: compile install clean
compile: CurryTest
install: CurryTest
mv CurryTest $(TOOL)
clean:
$(CLEANCURRY)
rm -f CurryTest
uninstall:
rm -f $(TOOL)
CurryTest: CurryTest.curry $(METADIR)/FlatCurry.curry \
$(LIBDIR)/System.curry $(LIBDIR)/Assertion.curry \
$(LIBDIR)/Directory.curry $(LIBDIR)/Distribution.curry \
$(LIBDIR)/GUI.curry
$(REPL) $(REPL_OPTS) :load CurryTest :save :quit
mv CurryTest $@
.PHONY: clean
clean:
$(CLEANCURRY)
rm -f CurryTest $(TOOL)
......@@ -5,30 +5,31 @@
# - root location of the Curry System specified by variable ROOT
# binaries
REPL = $(ROOT)/bin/curry
CLEANCURRY = $(ROOT)/bin/cleancurry
INSTALLBIN = $(ROOT)/bin/erd2curry
TOOL = $(BINDIR)/erd2curry
# Some modules required by the erd2curry implementation:
DEPS = ERD2Curry.curry CodeGeneration.curry Transformation.curry \
XML2ERD.curry ERDGoodies.curry ERD2Graph.curry \
ERD.curry
.PHONY: install
.PHONY: all compile install clean uninstall
all: compile install clean
compile: erd2curry
install: erd2curry
$(MAKE) uninstall
ln -s $(CURDIR)/erd2curry $(INSTALLBIN)
rm -f $(TOOL)
ln -s erd2curry $(TOOL)
clean: uninstall
$(CLEANCURRY)
rm -f erd2curry
.PHONY: uninstall
uninstall:
rm -f $(INSTALLBIN)
rm -f $(TOOL)
erd2curry: $(DEPS)
# create saved state for top-level function "main":
$(REPL) $(REPL_OPTS) :load ERD2Curry :save "main \"$(CURDIR)\"" :q
mv ERD2Curry $@
.PHONY: clean
clean: uninstall
$(CLEANCURRY)
rm -f erd2curry
# Makefile for generating GenInt tool
TOOL = GenInt
TOOL = $(BINDIR)/GenInt
# generate executable for currydoc program:
$(TOOL): GenInt.curry $(METADIR)/FlatCurry.curry \
$(METADIR)/FlatCurryShow.curry $(METADIR)/FlexRigid.curry \
$(LIBDIR)/List.curry
$(REPL) $(REPL_OPTS) :load GenInt :save :quit
.PHONY: all compile install clean uninstall
all: compile install clean
compile: GenInt
install: GenInt
mv GenInt $(TOOL)
.PHONY: clean
clean:
$(CLEANCURRY)
rm -f GenInt
uninstall:
rm -f $(TOOL)
# generate executable for currydoc program:
GenInt: GenInt.curry $(METADIR)/FlatCurry.curry \
$(METADIR)/FlatCurryShow.curry $(METADIR)/FlexRigid.curry \
$(LIBDIR)/List.curry
$(REPL) $(REPL_OPTS) :load GenInt :save :quit
# Makefile for generating ImportCalls tool
TOOL = ImportCalls
TOOL = $(BINDIR)/ImportCalls
# generate executable for import calls tools:
$(TOOL): ImportCalls.curry $(METADIR)/FlatCurry.curry \
$(LIBDIR)/System.curry $(LIBDIR)/List.curry
$(REPL) $(REPL_OPTS) :load ImportCalls :save :quit
.PHONY: all compile install clean uninstall
all: compile install clean
compile: ImportCalls
install: ImportCalls
.PHONY: clean
clean:
$(CLEANCURRY)
rm -f ImportCalls
uninstall:
rm -f $(TOOL)
# generate executable for import calls tools:
ImportCalls: ImportCalls.curry $(METADIR)/FlatCurry.curry \
$(LIBDIR)/System.curry $(LIBDIR)/List.curry
$(REPL) $(REPL_OPTS) :load ImportCalls :save :quit
......@@ -3,10 +3,19 @@
# Required:
# - root location of the Curry System specified by variable ROOT
.PHONY: all
.PHONY: all compile install clean uninstall
all:
@cd binding_optimization && $(MAKE)
@cd binding_optimization && $(MAKE) all
compile:
@cd binding_optimization && $(MAKE) compile
install:
@cd binding_optimization && $(MAKE) install
.PHONY: clean
clean:
@cd binding_optimization && $(MAKE) clean
uninstall:
@cd binding_optimization && $(MAKE) uninstall
# Makefile for binding optimizer:
# Redefine this variable according to your Curry installation:
CURRYHOME=$(HOME)/pakcs
# directories
ANADIRS=../../analysis:../../CASS
ANADIRS = ../../analysis:../../CASS
# binaries
REPL = $(ROOT)/bin/curry
CLEANCURRY = $(ROOT)/bin/cleancurry
INSTALLBIN = $(ROOT)/currytools/optimize/bindingopt
# TODO: move to $(BINDIR)
TOOL = ../bindingopt
.PHONY: all compile install clean uninstall
all: compile install clean
compile: BindingOpt
.PHONY: install
install: BindingOpt
$(MAKE) uninstall
ln -s $(CURDIR)/BindingOpt $(INSTALLBIN)
rm -f $(TOOL)
ln -s BindingOpt $(TOOL)
clean:
$(CLEANCURRY) -r
rm -f BindingOpt
.PHONY: uninstall
uninstall:
rm -f $(INSTALLBIN)
rm -f $(TOOL)
BindingOpt: BindingOpt.curry
# create executable for top-level function "main":
......@@ -30,17 +34,13 @@ load: BindingOpt.curry
$(REPL) $(REPL_OPTS) :set path $(ANADIRS) :l $<
TESTPROGS = HTML SetFunctions Parser AddTypes CurryStringClassifier Curry2JS
.PHONY: test
test:
$(CURRYHOME)/bin/cleancurry -r
cd examples && $(INSTALLBIN) -f $(TESTPROGS) | tee test.log
cd examples && meld TEST.log test.log
$(CLEANCURRY) -r
cd examples && $(TOOL) -f $(TESTPROGS) | tee test.log
cd examples && meld TEST.log test.log
.PHONY: selftest
selftest:
export CURRYPATH=$(ANADIRS) && ./eqopt -f BindingOpt.curry
.PHONY: clean
clean: uninstall
$(CLEANCURRY) -r
rm -f BindingOpt
......@@ -7,9 +7,7 @@
# - root location of the Curry System specified by variable ROOT
# binaries
REPL = $(ROOT)/bin/curry
CLEANCURRY = $(ROOT)/bin/cleancurry
INSTALLBIN = $(ROOT)/bin/spiceup</