Makefile revision d946c1bfdd7d58aa7c023efe864d5999eb44a61b
# Makefile
# $Header$
# Author: (c) Klaus L�ttich, Christian Maeder, Uni Bremen 2002-2005
# Year: 2004
# This Makefile will compile the new hets system and provides also
# targets for test programs during implementation phases.
# !!! Note: This makefile is written for GNU make !!!
# (gmake on solaris)
####################################################################
## Some varibles, which control the compilation
# the 'replacing spaces' example was taken from the (GNU) Make info manual
empty =
## set ghc imports properly for your system
# import directories for ghc-5.04.2
DRIFT_ENV = \
# override on commandline for other architectures
INSTALLDIR = \
# remove -fno-warn-orphans for older ghcs and add -ifgl
HC_FLAGS = \
# -ddump-minimal-imports
# flags also come in via ../uni/uni-package.conf
# but added it here in case of compilation without uni
UNI_PACKAGE_CONF = $(wildcard ../uni/uni-package.conf)
# some modules from uni for haddock
### list of directories to run checks in
PFE_TOOLDIR = $(wildcard ../programatica/tools)
echo "{-# OPTIONS -w #-}" > $@
$< >> $@
$@.hs -o $@
strip $@
## rule for appendHaskellPreludeString
$(APPENDPRELUDESTRING) < $< > $@
#Ti_Haskell_files = TiTypes TiKinds TiDecorate TiInstanceDB
#Ti_Prop_files = property/TI/TiPropDecorate property/syntax/PropSyntaxRec
Haskell_files = $(addsuffix .hs, \
## rule for ATC generation
### 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'
### Comment in the following line for switching on profiling.
#HC_PROF = -prof -auto-all -fignore-asserts
####################################################################
## sources for hets
SOURCE_PATHS = $(CLEAN_PATH)
#endif
$(GENRULECALL) -o $@ $<
$(GENRULECALL) -o $@ $<
# sources that have {-# OPTIONS -cpp #-}
# unused, remove when header files are gone
nondoc_sources = $(wildcard utils/DrIFT-src/*.hs) \
$(wildcard utils/GenerateRules/*.hs) \
$(wildcard utils/InlineAxioms/*.hs) \
# this variable holds the modules that should be documented
####################################################################
### targets
$(RM) $@
cgi:
$(MAKE) real_clean
###############################
### TAGS files for (x)emacs
# load them with "M-x" "visit-tags-table" from
# "HetCATS/hetcats.TAGS"
# use "M-." to search for a tag
# !!Beware this is somewhat instable, because it uses an absolute path!!
hetcats.TAGS: $(sources)
@echo 'File : Maintainer' > $@
@echo -n Generating $@ " "
@$(PERL) -e \
'foreach my $$f (@ARGV) { open I, "<$$f"; \
print "$$f :"; while (<I>) \
{ if(m,^\s*Maintainer\s*:\s*(.*)$$,o) { \
print " $$1" ; last} }; print "\n"; close I; }' \
$(sources) >> $@
@echo " done"
###############################
### count lines of code
###############################
### Documentation via haddock
# generate haddock documentation with links to sources
HINTERFACES=`echo $$HINTERFACES0 | \
-t 'Hets - the Heterogeneous Tool Set' \
# sources are not copied here
###############################
### release management
(cd utils/GenerateRules; \
GenerateRules.hs -o ../genRules && strip ../genRules)
# "hssource" for ghc-5.04.2
$(INLINEAXIOMS): $(INLINEAXIOMS_deps)
$(RM) -r programatica
if [ -d ../programatica ] ; then \
./clean.sh; \
#############################
### ATC DrIFT-rule generation
-o $@ $(OWL_DL_files)
###############
### clean up
### removes *.hi and *.o in all include directories
for p in $(CLEAN_PATH) ; do \
### remove binaries
$(RM) test_parser
### additionally removes the library files
### additionally removes generated files not in the CVS tree
$(RM) $(derived_sources)
####################################################################
### test targets
####################################################################
### a parser to test annotation parser and Id parsers
### interactive
ghci: $(derived_sources)
### christian's target
### CASL parser
### HasCASL parser
### Haskell wrapper parser
### Isar parser
### Haskell analysis
### Haskell to Isabelle-HOLCF translation
### HasCASL to Haskell translation
### HetCASL parser
### HetCASL parser
### ATC test system
### ATerm.Lib test system
### OWL_DL test target
### HetCASL with dev graph
### run tests in other directories
check: $(TESTTARGETS)
####################################################################
## Preparing the version of HetCATS
$(RM) $@
chmod 444 $@
## two hardcoded dependencies for a correct generation of Version.hs
####################################################################
## rules for DrIFT
.SUFFIXES:
%: %.hs
%.hs: %.y
echo "{-# OPTIONS -w #-}" > $@
$(RM) $@
chmod 444 $@
## rules for inlineAxioms
$(RM) $@
$(INLINEAXIOMS) $< > $@
chmod 444 $@
## 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
# uses intransparently utils/outlineAxioms
$(RM) $@
chmod 444 $@