From 968de7fc28b8ec997e2f88d6e849bdfdbfd02391 Mon Sep 17 00:00:00 2001 From: Iustin Pop Date: Fri, 20 Mar 2009 19:26:10 +0100 Subject: [PATCH] Fix/enhance makefile rules after the rename --- Makefile | 34 +++++++++++++++++++--------------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/Makefile b/Makefile index 9f1f383..cf7a064 100644 --- a/Makefile +++ b/Makefile @@ -1,43 +1,47 @@ HPROGS = hbal hn1 -HSRCS := $(filter-out $(HPROGS), $(wildcard src/*.hs)) +HSRCS := $(wildcard Ganeti/HTools/*.hs) HDDIR = apidoc +DOCS = README.html NEWS.html + # Haskell rules -all: hbal hn1 +all: $(HPROGS) hn1 hbal: Ganeti/HTools/Version.hs ghc --make -O2 -W $@ -README.html: README +$(DOCS) : %.html : % rst2html $< $@ -doc: README.html +doc: $(DOCS) rm -rf $(HDDIR) - mkdir -p $(HDDIR)/src - cp hscolour.css $(HDDIR)/src + 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 ; \ + $$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}" \ + --source-module="Ganeti/HTools/%{MODULE/.//}.html" \ + --source-entity="Ganeti/HTools/%{MODULE/.//}.html#%{NAME}" \ $(HSRCS) clean: - rm -f *.o hn1 zn1 *.prof *.ps *.stat *.aux \ - gmon.out *.hi README.html TAGS Ganeti/HTools/Version.hs - git describe >/dev/null && rm -f version + rm -f hbal hn1 + rm -f *.o *.prof *.ps *.stat *.aux *.hi + cd Ganeti/HTools && rm -f *.o *.prof *.ps *.stat *.aux *.hi + rm -f $(DOCS) TAGS Ganeti/HTools/Version.hs + git describe >/dev/null 2>&1 && rm -f version || true version: git describe > $@ Ganeti/HTools/Version.hs: Ganeti/HTools/Version.hs.in version - sed -e "s/%ver%/$$(cat ../version)/" < $< > $@ + sed -e "s/%ver%/$$(cat version)/" < $< > $@ -dist: version +dist: version doc VN=$$(cat version|sed 's/^v//') ; \ ANAME="htools-$$VN.tar" ; \ rm -f $$ANAME $$ANAME.gz ; \ @@ -47,4 +51,4 @@ dist: version gzip -v9 $$ANAME ; \ tar tzvf $$ANAME.gz -.PHONY : all doc clean hn1 dist +.PHONY : all doc clean dist -- 1.7.10.4