Makefile revision c55a0f77be7e88d3620b419ec8961f4379a586e3
5347c0fcb04eaea19d9f39795646239f487c6207Tinderbox User# Author: Klaus L�ttich
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 !!!
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# (gmake on solaris ; make on linux)
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein####################################################################
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User## Some varibles, which control the compilation
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox UserCOMMONLIB_PATH = Common/Lib:Common/Lib/Parsec:Common/ATerm
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox UserCLEAN_PATH = Common:Logic:CASL:Syntax:Static:GUI:HasCASL:Haskell:Haskell/Language:Modal:CspCASL:ATC:ToHaskell:Proofs:Comorphisms:$(INCLUDE_PATH):Haskell/Hatchet
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox UserDRIFT_ENV = DERIVEPATH='.:ghc:hetcats:/home/linux-bkb/ghc/ghc-latest/lib/ghc-6.0.1/imports'
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox UserHC_FLAGS = -fglasgow-exts -fallow-overlapping-instances -Wall
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User# please remove '-O2' if compilation lasts to long on your system
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User# but please don't commit to cvs server
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox UserHC_PACKAGE = -package-conf ../uni/uni-package.conf -package uni-davinci \
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein### Profiling and Warnings (only for debugging)
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User### Attention every module must be compiled with profiling or the linker
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User### cannot link the various .o files properly. So after switching on
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein### Profiling, do an 'gmake clean; gmake'
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein### If you need Profiling comment out the following line
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein#HC_PROF = -prof -auto-all
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox UserHCI_OPTS = $(HC_FLAGS) $(HC_PACKAGE) $(HC_INCLUDE)
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein### list of directories to run checks in
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein####################################################################
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein## sources for hetcats (semi - manually produced with a perl script)
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austeinobjects = $(patsubst %.lhs,%.o,$(sources:%.hs=%.o))
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austeindrifted_files = Syntax/AS_Architecture.hs Syntax/AS_Library.hs\
2eeb74d1cf5355dd98f6d507a10086e16bb08c4bTinderbox User Common/AS_Annotation.hs CASL/AS_Basic_CASL.hs Syntax/AS_Structured.hs \
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austeingenrule_header_files = $(wildcard ATC/*.header.hs)
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austeingenrule_files = Common/Lib/Graph.hs Common/Id.hs Common/Result.hs \
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein Syntax/AS_Structured.der.hs Syntax/AS_Architecture.der.hs \
2eeb74d1cf5355dd98f6d507a10086e16bb08c4bTinderbox User Common/GlobalAnnotations.hs Syntax/AS_Library.der.hs \
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein CASL/Morphism.hs CASL/StaticAna.hs CASL/AS_Basic_CASL.der.hs \
2eeb74d1cf5355dd98f6d507a10086e16bb08c4bTinderbox User HasCASL/Le.hs HasCASL/As.hs HasCASL/Symbol.hs \
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein Haskell/Hatchet/Class.hs Haskell/Hatchet/KindInference.hs \
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austeingendrifted_files = ATC/Graph.hs ATC/Id.hs ATC/Result.hs ATC/AS_Annotation.hs \
2eeb74d1cf5355dd98f6d507a10086e16bb08c4bTinderbox User ATC/AS_Structured.hs ATC/AS_Architecture.hs \
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austeingenerated_rule_files = $(patsubst %.hs,%.der.hs,$(gendrifted_files))
2eeb74d1cf5355dd98f6d507a10086e16bb08c4bTinderbox Userhappy_files = Haskell/Language/Parser.hs Haskell/Hatchet/HsParser.hs
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# this variable holds the modules that should be documented
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# the imported parsec library is not included!
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austeindoc_sources = $(filter-out Nothing/Nothing% ,$(sources))
2eeb74d1cf5355dd98f6d507a10086e16bb08c4bTinderbox User####################################################################
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein.PHONY : clean d_clean real_clean bin_clean check hetana hetpa hetdg \
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austeinhetcats-make: hets.hs utils/create_sources.pl $(drifted_files) $(happy_files)
2eeb74d1cf5355dd98f6d507a10086e16bb08c4bTinderbox User $(HC) --make -o hets $< $(HC_OPTS) 2>&1 | tee hetcats-make
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein###############################
2eeb74d1cf5355dd98f6d507a10086e16bb08c4bTinderbox User### TAGS files for (x)emacs
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User# load them with "M-x" "visit-tags-table" from
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# use "M-." to search for a tag
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# !!Beware this is somewhat instable, because it uses an absolute path!!
2eeb74d1cf5355dd98f6d507a10086e16bb08c4bTinderbox User /home/ger/linux/ghc-5.04.2/bin/i386-unknown-linux/hasktags \
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein###############################
2eeb74d1cf5355dd98f6d507a10086e16bb08c4bTinderbox User### Documentation via haddock
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User --read-interface=http://www.haskell.org/ghc/docs/latest/html/libraries/base,/home/linux-bkb/ghc/ghc-6.0.1/share/ghc-6.0.1/html/base/base.haddock \
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User -t 'hets -- a heterogenous Specification (CASL) tool set'
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein#############################
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein### ATC DrIFT-rule generation
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein$(generated_rule_files): $(genrule_files)# $(genrule_header_files)
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein utils/genRules -r $(rule) -o CASL -h ATC/CASL.header.hs $(casl_files)
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User utils/genRules -r $(rule) -o HasCASL -h ATC/HasCASL.header.hs $(hascasl_files)
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein utils/genRules -r $(rule) -o CspCASL -h ATC/CspCASL.header.hs $(cspcasl_files)
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein utils/genRules -r $(rule) -o Haskell -h ATC/Haskell.header.hs $(haskell_files)
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austeingen_atc_files = if [ -f ATC/$(basename $(basename $(notdir $(file)))).header.hs ]; then \
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein utils/genRules -r $(rule) -o ATC -h ATC/$(basename $(basename $(notdir $(file)))).header.hs $(file); \
8eea877894ea5bcf5cdd9ca124a8601ad421d753Andreas Gustafssonatc_files := $(filter-out CASL/% HasCASL/% CspCASL/% Haskell/% ,$(genrule_files))
8eea877894ea5bcf5cdd9ca124a8601ad421d753Andreas Gustafssoncasl_files := $(filter CASL/% ,$(genrule_files))
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafssonhascasl_files := $(filter HasCASL/% ,$(genrule_files))
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austeincspcasl_files := $(filter CspCASL/% ,$(genrule_files))
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austeinhaskell_files := $(filter Haskell/%,$(genrule_files))
8eea877894ea5bcf5cdd9ca124a8601ad421d753Andreas Gustafsson###############
8eea877894ea5bcf5cdd9ca124a8601ad421d753Andreas Gustafsson### removes *.hi and *.o in all include directories
8eea877894ea5bcf5cdd9ca124a8601ad421d753Andreas Gustafsson for p in $(subst :, ,$(CLEAN_PATH)) . ; do \
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein### remove binaries
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User### additonally removes *.d (dependency files) in every include directory
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User### also delete *.d.bak (dependency file backups)
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein### remove files also in own libraries
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein for p in $(subst :, ,$(COMMONLIB_PATH)) . ; do \
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein### additionally removes the files that define the sources-variable
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein### additionally removes files not in CVS tree
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein####################################################################
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein### test targets
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User####################################################################
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User### a parser to test annotation parser and Id parsers
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox UserCommon/test_parser: Common/test_parser.hs Common/AS_Annotation.der.hs
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein### interactive
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein### christian's target
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein### CASL parser
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein### HasCASL parser
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinHasCASL/hacapa: HasCASL/hacapa.lhs CASL/capa HasCASL/*.hs
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein### Haskell parser
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinHaskell/hapa: Haskell/hapa.lhs Haskell/*.hs Haskell/Language/*.hs $(happy_files)
2eeb74d1cf5355dd98f6d507a10086e16bb08c4bTinderbox User### Haskell wrap parser
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User### HetCASL parser
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein### HetCASL parser
$(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) $<
#%.hs: %.ag.hs
$(DRIFT) $< > $@
%.d : %.hs
%.d : %.lhs