Revision 968de7fc Makefile

b/Makefile
1 1
HPROGS = hbal hn1
2
HSRCS := $(filter-out $(HPROGS), $(wildcard src/*.hs))
2
HSRCS := $(wildcard Ganeti/HTools/*.hs)
3 3
HDDIR = apidoc
4 4

  
5
DOCS = README.html NEWS.html
6

  
5 7
# Haskell rules
6 8

  
7
all: hbal hn1
9
all: $(HPROGS)
8 10

  
9 11
hn1 hbal: Ganeti/HTools/Version.hs
10 12
	ghc --make -O2 -W $@
11 13

  
12
README.html: README
14
$(DOCS) : %.html : %
13 15
	rst2html $< $@
14 16

  
15
doc: README.html
17
doc: $(DOCS)
16 18
	rm -rf $(HDDIR)
17
	mkdir -p $(HDDIR)/src
18
	cp hscolour.css $(HDDIR)/src
19
	mkdir -p $(HDDIR)/Ganeti/HTools
20
	cp hscolour.css $(HDDIR)/Ganeti/HTools
19 21
	for file in $(HSRCS); do \
20 22
		HsColour -css -anchor \
21
		$$file > $(HDDIR)/src/`basename $$file .hs`.html ; \
23
		$$file > $(HDDIR)/Ganeti/HTools/`basename $$file .hs`.html ; \
22 24
	done
23 25
	haddock --odir $(HDDIR) --html --ignore-all-exports \
24 26
		-t htools -p haddock-prologue \
25
		--source-module="src/%{MODULE/.//}.html" \
26
		--source-entity="src/%{MODULE/.//}.html#%{NAME}" \
27
		--source-module="Ganeti/HTools/%{MODULE/.//}.html" \
28
		--source-entity="Ganeti/HTools/%{MODULE/.//}.html#%{NAME}" \
27 29
		$(HSRCS)
28 30

  
29 31
clean:
30
	rm -f *.o hn1 zn1 *.prof *.ps *.stat *.aux \
31
	    gmon.out *.hi README.html TAGS Ganeti/HTools/Version.hs
32
	git describe >/dev/null && rm -f version
32
	rm -f hbal hn1
33
	rm -f *.o *.prof *.ps *.stat *.aux *.hi
34
	cd Ganeti/HTools && rm -f *.o *.prof *.ps *.stat *.aux *.hi
35
	rm -f $(DOCS) TAGS Ganeti/HTools/Version.hs
36
	git describe >/dev/null 2>&1 && rm -f version || true
33 37

  
34 38
version:
35 39
	git describe > $@
36 40

  
37 41
Ganeti/HTools/Version.hs: Ganeti/HTools/Version.hs.in version
38
	sed -e "s/%ver%/$$(cat ../version)/" < $< > $@
42
	sed -e "s/%ver%/$$(cat version)/" < $< > $@
39 43

  
40
dist: version
44
dist: version doc
41 45
	VN=$$(cat version|sed 's/^v//') ; \
42 46
	ANAME="htools-$$VN.tar" ; \
43 47
	rm -f $$ANAME $$ANAME.gz ; \
......
47 51
	gzip -v9 $$ANAME ; \
48 52
	tar tzvf $$ANAME.gz
49 53

  
50
.PHONY : all doc clean hn1 dist
54
.PHONY : all doc clean dist

Also available in: Unified diff