Statistics
| Branch: | Tag: | Revision:

root / Makefile @ ef53b4b2

History | View | Annotate | Download (1.8 kB)

1
HPROGS = hbal hn1 hscan hail
2
HALLPROGS = $(HPROGS) test
3
HSRCS := $(wildcard Ganeti/HTools/*.hs)
4
HDDIR = apidoc
5

    
6
DOCS = README.html NEWS.html
7

    
8
HFLAGS = -O2 -W -fwarn-monomorphism-restriction -fwarn-tabs
9
HEXTRA =
10

    
11
HPCEXCL = --exclude Main --exclude Ganeti.HTools.QC
12

    
13
# Haskell rules
14

    
15
all: $(HPROGS)
16

    
17
$(HALLPROGS): %: %.hs Ganeti/HTools/Version.hs $(HSRCS) Makefile
18
	ghc --make $(HFLAGS) $(HEXTRA) $@
19

    
20
test: HEXTRA=-fhpc
21

    
22
$(DOCS) : %.html : %
23
	rst2html $< $@
24

    
25
doc: $(DOCS)
26
	rm -rf $(HDDIR)
27
	mkdir -p $(HDDIR)/Ganeti/HTools
28
	cp hscolour.css $(HDDIR)/Ganeti/HTools
29
	for file in $(HSRCS); do \
30
		HsColour -css -anchor \
31
		$$file > $(HDDIR)/Ganeti/HTools/`basename $$file .hs`.html ; \
32
	done
33
	haddock --odir $(HDDIR) --html --ignore-all-exports \
34
		-t htools -p haddock-prologue \
35
		--source-module="%{MODULE/.//}.html" \
36
		--source-entity="%{MODULE/.//}.html#%{NAME}" \
37
		$(HSRCS)
38

    
39
maintainer-clean:
40
	rm -rf $(HDDIR)
41
	rm -f $(DOCS) TAGS version Ganeti/HTools/Version.hs
42

    
43
clean:
44
	rm -f $(HALLPROGS)
45
	rm -f *.o *.prof *.ps *.stat *.aux *.hi
46
	cd Ganeti/HTools && rm -f *.o *.prof *.ps *.stat *.aux *.hi
47

    
48
version:
49
	git describe > $@
50

    
51
Ganeti/HTools/Version.hs: Ganeti/HTools/Version.hs.in version
52
	sed -e "s/%ver%/$$(cat version)/" < $< > $@
53

    
54
dist: Ganeti/HTools/Version.hs version doc
55
	VN=$$(cat version|sed 's/^v//') ; \
56
	ANAME="htools-$$VN.tar" ; \
57
	rm -f $$ANAME $$ANAME.gz ; \
58
	git archive --format=tar --prefix=htools-$$VN/ HEAD > $$ANAME ; \
59
	tar -r -f $$ANAME --owner root --group root \
60
	    --transform="s,^,htools-$$VN/," version apidoc $(DOCS) ; \
61
	gzip -v9 $$ANAME ; \
62
	tar tzvf $$ANAME.gz
63

    
64
check: test
65
	rm -f *.tix *.mix
66
	./test
67
ifeq ($(T),markup)
68
	mkdir -p coverage
69
	hpc markup --destdir=coverage test $(HPCEXCL)
70
else
71
	hpc report test $(HPCEXCL)
72
endif
73

    
74
.PHONY : all doc maintainer-clean clean dist check