Makefile revision 23ab8855c58adfbd03a0730584b917b24c603901
# $Header$
# Author: (c) Klaus L�ttich, Christian Maeder, Uni Bremen 2002-2004
# Year: 2004
# This Makefile will compile the new hetcats system and provides also
# targets for test programs during implementation phases.
# !!! Note: This makefile is written for GNU make !!!
# (gmake on solaris ; make on linux)
####################################################################
## Some varibles, which control the compilation
COMMONLIB_PATH = Common/Lib:Common/ATerm:fgl/Data/Graph:fgl/Data/Graph/Inductive:fgl/Data/Graph/Inductive/Aux:fgl/Data/Graph/Inductive/Monad:fgl/Data/Graph/Inductive/Query
CLEAN_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:Taxonomy:$(PFE_PATHS)
## set ghc imports properly for your system
LINUX_IMPORTS = $(wildcard /home/linux-bkb/ghc/ghc-latest/lib/ghc-*/imports)
# the 'replacing spaces' example was taken from the (GNU) Make info manual
empty:=
# override on commandline for other architectures
# -ddump-minimal-imports
# flags also come in via ../uni/uni-package.conf
# but added it here in case of compilation without uni
HC_INCLUDE = -i$(INCLUDE_PATH)
UNI_PACKAGE_CONF := $(wildcard ../uni/uni-package.conf)
# some modules from uni for haddock
PFE_TOOLDIR := $(wildcard ../programatica/tools)
# add PFE_PATHS to DERIVEPATH if needed
# but name clashes currently prevent ATC generation in a single file
### Profiling (only for debugging)
### Attention every module must be compiled with profiling or the linker
### cannot link the various .o files properly. So after switching on
### Profiling, do an 'gmake real_clean; gmake'
### and comment out HC_PACKAGE variable definition above.
### Comment in the following line for switching on profiling.
#HC_PROF = -prof -auto-all
### list of directories to run checks in
####################################################################
## sources for hetcats (semi - manually produced with a perl script)
else
# sources that have {-# OPTIONS -cpp #-}
# this variable holds the modules that should be documented
####################################################################
### targets
#.PRECIOUS: sources_hetcats.mk
$(MAKE) real_clean
$(RM) $@
$(HC_FLAGS) -O
###############################
### TAGS files for (x)emacs
# load them with "M-x" "visit-tags-table" from
# use "M-." to search for a tag
# !!Beware this is somewhat instable, because it uses an absolute path!!
hetcats.TAGS: $(sources)
###############################
### count lines of code
###############################
### Documentation via haddock
# generate haddock documentation with links to sources
-t 'hets -- a heterogenous Specification (CASL) tool set'
# sources are not copied here
###############################
### release management
(cd utils/GenerateRules; \
GenerateRules.hs -o ../genRules && strip ../genRules)
$(INLINEAXIOMS): $(INLINEAXIOMS_deps)
$(HC_OPTS) -o $(INLINEAXIOMS)
#############################
### ATC DrIFT-rule generation
gen_atc_files = \
#############################
### programatica stuff
$< > $@
$@.hs -o $@
###############
### clean up
### removes *.hi and *.o in all include directories
### remove binaries
$(RM) test_parser
### additonally removes *.d (dependency files) in every include directory
### also delete *.d.bak (dependency file backups)
### remove files also in own libraries
### additionally removes the files that define the sources-variable
### additionally removes files not in CVS tree
$(RM) $(derived_files)
####################################################################
### test targets
####################################################################
### a parser to test annotation parser and Id parsers
### interactive
ghci:
### christian's target
### CASL parser
### HasCASL parser
### Haskell analysis
### HasCASL to Haskell translation
### HetCASL parser
### HetCASL parser
### ATC test system
### ATerm.Lib test system
### HetCASL with dev graph
### run tests in other directories
####################################################################
## Preparing the version of HetCATS
## two hardcoded dependencies for a correct generation of Version.hs
####################################################################
## rules for DrIFT
.SUFFIXES:
$(HAPPY) $<
%.hs: %.y
$(HAPPY) -o $@ $<
$(DRIFT) $(DRIFT_OPTS) $< > $@
## rules for inlineAxioms
$(INLINEAXIOMS) $< > $@
## rule for cpp and haddock
## compiling rules for object and interface files
## compiling rules for dependencies
%.d : %.hs
%.d : %.lhs
## rule for Modal/ModalSystems.hs needed for ModalLogic Translation
# hetcats-make is created as side-effect of hets or hets-optimized