X-Git-Url: https://code.grnet.gr/git/ganeti-local/blobdiff_plain/8df5db55112bae8a371ec3778da47a9649dca858..9188aeef6e1dd61a16053dbf56c7b16a077f01c8:/Makefile diff --git a/Makefile b/Makefile index a5c06cc..ae50834 100644 --- a/Makefile +++ b/Makefile @@ -1,31 +1,74 @@ -HPROGS = hbal hn1 -HSRCS := $(filter-out $(HPROGS), $(wildcard src/*.hs)) +HPROGS = hbal hn1 hscan hail +HALLPROGS = $(HPROGS) test +HSRCS := $(wildcard Ganeti/HTools/*.hs) HDDIR = apidoc +DOCS = README.html NEWS.html + +HFLAGS = -O2 -W -fwarn-monomorphism-restriction -fwarn-tabs +HEXTRA = + +HPCEXCL = --exclude Main --exclude Ganeti.HTools.QC + # Haskell rules -all: - $(MAKE) -C src +all: $(HPROGS) -README.html: README +$(HALLPROGS): %: %.hs Ganeti/HTools/Version.hs $(HSRCS) Makefile + ghc --make $(HFLAGS) $(HEXTRA) $@ + +test: HEXTRA=-fhpc + +$(DOCS) : %.html : % rst2html $< $@ -doc: README.html - rm -rf $(HDDIR) - mkdir -p $(HDDIR)/src - cp hscolour.css $(HDDIR)/src +doc: $(DOCS) Ganeti/HTools/Version.hs + rm -rf $(HDDIR)/* + mkdir -p $(HDDIR)/Ganeti/HTools + cp hscolour.css $(HDDIR)/Ganeti/HTools for file in $(HSRCS); do \ - HsColour -css -anchor \ - $$file > $(HDDIR)/src/`basename $$file .hs`.html ; \ - done + HsColour -css -anchor \ + $$file > $(HDDIR)/Ganeti/HTools/`basename $$file .hs`.html ; \ + done haddock --odir $(HDDIR) --html --ignore-all-exports \ - -t htools -p haddock-prologue \ - --source-module="src/%{MODULE/.//}.html" \ - --source-entity="src/%{MODULE/.//}.html#%{NAME}" \ - $(HSRCS) + -t htools -p haddock-prologue \ + --source-module="%{MODULE/.//}.html" \ + --source-entity="%{MODULE/.//}.html#%{NAME}" \ + $(HSRCS) + +maintainer-clean: + rm -rf $(HDDIR) + rm -f $(DOCS) TAGS version Ganeti/HTools/Version.hs clean: - rm -f *.o *.cmi *.cmo *.cmx *.old hn1 zn1 *.prof *.ps *.stat *.aux \ - gmon.out *.hi README.html TAGS + rm -f $(HALLPROGS) + rm -f *.o *.prof *.ps *.stat *.aux *.hi + cd Ganeti/HTools && rm -f *.o *.prof *.ps *.stat *.aux *.hi + +version: + git describe > $@ + +Ganeti/HTools/Version.hs: Ganeti/HTools/Version.hs.in version + sed -e "s/%ver%/$$(cat version)/" < $< > $@ + +dist: Ganeti/HTools/Version.hs version doc + VN=$$(cat version|sed 's/^v//') ; \ + ANAME="htools-$$VN.tar" ; \ + rm -f $$ANAME $$ANAME.gz ; \ + git archive --format=tar --prefix=htools-$$VN/ HEAD > $$ANAME ; \ + tar -r -f $$ANAME --owner root --group root \ + --transform="s,^,htools-$$VN/," version apidoc $(DOCS) ; \ + gzip -v9 $$ANAME ; \ + tar tzvf $$ANAME.gz + +check: test + rm -f *.tix *.mix + ./test +ifeq ($(T),markup) + mkdir -p coverage + hpc markup --destdir=coverage test $(HPCEXCL) +else + hpc report test $(HPCEXCL) +endif -.PHONY : all doc clean hn1 +.PHONY : all doc maintainer-clean clean dist check