~ubuntu-branches/ubuntu/trusty/ocaml-csv/trusty

« back to all changes in this revision

Viewing changes to Makefile

  • Committer: Bazaar Package Importer
  • Author(s): Stéphane Glondu
  • Date: 2011-07-11 22:35:33 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20110711223533-hvkx2p1qvmrr0weu
Tags: 1.2.2-1
* New upstream release
* Bump Standards-Version to 3.9.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
ROOT=.
2
 
include $(ROOT)/Makefile.conf
3
 
 
4
 
.PHONY: default all opt byte native install uninstall htdoc doc tests examples
5
 
default: byte opt
6
 
all: byte
7
 
opt: native
8
 
htdoc: doc
9
 
byte native install uninstall doc:
10
 
        $(MAKE) -C src $@
11
 
tests examples: byte
12
 
        $(MAKE) -C $@
 
1
PKGNAME     = $(shell oasis query name)
 
2
PKGVERSION  = $(shell oasis query version)
 
3
PKG_TARBALL = $(PKGNAME)-$(PKGVERSION).tar.gz
 
4
OCAMLFORGE_FILE_NO = 420
 
5
 
 
6
DISTFILES   = LICENSE.txt AUTHORS.txt INSTALL.txt README.txt _oasis \
 
7
  _tags src/META Makefile setup.ml myocamlbuild.ml API.odocl \
 
8
  $(wildcard src/) $(wildcard examples/) $(wildcard tests/)
 
9
 
 
10
WEB = shell.forge.ocamlcore.org:/home/groups/csv/htdocs
 
11
 
 
12
.PHONY: all byte native configure doc test install uninstall reinstall \
 
13
  upload-doc
 
14
 
 
15
all byte native: configure
 
16
        ocaml setup.ml -build
 
17
 
 
18
configure: setup.ml
 
19
        ocaml $< -configure
 
20
 
 
21
setup.ml: _oasis
 
22
        oasis setup
 
23
 
 
24
test doc install uninstall reinstall: all
 
25
        ocaml setup.ml -$@
 
26
 
 
27
upload-doc: doc
 
28
        scp -C -p -r _build/API.docdir $(WEB)
13
29
 
14
30
csv.godiva: csv.godiva.in
15
 
        @ sed -e "s/@PACKAGE@/$(PACKAGE)/" $< \
16
 
        | sed -e "s/@VERSION@/$(VERSION)/" \
17
 
        | sed -e "s/@TARBALL@/$(TARBALL)/" \
 
31
        @ sed -e "s/@PACKAGE@/$(PKGNAME)/" $< \
 
32
        | sed -e "s/@VERSION@/$(PKGVERSION)/" \
 
33
        | sed -e "s/@TARBALL@/$(PKG_TARBALL)/" \
18
34
        | sed -e "s/@DOWNLOAD@/$(OCAMLFORGE_FILE_NO)/" > $@
19
35
        @ echo "Updated \"$@\"."
20
36
 
21
37
# Assume the environment variable $GODI_LOCALBASE is set
22
 
.PHONY: godi
 
38
.PHONY: godi tar dist web
23
39
godi: csv.godiva
24
40
        godiva $<
25
41
 
26
42
# "Force" a tag to be defined for each released tarball
27
 
tar:
28
 
        bzr export /tmp/$(TARBALL) -r "tag:$(VERSION)"
29
 
        @echo "Created tarball '/tmp/$(TARBALL)'."
 
43
dist tar: setup.ml
 
44
        @ if [ -z "$(PKGNAME)" ]; then echo "PKGNAME not defined"; exit 1; fi
 
45
        @ if [ -z "$(PKGVERSION)" ]; then \
 
46
                echo "PKGVERSION not defined"; exit 1; fi
 
47
        mkdir $(PKGNAME)-$(PKGVERSION)
 
48
        cp -r $(DISTFILES) $(PKGNAME)-$(PKGVERSION)/
 
49
        tar -zcvf $(PKG_TARBALL) $(PKGNAME)-$(PKGVERSION)
 
50
        $(RM) -rf $(PKGNAME)-$(PKGVERSION)
30
51
 
31
 
.PHONY: web
32
52
web: doc
33
53
        $(MAKE) -C doc $@
34
54
 
35
 
.PHONY: clean
36
 
clean:
37
 
        $(RM) $(wildcard *~ *.pdf *.ps *.png *.svg) csv.godiva
38
 
        $(RM) -rf $(DOC_DIR)
39
 
        $(MAKE) -C src $@
40
 
        $(MAKE) -C tests $@
41
 
        $(MAKE) -C examples $@
 
55
.PHONY: clean distclean
 
56
clean::
 
57
        ocaml setup.ml -clean
 
58
        $(RM) $(PKG_TARBALL)
 
59
 
 
60
distclean:
 
61
        ocaml setup.ml -distclean
 
62
        $(RM) $(wildcard *.ba[0-9] *.bak *~ *.odocl) setup.log