Statistics
| Branch: | Tag: | Revision:

root / Makefile @ 050b0c38

History | View | Annotate | Download (1.4 kB)

1 127e0396 Iustin Pop
HPROGS = hbal hn1 hscan
2 968de7fc Iustin Pop
HSRCS := $(wildcard Ganeti/HTools/*.hs)
3 e4f08c46 Iustin Pop
HDDIR = apidoc
4 e4f08c46 Iustin Pop
5 968de7fc Iustin Pop
DOCS = README.html NEWS.html
6 968de7fc Iustin Pop
7 e4f08c46 Iustin Pop
# Haskell rules
8 e4f08c46 Iustin Pop
9 968de7fc Iustin Pop
all: $(HPROGS)
10 669d7e3d Iustin Pop
11 7847a037 Iustin Pop
$(HPROGS): %: %.hs Ganeti/HTools/Version.hs $(HSRCS) Makefile
12 669d7e3d Iustin Pop
	ghc --make -O2 -W $@
13 e4f08c46 Iustin Pop
14 968de7fc Iustin Pop
$(DOCS) : %.html : %
15 e4f08c46 Iustin Pop
	rst2html $< $@
16 e4f08c46 Iustin Pop
17 968de7fc Iustin Pop
doc: $(DOCS)
18 e4f08c46 Iustin Pop
	rm -rf $(HDDIR)
19 968de7fc Iustin Pop
	mkdir -p $(HDDIR)/Ganeti/HTools
20 968de7fc Iustin Pop
	cp hscolour.css $(HDDIR)/Ganeti/HTools
21 e4f08c46 Iustin Pop
	for file in $(HSRCS); do \
22 8b42a5db Iustin Pop
		HsColour -css -anchor \
23 968de7fc Iustin Pop
		$$file > $(HDDIR)/Ganeti/HTools/`basename $$file .hs`.html ; \
24 8b42a5db Iustin Pop
	done
25 e4f08c46 Iustin Pop
	haddock --odir $(HDDIR) --html --ignore-all-exports \
26 8b42a5db Iustin Pop
		-t htools -p haddock-prologue \
27 7ae514ba Iustin Pop
		--source-module="%{MODULE/.//}.html" \
28 7ae514ba Iustin Pop
		--source-entity="%{MODULE/.//}.html#%{NAME}" \
29 8b42a5db Iustin Pop
		$(HSRCS)
30 e4f08c46 Iustin Pop
31 e4f08c46 Iustin Pop
clean:
32 050b0c38 Iustin Pop
	rm -f $(HPROGS)
33 968de7fc Iustin Pop
	rm -f *.o *.prof *.ps *.stat *.aux *.hi
34 968de7fc Iustin Pop
	cd Ganeti/HTools && rm -f *.o *.prof *.ps *.stat *.aux *.hi
35 968de7fc Iustin Pop
	rm -f $(DOCS) TAGS Ganeti/HTools/Version.hs
36 968de7fc Iustin Pop
	git describe >/dev/null 2>&1 && rm -f version || true
37 e4f08c46 Iustin Pop
38 8b42a5db Iustin Pop
version:
39 8b42a5db Iustin Pop
	git describe > $@
40 8b42a5db Iustin Pop
41 669d7e3d Iustin Pop
Ganeti/HTools/Version.hs: Ganeti/HTools/Version.hs.in version
42 968de7fc Iustin Pop
	sed -e "s/%ver%/$$(cat version)/" < $< > $@
43 669d7e3d Iustin Pop
44 968de7fc Iustin Pop
dist: version doc
45 8b42a5db Iustin Pop
	VN=$$(cat version|sed 's/^v//') ; \
46 8b42a5db Iustin Pop
	ANAME="htools-$$VN.tar" ; \
47 669d7e3d Iustin Pop
	rm -f $$ANAME $$ANAME.gz ; \
48 669d7e3d Iustin Pop
	git archive --format=tar --prefix=htools-$$VN/ HEAD > $$ANAME ; \
49 669d7e3d Iustin Pop
	tar -r -f $$ANAME --owner root --group root \
50 6ef35e3c Iustin Pop
	    --transform="s,^,htools-$$VN/," version apidoc $(DOCS) ; \
51 669d7e3d Iustin Pop
	gzip -v9 $$ANAME ; \
52 669d7e3d Iustin Pop
	tar tzvf $$ANAME.gz
53 8b42a5db Iustin Pop
54 968de7fc Iustin Pop
.PHONY : all doc clean dist