rules revision 6e049108aa87dc46bcff96fae50a4625df1d9648
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# Author: (c) Klaus L�ttich, Christian Maeder, Uni Bremen 2002-2004
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# Year: 2004
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# This Makefile will compile the new hetcats system and provides also
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# targets for test programs during implementation phases.
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# !!! Note: This makefile is written for GNU make !!!
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# (gmake on solaris ; make on linux)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin####################################################################
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin## Some varibles, which control the compilation
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinINCLUDE_PATH = ghc:hetcats
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinCOMMONLIB_PATH = Common/Lib:Common/Lib/Parsec:Common/ATerm
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinCLEAN_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
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin## set ghc imports properly for your system
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinLINUX_IMPORTS = $(wildcard /home/linux-bkb/ghc/ghc-latest/lib/ghc-*/imports)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinDRIFT_ENV = DERIVEPATH='.:ghc:hetcats:${LINUX_IMPORTS}:${GHC_IMPORTS}'
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# override on commandline for other architectures
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinINSTALLDIR = /home/www/agbkb/forschung/formal_methods/CoFI/hets/`utils/sysname.sh`
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinDRIFT_deps = utils/DrIFT-src/*hs
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinGENERATERULES_deps = utils/GenerateRules/*hs $(DRIFT_deps)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinINLINEAXIOMS_deps = utils/InlineAxioms/*hs
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinPERL = perl
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinHAPPY = happy
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinDRIFT = $(DRIFT_ENV) utils/DrIFT
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinHADDOCK = haddock
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinHC_FLAGS = -Wall -fglasgow-exts -cpp
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# -fglasgow-exts comes in via ../uni/uni-package.conf
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# but added it here in case of compilation without uni
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinHC_INCLUDE = -i$(INCLUDE_PATH)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinHC_PACKAGE = -package-conf ../uni/uni-package.conf -package uni-davinci \
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin -package uni-server
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin### Profiling and Warnings (only for debugging)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin### Attention every module must be compiled with profiling or the linker
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin### cannot link the various .o files properly. So after switching on
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin### Profiling, do an 'gmake clean; gmake'
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin### If you need Profiling comment out the following line
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#HC_PROF = -prof -auto-all
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinHCI_OPTS = $(HC_FLAGS) $(HC_PACKAGE) $(HC_INCLUDE)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinHC_OPTS = $(HCI_OPTS) $(HC_PROF)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinDRIFT_OPTS = +RTS -K10m -RTS
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin### list of directories to run checks in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinTESTDIRS = Common CASL HasCASL Haskell/Hatchet/examples ToHaskell/test
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin####################################################################
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin## sources for hetcats (semi - manually produced with a perl script)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinifneq ($(MAKECMDGOALS),clean)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinifneq ($(MAKECMDGOALS),bin_clean)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinifneq ($(MAKECMDGOALS),d_clean)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinifneq ($(MAKECMDGOALS),real_clean)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinifneq ($(MAKECMDGOALS),distclean)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinifneq ($(MAKECMDGOALS),genRules)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinifneq ($(MAKECMDGOALS),utils/genRules)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinifneq ($(MAKECMDGOALS),hets-opt)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinifneq ($(MAKECMDGOALS),prob_objs)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinifneq ($(MAKECMDGOALS),hets-optimized)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinifneq ($(MAKECMDGOALS),derivedSources)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinifneq ($(MAKECMDGOALS),$(INLINEAXIOMS))
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinifneq ($(MAKECMDGOALS),release)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinifneq ($(MAKECMDGOALS),check)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinifneq ($(MAKECMDGOALS),apache_doc)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinifneq ($(MAKECMDGOALS),clean_genRules)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinifneq ($(MAKECMDGOALS),atctest2)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinifneq ($(MAKECMDGOALS),hetana)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinobjects = $(patsubst %.lhs,%.o,$(sources:%.hs=%.o))
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chindrifted_files = Syntax/AS_Architecture.hs Syntax/AS_Library.hs \
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin Common/AS_Annotation.hs CASL/AS_Basic_CASL.hs Syntax/AS_Structured.hs \
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin $(gendrifted_files)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chingenrule_header_files = $(wildcard ATC/*.header.hs)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chingenrule_files = Common/Lib/Graph.hs Common/Id.hs Common/Result.hs \
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin Syntax/AS_Structured.der.hs Syntax/AS_Architecture.der.hs \
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin CASL/Morphism.hs CASL/Sign.hs CASL/AS_Basic_CASL.der.hs \
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin Haskell/Hatchet/Class.hs Haskell/Hatchet/KindInference.hs \
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chingendrifted_files = ATC/Graph.hs ATC/Id.hs ATC/Result.hs ATC/AS_Annotation.hs \
generated_rule_files = $(patsubst %.hs,%.der.hs,$(gendrifted_files))
gen_inline_axiom_files = $(patsubst %.hs,%.inline.hs,$(inline_axiom_files))
happy_files = Haskell/Hatchet/HsParser.hs
doc_sources = $(filter-out ./Isabelle/IsaSign.hs $(cpp_sources) ,$(sources)) \
#.PRECIOUS: sources_hetcats.mk
$(HC) --make -o $@ hets.hs $(HC_OPTS) 2>&1 | tee hetcats-make
hets-opt: hetcats/Version.hs
problematic_objs = Common/Lib/Rel.o Common/Id.o Common/Lexer.o Common/Lib/Pretty.o Common/GlobalAnnotations.o Common/PPUtils.o
$(HC) --make -O -o hets hets.hs $(HC_OPTS) -w 2>&1 | tee hetcats-make
ghc --make -package-conf /home/luettich/ghc-pkg/package.conf -package WASH-CGI GUI/hets_cgi.hs -o hets.cgi $(HC_OPTS) -O
hetcats-make: hets.hs utils/create_sources.pl $(drifted_files) $(happy_files) $(inline_axiom_files) Modal/ModalSystems.hs
$(RM) hetcats-make sources_hetcats.mk
hetcats.TAGS: $(sources)
$(sources); mv TAGS $@; mv tags hetcats.tags
doc: docs/index.html
docs/index.html: $(doc_sources)
-i docs/base.haddock \
$(PERL) utils/post_process_docs.pl docs \
derivedSources: $(drifted_files) $(happy_files) hetcats/Version.hs $(inline_axiom_files) Modal/ModalSystems.hs
utils/DrIFT: $(DRIFT_deps)
utils/genRules: $(GENERATERULES_deps)
(cd utils/GenerateRules; \
$(HC) --make '-i../..:../DrIFT-src' -package text GenerateRules.hs -o ../genRules && \
$(HC) --make utils/InlineAxioms/InlineAxioms.hs \
(cd HetCATS; $(MAKE) derivedSources; ./clean.sh; \
$(RM) clean.*; mv Makefile Makefile.orig; \
tar cvf HetCATS.tar HetCATS
cp -p hets $(INSTALLDIR)/versions/hets-`cat version_nr`
ln -s versions/hets-`cat version_nr` hets; $(RM) version_nr)
genRules: $(generated_rule_files) utils/genRules
$(generated_rule_files): $(genrule_files) utils/genRules #$(genrule_header_files)
utils/genRules -r $(rule) -o CASL $(casl_files)
utils/genRules -r $(rule) -o HasCASL $(hascasl_files)
utils/genRules -r $(rule) -o Modal $(modal_files)
utils/genRules -r $(rule) -o CoCASL $(cocasl_files)
utils/genRules -r $(rule) -o COL $(col_files)
utils/genRules -r $(rule) -o CspCASL $(cspcasl_files)
gen_atc_files = if [ -f ATC/$(basename $(basename $(notdir $(file)))).header.hs ]; then \
utils/genRules -r $(rule) -o ATC -h ATC/$(basename $(basename $(notdir $(file)))).header.hs $(file); \
utils/genRules -r $(rule) -o ATC $(file); \
atc_files := $(filter-out CASL/% HasCASL/% Modal/% CoCASL/% COL/% CspCASL/% Haskell/% ,$(genrule_files))
$(RM) CASL/capa
$(RM) HasCASL/hacapa
$(RM) Haskell/hapa
$(RM) Haskell/wrap
$(RM) Syntax/hetpa
$(RM) Static/hetana
$(RM) Static/hetana
$(RM) GUI/hetdg
$(RM) Common/annos
### also delete *.d.bak (dependency file backups)
(cd $$p ; $(RM) *.d *.d.bak) ; done
$(RM) hetcats-make sources_hetcats.mk
$(RM) hetcats/Version.hs
test_parser: Common/test_parser
capa: CASL/capa
hacapa: HasCASL/hacapa
hapa: Haskell/hapa
hetpa: Syntax/hetpa.hs Syntax/*.hs
hetana: Static/hetana.hs Static/*.hs
atctest: ATC/ATCTest.hs ATC/*.hs
### ATerm.Lib test system
hetdg: GUI/hetdg.hs $(drifted_files) *.hs
$(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
%.hs: %.inline.hs $(INLINEAXIOMS)
## rule for Modal/ModalSystems.hs needed for ModalLogic Translation
Modal/ModalSystems.hs: Modal/GeneratePatterns.inline.hs.in utils/genTransMFormFunc.pl $(INLINEAXIOMS)
$(PERL) utils/genTransMFormFunc.pl $< $@
ifneq ($(MAKECMDGOALS),utils/genRules)
sources_hetcats.mk: hetcats-make hetcats/Version.hs hets.hs utils/create_sources.pl $(drifted_files) $(happy_files)