Makefile revision ba0ec5e897ef99d420c8c14c2374e0f32b7043db
53089ab7c84db6fb76c16ca50076c147cda11757eschrock# Author: Klaus L�ttich
53089ab7c84db6fb76c16ca50076c147cda11757eschrock# Year: 2003
53089ab7c84db6fb76c16ca50076c147cda11757eschrock# This Makefile will compile the new hetcats system and provides also
53089ab7c84db6fb76c16ca50076c147cda11757eschrock# targets for test programs during implementation phases.
53089ab7c84db6fb76c16ca50076c147cda11757eschrock# !!! Note: This makefile is written for GNU make !!!
53089ab7c84db6fb76c16ca50076c147cda11757eschrock# (gmake on solaris ; make on linux)
53089ab7c84db6fb76c16ca50076c147cda11757eschrock####################################################################
53089ab7c84db6fb76c16ca50076c147cda11757eschrock## Some varibles, which control the compilation
53089ab7c84db6fb76c16ca50076c147cda11757eschrockCOMMONLIB_PATH = Common/Lib:Common/Lib/Parsec:Common/ATerm
53089ab7c84db6fb76c16ca50076c147cda11757eschrockCLEAN_PATH = Common:Logic:CASL:Syntax:Static:GUI:HasCASL:Haskell:Haskell/Language:Modal:CspCASL:$(INCLUDE_PATH)
53089ab7c84db6fb76c16ca50076c147cda11757eschrockDRIFT_ENV = DERIVEPATH='.:ghc:hetcats:/home/linux-bkb/ghc/ghc-latest/lib/ghc-6.0/imports'
53089ab7c84db6fb76c16ca50076c147cda11757eschrockHC_FLAGS = -fglasgow-exts -fallow-overlapping-instances -Wall
53089ab7c84db6fb76c16ca50076c147cda11757eschrockHC_PACKAGE = -package-conf ../uni/uni-package.conf -package uni-davinci -package uni-server
53089ab7c84db6fb76c16ca50076c147cda11757eschrock### Profiling and Warnings (only for debugging)
53089ab7c84db6fb76c16ca50076c147cda11757eschrock### Attention every module must be compiled with profiling or the linker
53089ab7c84db6fb76c16ca50076c147cda11757eschrock### cannot link the various .o files properly. So after switching on
53089ab7c84db6fb76c16ca50076c147cda11757eschrock### Profiling, do an 'gmake clean; gmake'
53089ab7c84db6fb76c16ca50076c147cda11757eschrock### If you need Profiling comment out the following line
53089ab7c84db6fb76c16ca50076c147cda11757eschrock#HC_PROF = -prof -auto-all -Wall
53089ab7c84db6fb76c16ca50076c147cda11757eschrock### list of directories to run checks in
53089ab7c84db6fb76c16ca50076c147cda11757eschrock####################################################################
53089ab7c84db6fb76c16ca50076c147cda11757eschrock## sources for hetcats (semi - manually produced with a perl script)
53089ab7c84db6fb76c16ca50076c147cda11757eschrockdrifted_files = Syntax/AS_Architecture.hs Syntax/AS_Library.hs\
53089ab7c84db6fb76c16ca50076c147cda11757eschrock Common/AS_Annotation.hs CASL/AS_Basic_CASL.hs Syntax/AS_Structured.hs \
53089ab7c84db6fb76c16ca50076c147cda11757eschrockgenrule_files = Common/Lib/Graph.hs Common/Id.hs Common/Result.hs Common/AS_Annotation.der.hs Common/Named.hs \
53089ab7c84db6fb76c16ca50076c147cda11757eschrock Syntax/AS_Structured.der.hs Syntax/AS_Architecture.der.hs Common/GlobalAnnotations.hs Syntax/AS_Library.der.hs \
53089ab7c84db6fb76c16ca50076c147cda11757eschrock CASL/Morphism.hs CASL/StaticAna.hs CASL/AS_Basic_CASL.der.hs \
53089ab7c84db6fb76c16ca50076c147cda11757eschrock HasCASL/Le.hs HasCASL/As.hs HasCASL/Symbol.hs HasCASL/Morphism.hs \
53089ab7c84db6fb76c16ca50076c147cda11757eschrockgendrifted_files = ATC/Graph.hs ATC/Id.hs ATC/Result.hs ATC/AS_Annotation.hs ATC/Named.hs \
53089ab7c84db6fb76c16ca50076c147cda11757eschrock ATC/AS_Structured.hs ATC/AS_Architecture.hs ATC/DevGraph.hs \
53089ab7c84db6fb76c16ca50076c147cda11757eschrock CASL/ATC_CASL.hs Haskell/ATC_Haskell.hs HasCASL/ATC_HasCASL.hs CspCASL/ATC_CspCASL.hs
53089ab7c84db6fb76c16ca50076c147cda11757eschrockgenerated_rule_files = $(patsubst %.hs,%.der.hs,$(gendrifted_files))
53089ab7c84db6fb76c16ca50076c147cda11757eschrock# this variable holds the modules that should be documented
53089ab7c84db6fb76c16ca50076c147cda11757eschrock# the imported parsec library is not included!
53089ab7c84db6fb76c16ca50076c147cda11757eschrockdoc_sources = $(filter-out Nothing/Nothing% ,$(sources))
53089ab7c84db6fb76c16ca50076c147cda11757eschrock####################################################################
53089ab7c84db6fb76c16ca50076c147cda11757eschrock.PHONY : clean d_clean real_clean bin_clean check hetana hetpa hetdg clean_genRules genRules
53089ab7c84db6fb76c16ca50076c147cda11757eschrockhetcats-make: hets.hs utils/create_sources.pl $(drifted_files) $(happy_files)
53089ab7c84db6fb76c16ca50076c147cda11757eschrock $(HC) --make -o hets $< $(HC_OPTS) 2>&1 | tee hetcats-make && \
53089ab7c84db6fb76c16ca50076c147cda11757eschrock $(PERL) utils/create_sources.pl hetcats-make sources_hetcats.mk
53089ab7c84db6fb76c16ca50076c147cda11757eschrock###############################
53089ab7c84db6fb76c16ca50076c147cda11757eschrock### TAGS files for (x)emacs
53089ab7c84db6fb76c16ca50076c147cda11757eschrock# load them with "M-x" "visit-tags-table" from
53089ab7c84db6fb76c16ca50076c147cda11757eschrock# use "M-." to search for a tag
53089ab7c84db6fb76c16ca50076c147cda11757eschrock# !!Beware this is somewhat instable, because it uses an absolute path!!
53089ab7c84db6fb76c16ca50076c147cda11757eschrock /home/ger/linux/ghc-5.04.2/bin/i386-unknown-linux/hasktags \
53089ab7c84db6fb76c16ca50076c147cda11757eschrock###############################
53089ab7c84db6fb76c16ca50076c147cda11757eschrock### Documentation via haddock
53089ab7c84db6fb76c16ca50076c147cda11757eschrock -i/home/linux-bkb/ghc/ghc-6.0/share/ghc-6.0/html/base,/home/linux-bkb/ghc/ghc-6.0/share/ghc-6.0/html/base/base.haddock \
53089ab7c84db6fb76c16ca50076c147cda11757eschrock -t 'hets -- a heterogenous Specification (CASL) tool set'
53089ab7c84db6fb76c16ca50076c147cda11757eschrock##########################
53089ab7c84db6fb76c16ca50076c147cda11757eschrock### DrIFT-rule generation
53089ab7c84db6fb76c16ca50076c147cda11757eschrock utils/genRules -r $(rule) -o CASL -h ATC/CASL.header.hs $(casl_files)
53089ab7c84db6fb76c16ca50076c147cda11757eschrock utils/genRules -r $(rule) -o HasCASL -h ATC/HasCASL.header.hs $(hascasl_files)
53089ab7c84db6fb76c16ca50076c147cda11757eschrock utils/genRules -r $(rule) -o CspCASL -h ATC/CspCASL.header.hs $(cspcasl_files)
53089ab7c84db6fb76c16ca50076c147cda11757eschrock utils/genRules -r $(rule) -o Haskell -h ATC/Haskell.header.hs $(haskell_files)
53089ab7c84db6fb76c16ca50076c147cda11757eschrockgen_atc_files = if [ -e ATC/$(basename $(basename $(notdir $(file)))).header.hs ]; then \
53089ab7c84db6fb76c16ca50076c147cda11757eschrock utils/genRules -r $(rule) -o ATC -h ATC/$(basename $(basename $(notdir $(file)))).header.hs $(file); \
53089ab7c84db6fb76c16ca50076c147cda11757eschrockatc_files := $(filter-out CASL/% HasCASL/% CspCASL/% Haskell/% ,$(genrule_files))
2acef22db7808606888f8f92715629ff3ba555b9Matthew Ahrenscasl_files := $(filter CASL/% ,$(genrule_files))
53089ab7c84db6fb76c16ca50076c147cda11757eschrockhascasl_files := $(filter HasCASL/% ,$(genrule_files))
53089ab7c84db6fb76c16ca50076c147cda11757eschrockcspcasl_files := $(filter CspCASL/% ,$(genrule_files))
53089ab7c84db6fb76c16ca50076c147cda11757eschrockhaskell_files := $(filter Haskell/%,$(genrule_files))
2acef22db7808606888f8f92715629ff3ba555b9Matthew Ahrens###############
53089ab7c84db6fb76c16ca50076c147cda11757eschrock### clean up
53089ab7c84db6fb76c16ca50076c147cda11757eschrock### removes *.hi and *.o in all include directories
53089ab7c84db6fb76c16ca50076c147cda11757eschrock### remove binaries
53089ab7c84db6fb76c16ca50076c147cda11757eschrock### additonally removes *.d (dependency files) in every include directory
53089ab7c84db6fb76c16ca50076c147cda11757eschrock### also delete *.d.bak (dependency file backups)
53089ab7c84db6fb76c16ca50076c147cda11757eschrock### remove files also in own libraries
53089ab7c84db6fb76c16ca50076c147cda11757eschrock### additionally removes the files that define the sources-variable
53089ab7c84db6fb76c16ca50076c147cda11757eschrock### additionally removes files not in CVS tree
2acef22db7808606888f8f92715629ff3ba555b9Matthew Ahrens####################################################################
2acef22db7808606888f8f92715629ff3ba555b9Matthew Ahrens### test targets
2acef22db7808606888f8f92715629ff3ba555b9Matthew Ahrens####################################################################
43466aae47bfcd2ad9bf501faec8e75c08095e4fMax Grossman### a parser to test annotation parser and Id parsers
43466aae47bfcd2ad9bf501faec8e75c08095e4fMax GrossmanCommon/test_parser: Common/test_parser.hs Common/AS_Annotation.der.hs
43466aae47bfcd2ad9bf501faec8e75c08095e4fMax Grossman### interactive
43466aae47bfcd2ad9bf501faec8e75c08095e4fMax Grossman### christian's target
43466aae47bfcd2ad9bf501faec8e75c08095e4fMax Grossman### CASL parser
53089ab7c84db6fb76c16ca50076c147cda11757eschrock### HasCASL parser
2acef22db7808606888f8f92715629ff3ba555b9Matthew AhrensHasCASL/hacapa: HasCASL/hacapa.lhs CASL/capa HasCASL/*.hs
f17457368189aa911f774c38c1f21875a568bdcaMatthew Ahrens### Haskell parser
be6fd75a69ae679453d9cda5bff3326111e6d1caMatthew AhrensHaskell/hapa: Haskell/hapa.lhs Haskell/*.hs Haskell/Language/*.hs $(happy_files)
53089ab7c84db6fb76c16ca50076c147cda11757eschrock### Haskell wrap parser
53089ab7c84db6fb76c16ca50076c147cda11757eschrock### HetCASL parser
9a686fbc186e8e2a64e9a5094d44c7d6fa0ea167Paul Dagnelie### HetCASL parser
43466aae47bfcd2ad9bf501faec8e75c08095e4fMax Grossman### ATC test system
43466aae47bfcd2ad9bf501faec8e75c08095e4fMax Grossman### HetCASL with dev graph
43466aae47bfcd2ad9bf501faec8e75c08095e4fMax Grossman $(HC) --make -o $@ $< $(HC_OPTS) -package-conf ../uni/uni-package.conf -package uni-davinci -package uni-server
43466aae47bfcd2ad9bf501faec8e75c08095e4fMax Grossman### run tests in other directories
2acef22db7808606888f8f92715629ff3ba555b9Matthew Ahrens for i in $(TESTDIRS); do $(MAKE) -C $$i check; done
2acef22db7808606888f8f92715629ff3ba555b9Matthew Ahrens####################################################################
2acef22db7808606888f8f92715629ff3ba555b9Matthew Ahrens## Preparing the version of HetCATS
2acef22db7808606888f8f92715629ff3ba555b9Matthew Ahrenshetcats/Version.hs: hetcats/Version.in version_nr
2acef22db7808606888f8f92715629ff3ba555b9Matthew Ahrens $(PERL) utils/build_version.pl version_nr < hetcats/Version.in > $@
53089ab7c84db6fb76c16ca50076c147cda11757eschrock## two hardcoded dependencies for a correct generation of Version.hs
43466aae47bfcd2ad9bf501faec8e75c08095e4fMax Grossmanhetcats/Options.hs hetcats/WriteFn.hs hetcats/ReadFn.hs: hetcats/Version.hs
2acef22db7808606888f8f92715629ff3ba555b9Matthew Ahrens####################################################################
2acef22db7808606888f8f92715629ff3ba555b9Matthew Ahrens## rules for DrIFT
43466aae47bfcd2ad9bf501faec8e75c08095e4fMax Grossman# $(AG) $< -o $@
43466aae47bfcd2ad9bf501faec8e75c08095e4fMax Grossman## compiling rules for object and interface files
2acef22db7808606888f8f92715629ff3ba555b9Matthew Ahrens## compiling rules for dependencies
ca0cc3918a1789fa839194af2a9245f801a06b1aMatthew Ahrens####################################################################
ca0cc3918a1789fa839194af2a9245f801a06b1aMatthew Ahrens## Setting a global search path (for dependency files)
2acef22db7808606888f8f92715629ff3ba555b9Matthew Ahrens## include every .d file in INCLUDE_PATH