Makefile revision ddc9315cc0b1f5dd3d8f99a77f1c75064db33b48
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# Author: (c) Klaus L�ttich, Christian Maeder, Uni Bremen 2002-2004
70953fb44a7140fe206c3a5f011e24209c8c5c6abnicholes# This Makefile will compile the new hetcats system and provides also
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# targets for test programs during implementation phases.
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# !!! Note: This makefile is written for GNU make !!!
ce22ce4743d79a889dca64df4459c598e2c188c7fuankg# (gmake on solaris ; make on linux)
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes####################################################################
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes## Some varibles, which control the compilation
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesCOMMONLIB_PATH = Common/Lib:Common/Lib/Parsec:Common/ATerm
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesCLEAN_PATH = utils/DrIFT-src:utils/GenerateRules:Common:Logic:CASL:CASL/CCC:Syntax:Static:GUI:HasCASL:Haskell:Modal:CspCASL:ATC:ToHaskell:Proofs:Comorphisms:Isabelle:$(INCLUDE_PATH):Haskell/Hatchet
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes## set ghc imports properly for your system
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesLINUX_IMPORTS = $(wildcard /home/linux-bkb/ghc/ghc-latest/lib/ghc-*/imports)
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesDRIFT_ENV = DERIVEPATH='.:ghc:hetcats:${LINUX_IMPORTS}:${GHC_IMPORTS}'
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# override on commandline for other architectures
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesINSTALLDIR = /home/www/agbkb/forschung/formal_methods/CoFI/hets/`utils/sysname.sh`
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesGENERATERULES_deps = utils/GenerateRules/*hs $(DRIFT_deps)
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# -fglasgow-exts comes in via ../uni/uni-package.conf
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesHC_PACKAGE = -package-conf ../uni/uni-package.conf -package uni-davinci \
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes### Profiling and Warnings (only for debugging)
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes### Attention every module must be compiled with profiling or the linker
5b0c702735f2049038c50c7dc5dd2606086ee110bnicholes### cannot link the various .o files properly. So after switching on
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes### Profiling, do an 'gmake clean; gmake'
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes### If you need Profiling comment out the following line
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes#HC_PROF = -prof -auto-all
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes### list of directories to run checks in
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesTESTDIRS = Common CASL HasCASL Haskell/Hatchet/examples
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes####################################################################
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes## sources for hetcats (semi - manually produced with a perl script)
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesobjects = $(patsubst %.lhs,%.o,$(sources:%.hs=%.o))
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesdrifted_files = Syntax/AS_Architecture.hs Syntax/AS_Library.hs\
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes Common/AS_Annotation.hs CASL/AS_Basic_CASL.hs Syntax/AS_Structured.hs \
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesgenrule_files = Common/Lib/Graph.hs Common/Id.hs Common/Result.hs \
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes Syntax/AS_Structured.der.hs Syntax/AS_Architecture.der.hs \
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes Common/GlobalAnnotations.hs Syntax/AS_Library.der.hs \
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes CASL/Morphism.hs CASL/Sign.hs CASL/AS_Basic_CASL.der.hs \
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes Haskell/Hatchet/Class.hs Haskell/Hatchet/KindInference.hs \
6c080a25f5991f40225209541c989d7e76c4a39dbnicholesgendrifted_files = ATC/Graph.hs ATC/Id.hs ATC/Result.hs ATC/AS_Annotation.hs \
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesgenerated_rule_files = $(patsubst %.hs,%.der.hs,$(gendrifted_files))
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesgen_inline_axiom_files = $(patsubst %.hs,%.inline.hs,$(inline_axiom_files))
41022996c916eb4ab2ec3204eb491b64779eb100bnicholes# this variable holds the modules that should be documented
41022996c916eb4ab2ec3204eb491b64779eb100bnicholes# the imported parsec library is not included!
036436f4f4cdcd76186c0058891216545967043bbnicholesdoc_sources = $(filter-out ./Isabelle/IsaSign.hs ,$(sources))
41022996c916eb4ab2ec3204eb491b64779eb100bnicholes####################################################################
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes.PHONY : clean d_clean real_clean bin_clean check hetana hetpa hetdg \
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes.SECONDARY : %.hs %.d $(generated_rule_files) $(gen_inline_axiom_files)
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes $(HC) --make -o $@ hets.hs $(HC_OPTS) 2>&1 | tee hetcats-make
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes $(HC) --make -O -o hets hets.hs $(HC_OPTS) -w 2>&1 | tee hetcats-make
bb2b38cd44b032118359afbc743efbea12f48e61bnicholeshetcats-make: hets.hs utils/create_sources.pl $(drifted_files) $(happy_files) $(inline_axiom_files)
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes $(HC) --make -o hets $< $(HC_OPTS) 2>&1 | tee hetcats-make
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes###############################
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes### TAGS files for (x)emacs
ce22ce4743d79a889dca64df4459c598e2c188c7fuankg# load them with "M-x" "visit-tags-table" from
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# use "M-." to search for a tag
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# !!Beware this is somewhat instable, because it uses an absolute path!!
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes /home/ger/linux/ghc-5.04.2/bin/i386-unknown-linux/hasktags \
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes###############################
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes### Documentation via haddock
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# index for prelude is missing
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes -t 'hets -- a heterogenous Specification (CASL) tool set'
be88e49281c5becee364ab9c6a0576f9b9844e0fbnicholes###############################
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes### release management
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesderivedSources: $(drifted_files) $(happy_files) hetcats/Version.hs $(inline_axiom_files)
56ab8639aed4d3b2f031d9c1160c5f40af01bdebjerenkrantz (cd utils/DrIFT-src; $(HC) --make DrIFT.hs -o ../DrIFT && \
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes $(HC) --make '-i../..:../DrIFT-src' -package text GenerateRules.hs -o ../genRules && \
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes cvs -d :pserver:cvsread@cvs-agbkb.informatik.uni-bremen.de:/repository co HetCATS
e961abd49ab1b184b356f63591d37083a5651451bnicholes (cd HetCATS; $(MAKE) derivedSources; ./clean.sh; \
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes find . -name CVS -o -name \*.o -o -name \*.hi | xargs $(RM) -r; \
440cda576ca9ff6476e4a04bdb253c5023da15eejerenkrantz cp -p hets $(INSTALLDIR)/versions/hets-`cat version_nr`
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes ln -s $(INSTALLDIR)/versions/hets-`cat version_nr` $(INSTALLDIR)/hets
6f2fa094a76c27135a9825ca9492f9db0a1a3bc9bnicholes#############################
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes### ATC DrIFT-rule generation
3163ad7b2076b0f6961dc1a1ddaa06b240eecb7cjorton$(generated_rule_files): $(genrule_files) utils/genRules #$(genrule_header_files)
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes utils/genRules -r $(rule) -o HasCASL -h ATC/HasCASL.header.hs \
9558e9fdb620dd6f42ca93beac6c3ab734086706bnicholes utils/genRules -r $(rule) -o CspCASL $(cspcasl_files)
9558e9fdb620dd6f42ca93beac6c3ab734086706bnicholes utils/genRules -r $(rule) -o Haskell -h ATC/Haskell.header.hs \
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesgen_atc_files = if [ -f ATC/$(basename $(basename $(notdir $(file)))).header.hs ]; then \
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes utils/genRules -r $(rule) -o ATC -h ATC/$(basename $(basename $(notdir $(file)))).header.hs $(file); \
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesatc_files := $(filter-out CASL/% HasCASL/% Modal/% CspCASL/% Haskell/% ,$(genrule_files))
bb2b38cd44b032118359afbc743efbea12f48e61bnicholeshascasl_files := $(filter HasCASL/% ,$(genrule_files))
bb2b38cd44b032118359afbc743efbea12f48e61bnicholescspcasl_files := $(filter CspCASL/% ,$(genrule_files))
bb2b38cd44b032118359afbc743efbea12f48e61bnicholeshaskell_files := $(filter Haskell/%,$(genrule_files))
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes###############
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes### removes *.hi and *.o in all include directories
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes### remove binaries
9558e9fdb620dd6f42ca93beac6c3ab734086706bnicholes### additonally removes *.d (dependency files) in every include directory
9558e9fdb620dd6f42ca93beac6c3ab734086706bnicholes### also delete *.d.bak (dependency file backups)
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes### remove files also in own libraries
ce22ce4743d79a889dca64df4459c598e2c188c7fuankg### additionally removes the files that define the sources-variable
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes### additionally removes files not in CVS tree
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# $(RM) $(happy_files)
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes####################################################################
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes### test targets
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes####################################################################
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes### a parser to test annotation parser and Id parsers
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesCommon/test_parser: Common/test_parser.hs Common/AS_Annotation.der.hs
f2f3f241c00a7a4bd597e57a19023940e072918abnicholes### interactive
f2f3f241c00a7a4bd597e57a19023940e072918abnicholes### christian's target
f2f3f241c00a7a4bd597e57a19023940e072918abnicholes### CASL parser
f2f3f241c00a7a4bd597e57a19023940e072918abnicholes### HasCASL parser
f2f3f241c00a7a4bd597e57a19023940e072918abnicholesHasCASL/hacapa: HasCASL/hacapa.hs Common/*.hs HasCASL/*.hs
f2f3f241c00a7a4bd597e57a19023940e072918abnicholes### Haskell parser
f2f3f241c00a7a4bd597e57a19023940e072918abnicholesHaskell/hapa: Haskell/hapa.hs Haskell/Hatchet/*.hs $(happy_files)
f2f3f241c00a7a4bd597e57a19023940e072918abnicholes### HetCASL parser
ce22ce4743d79a889dca64df4459c598e2c188c7fuankg### HetCASL parser
f2f3f241c00a7a4bd597e57a19023940e072918abnicholes### ATC test system
f2f3f241c00a7a4bd597e57a19023940e072918abnicholesatctest2: Common/ATerm/ATermLibTest.hs Common/SimpPretty.hs Common/ATerm/*.hs Common/Lib/*.hs
273e1eccdc9e5b94f1e3e13e3ffca7360b6f461fbnicholes### ATerm.Lib test system
273e1eccdc9e5b94f1e3e13e3ffca7360b6f461fbnicholesatermlibtest: Common/ATerm/ATermLibTest.hs Common/ATerm/*.hs Common/SimpPretty.hs
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes### HetCASL with dev graph
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes $(HC) --make -o $@ $< $(HC_OPTS) -package-conf ../uni/uni-package.conf -package uni-davinci -package uni-server
8410c53aaf5e0372a19d5f4d2bc696b9c609ce3cbnicholes### run tests in other directories
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes for i in $(TESTDIRS); do $(MAKE) -C $$i check; done
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes####################################################################
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes## Preparing the version of HetCATS
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes $(PERL) utils/build_version.pl version_nr < hetcats/Version.in > $@
ce22ce4743d79a889dca64df4459c598e2c188c7fuankg## two hardcoded dependencies for a correct generation of Version.hs
$(HAPPY) $<
$(INLINEAXIOMS) $< > $@
%.d : %.hs
%.d : %.lhs