Makefile revision d784803f9c752667b4fcf7393d698002bedf3f89
71cef386fae61275b03e203825680b39fedaa8c6Tinderbox User# Author: (c) Klaus L�ttich, Christian Maeder, Uni Bremen 2002-2004
5347c0fcb04eaea19d9f39795646239f487c6207Tinderbox User# This Makefile will compile the new hetcats system and provides also
5347c0fcb04eaea19d9f39795646239f487c6207Tinderbox User# targets for test programs during implementation phases.
d6fa26d0adaec6c910115be34fe7a5a5f402c14fMark Andrews# !!! Note: This makefile is written for GNU make !!!
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# (gmake on solaris ; make on linux)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews####################################################################
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User## Some varibles, which control the compilation
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsCOMMONLIB_PATH = Common/Lib:Common/Lib/Parsec:Common/ATerm:fgl/Data/Graph:fgl/Data/Graph/Inductive:fgl/Data/Graph/Inductive/Aux:fgl/Data/Graph/Inductive/Monad:fgl/Data/Graph/Inductive/Query
9b469e3c59015b1a4899c9d8395168126fe094fdAutomatic UpdaterCLEAN_PATH = utils/DrIFT-src:utils/GenerateRules:utils/InlineAxioms:Common:Logic:CASL:CASL/CCC:Syntax:Static:GUI:HasCASL:Haskell:Modal:CoCASL:COL:CspCASL:ATC:ToHaskell:Proofs:Comorphisms:Isabelle:$(INCLUDE_PATH):Haskell/Hatchet:$(PFE_DRIFTPATH)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews## set ghc imports properly for your system
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsLINUX_IMPORTS = $(wildcard /home/linux-bkb/ghc/ghc-latest/lib/ghc-*/imports)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsDRIFT_ENV = DERIVEPATH='.:ghc:hetcats:${LINUX_IMPORTS}:${GHC_IMPORTS}'
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# the 'replacing spaces' example was taken from the (GNU) Make info manual
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# add PFE_DRIFTPATH to DERIVEPATH if needed
9b469e3c59015b1a4899c9d8395168126fe094fdAutomatic Updater# but name clashes currently prevent ATC generation in a single file
9b469e3c59015b1a4899c9d8395168126fe094fdAutomatic UpdaterPFE_DRIFTPATH = $(subst $(space),:,$(addprefix $(PFE_TOOLDIR)/, $(PFE_DIRS)))
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# override on commandline for other architectures
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsINSTALLDIR = /home/www/agbkb/forschung/formal_methods/CoFI/hets/`utils/sysname.sh`
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsGENERATERULES_deps = utils/GenerateRules/*hs $(DRIFT_deps)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# -ddump-minimal-imports
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User# flags also come in via ../uni/uni-package.conf
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User# but added it here in case of compilation without uni
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsHC_PACKAGE = -package-conf ../uni/uni-package.conf -package uni-davinci \
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox UserPFE_TOOLDIR = $(wildcard ../programatica/tools)
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox UserPFE_DIRS = base/AST base/TI base/parse2 base/parse2/Lexer base/parse2/Parser \
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User base/pretty base/syntax base/lib base/lib/Monads base/Modules base/defs \
7e71f05d8643aca84914437c900cb716444507e4Tinderbox User base/transforms base/transforms/Deriving hs2html \
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User property/pfe property/syntax property/AST property/transforms \
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User property/TI property/defs property/parse2 property/parse2/Parser \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsPFE_PATH = $(addprefix -i$(PFE_TOOLDIR)/, $(PFE_DIRS))
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsPFE_FLAGS = -package data -package text $(PFE_PATH) -DPROGRAMATICA
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews#-fallow-undecidable-instances -fno-monomorphism-restriction
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User### Profiling (only for debugging)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews### Attention every module must be compiled with profiling or the linker
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews### cannot link the various .o files properly. So after switching on
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User### Profiling, do an 'gmake real_clean; gmake'
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews### and comment out HC_PACKAGE variable definition above.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews### Comment in the following line for switching on profiling.
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User#HC_PROF = -prof -auto-all
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsHCI_OPTS = $(HC_FLAGS) $(HC_INCLUDE) $(HC_PACKAGE) $(PFE_FLAGS)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews### list of directories to run checks in
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews####################################################################
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews## sources for hetcats (semi - manually produced with a perl script)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewssources = $(wildcard $(subst :,/*hs , $(SOURCE_PATH))/*hs)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewsobjects = $(patsubst %.lhs,%.o,$(sources:%.hs=%.o))
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewsdrifted_files = Syntax/AS_Architecture.hs Syntax/AS_Library.hs \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews Common/AS_Annotation.hs CASL/AS_Basic_CASL.hs Syntax/AS_Structured.hs \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews Modal/AS_Modal.hs CoCASL/AS_CoCASL.hs COL/AS_COL.hs \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewsgenrule_header_files = $(wildcard ATC/*.header.hs)
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox Useratc_files := Common/Lib/Graph.hs Common/Id.hs Common/Result.hs \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews Syntax/AS_Structured.der.hs Syntax/AS_Architecture.der.hs \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews Common/GlobalAnnotations.hs Syntax/AS_Library.der.hs \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewsatc_der_files = $(foreach file, $(atc_files), ATC/$(basename $(basename $(notdir $(file)))).der.hs)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsCASL_files := CASL/Sublogic.hs CASL/Morphism.hs CASL/Sign.hs \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsHasCASL_files := HasCASL/As.hs HasCASL/Le.hs HasCASL/Morphism.hs \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsModal_files := Modal/AS_Modal.hs Modal/ModalSign.hs
b2f07642fd712c8fda81a116bcdde229ab291f33Tinderbox UserCoCASL_files := CoCASL/AS_CoCASL.hs CoCASL/CoCASLSign.hs
b2f07642fd712c8fda81a116bcdde229ab291f33Tinderbox UserCspCASL_files := CspCASL/AS_CSP_CASL.hs CspCASL/SignCSP.hs
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewsatc_logic_files = $(foreach logic, $(logics), $(logic)/ATC_$(logic).der.hs)
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox Usergenerated_rule_files = $(atc_der_files) $(atc_logic_files)
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Huntgendrifted_files = $(patsubst %.der.hs, %.hs, $(generated_rule_files))
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewsinline_axiom_files = Comorphisms/CASL2PCFOL.hs Comorphisms/PCFOL2FOL.hs Comorphisms/Modal2CASL.hs
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Huntgen_inline_axiom_files = $(patsubst %.hs,%.inline.hs,$(inline_axiom_files))
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewsderived_sources = $(drifted_files) $(happy_files) hetcats/Version.hs $(inline_axiom_files) Modal/ModalSystems.hs
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# sources that have {-# OPTIONS -cpp #-}
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User ./Proofs/Proofs.hs hets.hs ./CASL/CCC/FreeTypes.hs \
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User ./Comorphisms/LogicList.hs ./Comorphisms/LogicGraph.hs
7e71f05d8643aca84914437c900cb716444507e4Tinderbox User# this variable holds the modules that should be documented
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox Userdoc_sources = $(filter-out $(cpp_sources) ,$(sources)) \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# some modules from uni for haddock
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# if uni/server is included also HaXml sources are needed
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewsuni_sources = $(wildcard ../uni/davinci/haddock/*.hs) \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewstax_sources = Taxonomy/AbstractGraphView.hs Taxonomy/MMiSSOntology.hs \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews Taxonomy/MMiSSOntologyGraph.hs Taxonomy/OntoParser.hs
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewstax_objects = $(patsubst %.hs,%.o,$(tax_sources))
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews####################################################################
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews.PHONY : all hets-opt hets-optimized clean d_clean real_clean bin_clean \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews lib_clean distclean check capa hacapa clean_genRules genRules \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews taxonomy hets.cgi count doc apache_doc post_doc4apache \
b2f07642fd712c8fda81a116bcdde229ab291f33Tinderbox User.SECONDARY : %.hs %.d $(generated_rule_files) $(gen_inline_axiom_files)
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User $(HC) --make -o $@ hets.hs $(HC_OPTS) 2>&1 | tee hetcats-make
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User $(HC) --make -O -o hets hets.hs $(HC_OPTS) -w 2>&1 | tee hetcats-make
b2f07642fd712c8fda81a116bcdde229ab291f33Tinderbox User ghc --make -package-conf /home/luettich/ghc-pkg/package.conf -package WASH-CGI GUI/hets_cgi.hs -o hets.cgi $(HC_INCLUDE) $(HC_FLAGS) -O
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox Usertaxonomy: Taxonomy/taxonomyTool.hs $(tax_sources)
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt $(HC) --make -o Taxonomy/taxonomyTool $< -ifgl $(HC_OPTS)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews###############################
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User### TAGS files for (x)emacs
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt# load them with "M-x" "visit-tags-table" from
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User# use "M-." to search for a tag
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# !!Beware this is somewhat instable, because it uses an absolute path!!
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews /home/ger/linux/ghc-5.04.2/bin/i386-unknown-linux/hasktags \
d71e2e0c61df16ff37c9934c371a4a60c08974f7Mark Andrews###############################
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews### count lines of code
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User###############################
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt### Documentation via haddock
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# generate haddock documentation with links to sources
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User $(HADDOCK) $(doc_sources) $(uni_sources) -o docs -h -v \
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User -i docs/base.haddock -i docs/parsec.haddock -s ../ \
7e71f05d8643aca84914437c900cb716444507e4Tinderbox User -t 'hets -- a heterogenous Specification (CASL) tool set'
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User# sources are not copied here
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User###############################
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User### release management
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User (cd utils/DrIFT-src; $(HC) --make DrIFT.hs -o ../DrIFT && \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews $(HC) --make '-i../..:../DrIFT-src' -package text GenerateRules.hs -o ../genRules && \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews $(HC) --make utils/InlineAxioms/InlineAxioms.hs \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews cvs -d :pserver:cvsread@cvs-agbkb.informatik.uni-bremen.de:/repository co HetCATS
4abdfc917e6635a7c81d1f931a0c79227e72d025Mark Andrews (cd HetCATS; $(MAKE) derivedSources; ./clean.sh; \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews find . -name CVS -o -name \*.o -o -name \*.hi | xargs $(RM) -r; \
9b469e3c59015b1a4899c9d8395168126fe094fdAutomatic Updater $(RM) clean.*; mv Makefile Makefile.orig; \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews cp -p hets $(INSTALLDIR)/versions/hets-`cat version_nr`
utils/genRules -r $(rule) -o ATC -h ATC/$(basename $(basename $(notdir $(file)))).header.hs $(file); \
### also delete *.d.bak (dependency file backups)
$(RM) $@
ghci:
$(RM) $@
$(RM) $@
$(RM) $@
$(RM) $@
$(RM) $@
$(RM) $@
$(RM) $@
$(RM) $@
### ATerm.Lib test system
$(RM) $@
$(RM) $@
$(HC) --make -o $@ $< $(HC_OPTS) -package-conf ../uni/uni-package.conf -package uni-davinci -package uni-server
## two hardcoded dependencies for a correct generation of Version.hs
.SUFFIXES:
$(HAPPY) $<
$(INLINEAXIOMS) $< > $@
%.d : %.hs
%.d : %.lhs
## rule for Modal/ModalSystems.hs needed for ModalLogic Translation