root / Makefile

1
# arch-tag: Main Makefile
2
# Copyright (C) 2004 - 2005 John Goerzen <jgoerzen@complete.org>
3
#
4
# This program is free software; you can redistribute it and/or modify
5
# it under the terms of the GNU Lesser General Public License as published by
6
# the Free Software Foundation; either version 2.1 of the License, or
7
# (at your option) any later version.
8
#
9
# This program is distributed in the hope that it will be useful,
10
# but WITHOUT ANY WARRANTY; without even the implied warranty of
11
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
# GNU Lesser General Public License for more details.
13
#
14
# You should have received a copy of the GNU Lesser General Public License
15
# along with this program; if not, write to the Free Software
16
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
17
18
PROJECT := ConfigFile
19
GHCPARMS := -fallow-overlapping-instances -fallow-undecidable-instances -fglasgow-exts -cpp
20
21
.PHONY: all hugsbuild
22
all: setup			# GHC build
23
	./setup configure
24
	./setup build
25
26
hugsbuild: setup
27
	./setup configure --hugs
28
	./setup build
29
30
setup: Setup.hs $(PROJECT).cabal
31
	ghc -package Cabal Setup.hs -o setup
32
33
doctmp/%.hs: %.lhs doctmp
34
	mkdir -p `dirname $@`
35
	$(UNLIT) $< $@
36
37
doctmp:
38
	mkdir doctmp
39
40
.PHONY: doc
41
doc: $(LHSCONVSOURCES) setup
42
	-rm -rf html
43
	./setup configure
44
	./setup haddock
45
#	haddock $(HADDOCKARGS) --package=$(PROJECT) \
46
#	   --dump-interface=html/$(PROJECT).haddock \
47
#	   -t '$(PROJECT) API Manual' -h -o html $(HUGSCONVSOURCES) $(LHSCONVSOURCES)
48
	mv dist/doc/html .
49
50
.PHONY: hugsbuild
51
52
53
clean:
54
	-./setup clean
55
	-rm -rf html `find . -name "*.o"` `find . -name "*.hi"` \
56
		`find . -name "*~"` *.a setup dist testsrc/runtests \
57
		local-pkg doctmp
58
	-rm -rf testtmp/*
59
60
.PHONY: local-pkg
61
local-pkg: all
62
	echo "[" > local-pkg
63
	cat .installed-pkg-config >> local-pkg
64
	echo "]" >> local-pkg
65
66
testsrc/runtests: all $(wildcard testsrc/*.hs) $(wildcard testsrc/*/*.hs) $(wildcard testsrc/*/*/*.hs)
67
	cd testsrc && ghc --make -package MissingH -package mtl $(GHCPARMS) -o runtests  -i../dist/build:../src runtests.hs
68
69
test-ghc6: testsrc/runtests
70
	testsrc/runtests
71
72
test-hugs: 
73
	runhugs -98 +o "-Fcpphs --noline" -P$(PWD)/src:$(PWD)/testsrc: testsrc/runtests.hs
74
75
interact-hugs:
76
	hugs -98 +o -P$(PWD)/dist/build:
77
78
interact-ghci: all
79
	ghci -idist/build -Ldist/build $(GHCPARMS)
80
81
interact: interact-hugs
82
83
test: test-ghc6 test-hugs
84