Commit 8b42a5db authored by Iustin Pop's avatar Iustin Pop
Browse files

First try to embed VCS id in binaries

This patch attempts to embed the VCS id in binaries, based on the way
other projects seem to do this.
parent ea22656b
......@@ -4,7 +4,7 @@ HDDIR = apidoc
# Haskell rules
all:
all: version
$(MAKE) -C src
README.html: README
......@@ -15,17 +15,26 @@ doc: README.html
mkdir -p $(HDDIR)/src
cp hscolour.css $(HDDIR)/src
for file in $(HSRCS); do \
HsColour -css -anchor \
$$file > $(HDDIR)/src/`basename $$file .hs`.html ; \
done
HsColour -css -anchor \
$$file > $(HDDIR)/src/`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="src/%{MODULE/.//}.html" \
--source-entity="src/%{MODULE/.//}.html#%{NAME}" \
$(HSRCS)
clean:
rm -f *.o *.cmi *.cmo *.cmx *.old hn1 zn1 *.prof *.ps *.stat *.aux \
gmon.out *.hi README.html TAGS
gmon.out *.hi README.html TAGS version
.PHONY : all doc clean hn1
version:
git describe > $@
dist: version
VN=$$(cat version|sed 's/^v//') ; \
ANAME="htools-$$VN.tar" ; \
git archive --format=tar --prefix=htools-$$VN/ HEAD > $$ANAME ; \
tar -r -f $$ANAME --transform="s,^,htools-$$VN/," version
.PHONY : all doc clean hn1 dist
all: hn1 hbal
hn1:
hn1: Version.hs
ghc --make -O2 -W hn1
hbal:
hbal: Version.hs
ghc --make -O2 -W hbal
clean:
rm -f *.o *.old hn1 hbal *.prof *.ps *.stat *.aux \
*.hi README.html TAGS
*.hi README.html TAGS Version.hs
Version.hs: Version.hs.in ../version
sed -e "s/%ver%/$$(cat ../version)/" < $< > $@
.PHONY : all clean hn1 hbal
module Version
(
version -- ^ the version of the tree
) where
version = "(htools) version %ver%"
......@@ -16,6 +16,7 @@ import Text.Printf (printf)
import qualified Container
import qualified Cluster
import qualified Version
import Rapi
import Utils
......@@ -120,7 +121,8 @@ parseOpts argv =
return (foldl (flip id) defaultOptions o, n)
(_,_,errs) ->
ioError (userError (concat errs ++ usageInfo header options))
where header = "Usage: hbal [OPTION...]"
where header = printf "hbal %s\nUsage: hbal [OPTION...]"
Version.version
-- | Main function.
main :: IO ()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment