GenI natural language generator (http://kowey.github.com/GenI)

root / Makefile

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# --------------------------------------------------------------------
# source stuff
# --------------------------------------------------------------------

SOURCE_FILES=$(shell find src geni-gui -name '*.*hs' -o -name '*.lhs')
GUI_SOURCE_FILES=$(shell cd geni-gui; find . -name '*.hs')

SCRIPT_FILES = bin/tryXtimes\
	       etc/stupidmorph.pl\
	       etc/tommorph.pl\
	       etc/perf-latest.sh\
	       etc/perf-save.sh\

# Phony targets do not keep track of file modification times
.PHONY: docs doc maindoc html release\

# --------------------------------------------------------------------
# main targets
# --------------------------------------------------------------------

all: tags geni-gui/tags build

build: dist/build/geni/geni

dist/build/geni/geni: $(SOURCE_FILES)
	cabal build

init: permissions

permissions: $(config_file)
	chmod u+x $(SCRIPT_FILES)

define clean-hasktags =
LC_ALL=C sort $@ > $@.tmp
mv $@.tmp $@
endef

tags: $(SOURCE_FILES)
	hasktags -c $^
	$(clean-hasktags)
	
geni-gui/tags:
	cd $(<D); hasktags -c $(GUI_SOURCE_FILES)
	$(clean-hasktags)

# --------------------------------------------------------------------
# testing
# --------------------------------------------------------------------

test: unit regression

regression: etc/SumHUnit
	@chmod u+x etc/regression
	etc/regression

unit: dist/build/geni/geni
	dist/build/geni/geni --unit

etc/SumHUnit : etc/SumHUnit.hs
	ghc --make -o $@ $<

# --------------------------------------------------------------------
# documentation
# --------------------------------------------------------------------

doc:
	cabal haddock
	rsync -av dist/doc/html/GenI/ doc/_site/api-doc
	cd doc; ../cabal-dev/bin/geni-doc build
	@echo "REMEMBER TO DO: cd doc/_site; git push"