root / Makefile

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