Makefile revision 77a65251ee036c6aaf09c2775315a4ee24259fbd
55e5c51e661e23e24573db84114a3837817745c9Evan Hunt# Author: (c) Klaus L�ttich, Christian Maeder, Uni Bremen 2002-2004
55e5c51e661e23e24573db84114a3837817745c9Evan Hunt# This Makefile will compile the new hetcats system and provides also
55e5c51e661e23e24573db84114a3837817745c9Evan Hunt# targets for test programs during implementation phases.
55e5c51e661e23e24573db84114a3837817745c9Evan Hunt# !!! Note: This makefile is written for GNU make !!!
55e5c51e661e23e24573db84114a3837817745c9Evan Hunt# (gmake on solaris ; make on linux)
55e5c51e661e23e24573db84114a3837817745c9Evan Hunt####################################################################
55e5c51e661e23e24573db84114a3837817745c9Evan Hunt## Some varibles, which control the compilation
55e5c51e661e23e24573db84114a3837817745c9Evan HuntCOMMONLIB_PATH = Common/Lib:Common/Lib/Parsec:Common/ATerm
55e5c51e661e23e24573db84114a3837817745c9Evan HuntCLEAN_PATH = Common:Logic:CASL:Syntax:Static:GUI:HasCASL:Haskell:Modal:CspCASL:ATC:ToHaskell:Proofs:Comorphisms:$(INCLUDE_PATH):Haskell/Hatchet
55e5c51e661e23e24573db84114a3837817745c9Evan Hunt## set ghc imports properly for your system
55e5c51e661e23e24573db84114a3837817745c9Evan HuntDRIFT_ENV = DERIVEPATH='.:ghc:hetcats:/home/linux-bkb/ghc/ghc-latest/lib/ghc-6.2/imports:${GHC_IMPORTS}'
55e5c51e661e23e24573db84114a3837817745c9Evan HuntHC_PACKAGE = -package-conf ../uni/uni-package.conf -package uni-davinci \
55e5c51e661e23e24573db84114a3837817745c9Evan Hunt### Profiling and Warnings (only for debugging)
55e5c51e661e23e24573db84114a3837817745c9Evan Hunt### Attention every module must be compiled with profiling or the linker
55e5c51e661e23e24573db84114a3837817745c9Evan Hunt### cannot link the various .o files properly. So after switching on
55e5c51e661e23e24573db84114a3837817745c9Evan Hunt### Profiling, do an 'gmake clean; gmake'
55e5c51e661e23e24573db84114a3837817745c9Evan Hunt### If you need Profiling comment out the following line
55e5c51e661e23e24573db84114a3837817745c9Evan Hunt#HC_PROF = -prof -auto-all
55e5c51e661e23e24573db84114a3837817745c9Evan Hunt### list of directories to run checks in
55e5c51e661e23e24573db84114a3837817745c9Evan Hunt####################################################################
55e5c51e661e23e24573db84114a3837817745c9Evan Hunt## sources for hetcats (semi - manually produced with a perl script)
55e5c51e661e23e24573db84114a3837817745c9Evan Huntobjects = $(patsubst %.lhs,%.o,$(sources:%.hs=%.o))
55e5c51e661e23e24573db84114a3837817745c9Evan Huntdrifted_files = Syntax/AS_Architecture.hs Syntax/AS_Library.hs\
55e5c51e661e23e24573db84114a3837817745c9Evan Hunt Common/AS_Annotation.hs CASL/AS_Basic_CASL.hs Syntax/AS_Structured.hs \
55e5c51e661e23e24573db84114a3837817745c9Evan Huntgenrule_files = Common/Lib/Graph.hs Common/Id.hs Common/Result.hs \
55e5c51e661e23e24573db84114a3837817745c9Evan Hunt Syntax/AS_Structured.der.hs Syntax/AS_Architecture.der.hs \
55e5c51e661e23e24573db84114a3837817745c9Evan Hunt Common/GlobalAnnotations.hs Syntax/AS_Library.der.hs \
55e5c51e661e23e24573db84114a3837817745c9Evan Hunt CASL/Morphism.hs CASL/Sign.hs CASL/AS_Basic_CASL.der.hs \
55e5c51e661e23e24573db84114a3837817745c9Evan Hunt Haskell/Hatchet/Class.hs Haskell/Hatchet/KindInference.hs \
55e5c51e661e23e24573db84114a3837817745c9Evan Huntgendrifted_files = ATC/Graph.hs ATC/Id.hs ATC/Result.hs ATC/AS_Annotation.hs \
55e5c51e661e23e24573db84114a3837817745c9Evan Huntgenerated_rule_files = $(patsubst %.hs,%.der.hs,$(gendrifted_files))
55e5c51e661e23e24573db84114a3837817745c9Evan Hunt# this variable holds the modules that should be documented
55e5c51e661e23e24573db84114a3837817745c9Evan Hunt# the imported parsec library is not included!
55e5c51e661e23e24573db84114a3837817745c9Evan Huntdoc_sources = $(filter-out Nothing/Nothing% ,$(sources))
55e5c51e661e23e24573db84114a3837817745c9Evan Hunt####################################################################
55e5c51e661e23e24573db84114a3837817745c9Evan Hunt.PHONY : clean d_clean real_clean bin_clean check hetana hetpa hetdg \
55e5c51e661e23e24573db84114a3837817745c9Evan Hunt $(HC) --make -o $@ hets.hs $(HC_OPTS) 2>&1 | tee hetcats-make
55e5c51e661e23e24573db84114a3837817745c9Evan Hunt $(HC) --make -O -o hets hets.hs $(HC_OPTS) 2>&1 | tee hetcats-make
55e5c51e661e23e24573db84114a3837817745c9Evan Hunthetcats-make: hets.hs utils/create_sources.pl $(drifted_files) $(happy_files)
55e5c51e661e23e24573db84114a3837817745c9Evan Hunt $(HC) --make -o hets $< $(HC_OPTS) 2>&1 | tee hetcats-make
55e5c51e661e23e24573db84114a3837817745c9Evan Hunt###############################
55e5c51e661e23e24573db84114a3837817745c9Evan Hunt### TAGS files for (x)emacs
55e5c51e661e23e24573db84114a3837817745c9Evan Hunt# load them with "M-x" "visit-tags-table" from
55e5c51e661e23e24573db84114a3837817745c9Evan Hunt# use "M-." to search for a tag
55e5c51e661e23e24573db84114a3837817745c9Evan Hunt# !!Beware this is somewhat instable, because it uses an absolute path!!
55e5c51e661e23e24573db84114a3837817745c9Evan Hunt /home/ger/linux/ghc-5.04.2/bin/i386-unknown-linux/hasktags \
55e5c51e661e23e24573db84114a3837817745c9Evan Hunt###############################
55e5c51e661e23e24573db84114a3837817745c9Evan Hunt### Documentation via haddock
55e5c51e661e23e24573db84114a3837817745c9Evan Hunt# index for prelude is missing
55e5c51e661e23e24573db84114a3837817745c9Evan Hunt -t 'hets -- a heterogenous Specification (CASL) tool set'
55e5c51e661e23e24573db84114a3837817745c9Evan Hunt###############################
55e5c51e661e23e24573db84114a3837817745c9Evan Hunt### release management
55e5c51e661e23e24573db84114a3837817745c9Evan HuntderivedSources: $(drifted_files) $(happy_files) hetcats/Version.hs
55e5c51e661e23e24573db84114a3837817745c9Evan Hunt (cd utils/DrIFT-src; $(HC) --make DrIFT.hs -o ../DrIFT)
55e5c51e661e23e24573db84114a3837817745c9Evan Hunt $(HC) --make -i../.. -package text GenerateRules.hs -o ../genRules)
55e5c51e661e23e24573db84114a3837817745c9Evan Hunt cvs -d :pserver:cvsread@cvs-agbkb.informatik.uni-bremen.de:/repository co HetCATS
55e5c51e661e23e24573db84114a3837817745c9Evan Hunt (cd HetCATS; $(MAKE) derivedSources; ./clean.sh; \
55e5c51e661e23e24573db84114a3837817745c9Evan Hunt find . -name CVS -o -name \*.o -o -name \*.hi | xargs -r $(RM) -r; \
55e5c51e661e23e24573db84114a3837817745c9Evan Hunt $(RM) clean.*; $(RM) Makefile; mv ReleaseMakefile Makefile)
55e5c51e661e23e24573db84114a3837817745c9Evan Hunt#############################
55e5c51e661e23e24573db84114a3837817745c9Evan Hunt### ATC DrIFT-rule generation
55e5c51e661e23e24573db84114a3837817745c9Evan Hunt$(generated_rule_files): $(genrule_files) utils/genRules #$(genrule_header_files)
55e5c51e661e23e24573db84114a3837817745c9Evan Hunt utils/genRules -r $(rule) -o CASL -h ATC/CASL.header.hs \
55e5c51e661e23e24573db84114a3837817745c9Evan Hunt utils/genRules -r $(rule) -o HasCASL -h ATC/HasCASL.header.hs \
55e5c51e661e23e24573db84114a3837817745c9Evan Hunt utils/genRules -r $(rule) -o CspCASL -h ATC/CspCASL.header.hs \
55e5c51e661e23e24573db84114a3837817745c9Evan Hunt utils/genRules -r $(rule) -o Haskell -h ATC/Haskell.header.hs \
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) $@
### 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
$(HAPPY) $<
%.d : %.hs
%.d : %.lhs