Permalink
Browse files

Ajout d'un Makefile pour compiler et installer (avec DESTDIR) sans êt…

…re root.

Probablement à ajouter sous forme de patch dans un paquet Debian
  • Loading branch information...
1 parent a9ac7d3 commit b96ee974f95dd62c99c8028d6948eaae9af820b4 @vdanjean committed Oct 3, 2012
Showing with 98 additions and 0 deletions.
  1. +98 −0 Makefile
View
98 Makefile
@@ -0,0 +1,98 @@
+DESTDIR=
+prefix=/usr/local
+exec_prefix=$(prefix)
+bindir=$(exec_prefix)/bin
+libdir=$(exec_prefix)/lib
+datadir=$(prefix)/share
+mandir=$(datadir)/man
+
+SHELL=bash
+
+all: stamp-world-install
+
+clean::
+ $(MAKE) -C src clean
+ $(MAKE) -C contrib clean
+ $(RM) -r inst
+ $(RM) log.world-local log.install-local log.contrib log.bootstrap log.world-install
+ $(RM) stamp-world-local stamp-install-local stamp-contrib stamp-bootstrap stamp-world-install
+ $(RM) src/*.1 src/camlrun src/camlyacc
+ $(RM) contrib/camltk4/compiler/parser.output
+
+distclean:: clean
+ $(RM) config/m.h config/s.h
+ $(RM) log.configure
+ $(RM) stamp-configure
+ for f in comp lex libr link ; do \
+ if test -f src/caml$$f.orig ; then \
+ mv -f src/caml$$f.orig src/caml$$f ;\
+ fi ;\
+ done
+
+stamp-configure:
+ set -o pipefail ; $(MAKE) -C src configure \
+ 2>&1 | tee log.configure
+ for f in comp lex libr link ; do \
+ cp src/caml$$f src/caml$$f.orig ;\
+ done
+ touch $@
+
+stamp-world-local: stamp-configure
+ set -o pipefail ; $(MAKE) -C src world \
+ VBINDIR=$(CURDIR)/inst/bin \
+ LIBDIR=$(CURDIR)/inst/lib/caml-light \
+ MANDIR=$(CURDIR)/inst/man/man1 \
+ 2>&1 | tee log.world-local
+ grep '#- : int = 10946' log.world-local
+ touch $@
+
+stamp-bootstrap: stamp-world-local
+ set -o pipefail ; $(MAKE) -C src bootstrap \
+ VBINDIR=$(CURDIR)/inst/bin \
+ LIBDIR=$(CURDIR)/inst/lib/caml-light \
+ MANDIR=$(CURDIR)/inst/man/man1 \
+ 2>&1 | tee log.bootstrap
+ grep '^The Caml Light system has successfully recompiled itself.$$' log.bootstrap
+ touch $@
+
+stamp-install-local: stamp-bootstrap
+ set -o pipefail ; $(MAKE) -C src install \
+ VBINDIR=$(CURDIR)/inst/bin \
+ LIBDIR=$(CURDIR)/inst/lib/caml-light \
+ MANDIR=$(CURDIR)/inst/man/man1 \
+ 2>&1 | tee log.install-local
+ touch $@
+
+stamp-contrib: stamp-install-local
+ set -o pipefail ; $(MAKE) -C contrib all \
+ PATH=$(CURDIR)/inst/bin:$(PATH) \
+ TKINCLDIR=/usr/include/tcl8.5 \
+ TKLIBS="-ltk8.5 -ltcl8.5 -lX11" \
+ 2>&1 | tee log.contrib
+ touch $@
+
+stamp-world-install: stamp-contrib
+ $(MAKE) -C src clean
+ set -o pipefail ; $(MAKE) -C src world \
+ VBINDIR=$(bindir) \
+ LIBDIR=$(libdir)/caml-light \
+ MANDIR=$(mandir)/man1 \
+ 2>&1 | tee log.world-install
+ grep '#- : int = 10946' log.world-install
+ touch $@
+
+install: stamp-world-install
+ $(MAKE) -C src install \
+ VBINDIR=$(bindir) \
+ LIBDIR=$(DESTDIR)$(libdir)/caml-light \
+ MANDIR=$(DESTDIR)$(mandir)/man1 \
+ INSTROOT=$(DESTDIR)
+ mkdir -p $(DESTDIR)$(datadir)/emacs/site-lisp
+ $(MAKE) -C contrib install \
+ BINDIR=$(DESTDIR)$(bindir) \
+ LIBDIR=$(DESTDIR)$(libdir)/caml-light \
+ MANDIR=$(DESTDIR)$(mandir)/man1 \
+ EMACSLISPDIR=$(DESTDIR)$(datadir)/emacs/site-lisp \
+ INSTROOT=$(DESTDIR)
+
+

0 comments on commit b96ee97

Please sign in to comment.