ReleaseMakefile revision 03a6d8f77f588dc5d3dd6653797fa2362efa1751
# Makefile for a Release
# $Header$
# Author: (c) Christian Maeder, Uni Bremen 2002-2004
# Year: 2004
# This Makefile will compile the hets sources
# note that you'll need the "uni" library residing in ".."
# from http://www.informatik.uni-bremen.de/~ger/cvs/CVS.html
####################################################################
## Some varibles, which control the compilation
HC = ghc
# check for the "uni" library
UNI_PACKAGE_CONF = $(wildcard ../uni/uni-package.conf)
ifneq ($(strip $(UNI_PACKAGE_CONF)),)
HC_PACKAGE = -package-conf $(UNI_PACKAGE_CONF) -package uni-davinci \
-package uni-server -DUNI_PACKAGE
endif
# check for programatica
PFE_TOOLDIR = $(wildcard ../programatica/tools)
ifneq ($(strip $(PFE_TOOLDIR)),)
PFE_DIRS = base/AST base/TI base/parse2 base/parse2/Lexer base/parse2/Parser \
base/parse2/LexerGen base/parse2/LexerSpec base/tests/HbcLibraries \
base/pretty base/syntax base/lib base/lib/Monads base/Modules base/defs \
base/transforms base/transforms/Deriving property \
property/syntax property/AST property/transforms \
property/TI property/defs property/parse2 property/parse2/Parser
PFE_PATH = $(addprefix -i$(PFE_TOOLDIR)/, $(PFE_DIRS))
PFE_FLAGS = -package programatica -DPROGRAMATICA
endif
# check for new HaXml-1.13.2
HAXMLVERSION = $(shell ghc-pkg field HaXml version)
ifneq ($(findstring 1.13.2, $(HAXMLVERSION)),)
HAXML_PACKAGE = -package HaXml -DHAXML_PACKAGE
endif
# OPTS without uni packages
HC_OPTS1 = -fglasgow-exts -fallow-overlapping-instances \
$(PFE_FLAGS) -DCASLEXTENSIONS
HC_OPTS = $(HAXML_PACKAGE) $(HC_OPTS1) $(HC_PACKAGE)
####################################################################
### targets
.PHONY : all clean o_clean bin_clean depend
all: hets
depend:
$(HC) -M hets.hs $(HC_OPTS)
hets: hets.o
$(HC) --make -O -o $@ hets.hs $(HC_OPTS) -w
strip hets
%.o: %.hs
@$(HC) -v0 -w -c -O $< $(HC_OPTS)
%.o: %.lhs
@$(HC) -v0 -w -c -O $< $(HC_OPTS)
%.hi: %.o
@:
hets.cgi:
$(HC) --make -O GUI/hets_cgi.hs -o $@ $(HC_OPTS) -w
strip hets.cgi
###############
### clean up
### remove binaries
bin_clean:
$(RM) hets hets.cgi
### remove *.hi and *.o
o_clean:
find . -name \*.o -o -name \*.hi | xargs $(RM) -r
clean: o_clean bin_clean