PR#6358: obey DESTDIR in install targets

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14536 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
master
Gabriel Scherer 2014-04-07 07:06:17 +00:00
parent 2ba45f9a22
commit de4f4cf8b3
24 changed files with 208 additions and 155 deletions

View File

@ -123,6 +123,8 @@ Features wishes:
- PR#6246: allow wilcard _ as for-loop index
- PR#6270: remove need for -I directives to ocamldebug in common case
(patch by Josh Watzman, review by Xavier Clerc and Alain Frisch)
- PR#6358: obey DESTDIR in install targets
(Gabriel Scherer)
- ocamllex: user-definable refill action
(patch by Frédéric Bour, review by Gabriel Scherer and Luc Maranget)
- shorten syntax for functor signatures: "functor (M1:S1) (M2:S2) .. -> .."

View File

@ -294,29 +294,39 @@ base.opt:
COMPLIBDIR=$(LIBDIR)/compiler-libs
INSTALL_BINDIR=$(DESTDIR)$(BINDIR)
INSTALL_LIBDIR=$(DESTDIR)$(LIBDIR)
INSTALL_COMPLIBDIR=$(DESTDIR)$(COMPLIBDIR)
INSTALL_STUBLIBDIR=$(DESTDIR)$(STUBLIBDIR)
INSTALL_MANDIR=$(DESTDIR)$(MANDIR)
install:
if test -d $(BINDIR); then : ; else $(MKDIR) $(BINDIR); fi
if test -d $(LIBDIR); then : ; else $(MKDIR) $(LIBDIR); fi
if test -d $(STUBLIBDIR); then : ; else $(MKDIR) $(STUBLIBDIR); fi
if test -d $(COMPLIBDIR); then : ; else $(MKDIR) $(COMPLIBDIR); fi
if test -d $(MANDIR)/man$(MANEXT); then : ; \
else $(MKDIR) $(MANDIR)/man$(MANEXT); fi
cp VERSION $(LIBDIR)/
cd $(LIBDIR); rm -f dllbigarray.so dllnums.so dllthreads.so \
if test -d $(INSTALL_BINDIR); then : ; \
else $(MKDIR) $(INSTALL_BINDIR); fi
if test -d $(INSTALL_LIBDIR); then : ; \
else $(MKDIR) $(INSTALL_LIBDIR); fi
if test -d $(INSTALL_STUBLIBDIR); then : ; \
else $(MKDIR) $(INSTALL_STUBLIBDIR); fi
if test -d $(INSTALL_COMPLIBDIR); then : ; \
else $(MKDIR) $(INSTALL_COMPLIBDIR); fi
if test -d $(INSTALL_MANDIR)/man$(MANEXT); then : ; \
else $(MKDIR) $(INSTALL_MANDIR)/man$(MANEXT); fi
cp VERSION $(INSTALL_LIBDIR)/
cd $(INSTALL_LIBDIR); rm -f dllbigarray.so dllnums.so dllthreads.so \
dllunix.so dllgraphics.so dllstr.so
cd byterun; $(MAKE) install
cp ocamlc $(BINDIR)/ocamlc$(EXE)
cp ocaml $(BINDIR)/ocaml$(EXE)
cp ocamlc $(INSTALL_BINDIR)/ocamlc$(EXE)
cp ocaml $(INSTALL_BINDIR)/ocaml$(EXE)
cd stdlib; $(MAKE) install
cp lex/ocamllex $(BINDIR)/ocamllex$(EXE)
cp yacc/ocamlyacc$(EXE) $(BINDIR)/ocamlyacc$(EXE)
cp lex/ocamllex $(INSTALL_BINDIR)/ocamllex$(EXE)
cp yacc/ocamlyacc$(EXE) $(INSTALL_BINDIR)/ocamlyacc$(EXE)
cp utils/*.cmi parsing/*.cmi typing/*.cmi bytecomp/*.cmi driver/*.cmi \
toplevel/*.cmi $(COMPLIBDIR)
toplevel/*.cmi $(INSTALL_COMPLIBDIR)
cp compilerlibs/ocamlcommon.cma compilerlibs/ocamlbytecomp.cma \
compilerlibs/ocamltoplevel.cma $(BYTESTART) $(TOPLEVELSTART) \
$(COMPLIBDIR)
cp expunge $(LIBDIR)/expunge$(EXE)
cp toplevel/topdirs.cmi $(LIBDIR)
$(INSTALL_COMPLIBDIR)
cp expunge $(INSTALL_LIBDIR)/expunge$(EXE)
cp toplevel/topdirs.cmi $(INSTALL_LIBDIR)
cd tools; $(MAKE) install
-cd man; $(MAKE) install
for i in $(OTHERLIBRARIES); do \
@ -327,16 +337,16 @@ install:
else :; fi
if test -n "$(WITH_OCAMLBUILD)"; then (cd ocamlbuild; $(MAKE) install); \
else :; fi
cp config/Makefile $(LIBDIR)/Makefile.config
cp config/Makefile $(INSTALL_LIBDIR)/Makefile.config
if test -f ocamlopt; then $(MAKE) installopt; else :; fi
# Installation of the native-code compiler
installopt:
cd asmrun; $(MAKE) install
cp ocamlopt $(BINDIR)/ocamlopt$(EXE)
cp ocamlopt $(INSTALL_BINDIR)/ocamlopt$(EXE)
cd stdlib; $(MAKE) installopt
cp asmcomp/*.cmi $(COMPLIBDIR)
cp compilerlibs/ocamloptcomp.cma $(OPTSTART) $(COMPLIBDIR)
cp asmcomp/*.cmi $(INSTALL_COMPLIBDIR)
cp compilerlibs/ocamloptcomp.cma $(OPTSTART) $(INSTALL_COMPLIBDIR)
if test -n "$(WITH_OCAMLDOC)"; then (cd ocamldoc; $(MAKE) installopt); \
else :; fi
if test -n "$(WITH_OCAMLBUILD)"; then (cd ocamlbuild; $(MAKE) installopt); \
@ -347,16 +357,16 @@ installopt:
cd tools; $(MAKE) installopt
installoptopt:
cp ocamlc.opt $(BINDIR)/ocamlc.opt$(EXE)
cp ocamlopt.opt $(BINDIR)/ocamlopt.opt$(EXE)
cp lex/ocamllex.opt $(BINDIR)/ocamllex.opt$(EXE)
cp ocamlc.opt $(INSTALL_BINDIR)/ocamlc.opt$(EXE)
cp ocamlopt.opt $(INSTALL_BINDIR)/ocamlopt.opt$(EXE)
cp lex/ocamllex.opt $(INSTALL_BINDIR)/ocamllex.opt$(EXE)
cp compilerlibs/ocamlcommon.cmxa compilerlibs/ocamlcommon.a \
compilerlibs/ocamlbytecomp.cmxa compilerlibs/ocamlbytecomp.a \
compilerlibs/ocamloptcomp.cmxa compilerlibs/ocamloptcomp.a \
$(BYTESTART:.cmo=.cmx) $(BYTESTART:.cmo=.o) \
$(OPTSTART:.cmo=.cmx) $(OPTSTART:.cmo=.o) \
$(COMPLIBDIR)
cd $(COMPLIBDIR) && $(RANLIB) ocamlcommon.a ocamlbytecomp.a \
$(INSTALL_COMPLIBDIR)
cd $(INSTALL_COMPLIBDIR) && $(RANLIB) ocamlcommon.a ocamlbytecomp.a \
ocamloptcomp.a
clean:: partialclean

View File

@ -221,27 +221,33 @@ world.opt: coldstart opt.opt
COMPLIBDIR=$(LIBDIR)/compiler-libs
INSTALL_BINDIR=$(DESTDIR)$(BINDIR)
INSTALL_LIBDIR=$(DESTDIR)$(LIBDIR)
INSTALL_COMPLIBDIR=$(DESTDIR)$(COMPLIBDIR)
INSTALL_STUBLIBDIR=$(DESTDIR)$(STUBLIBDIR)
INSTALL_MANDIR=$(DESTDIR)$(MANDIR)
install: installbyt installopt
installbyt:
mkdir -p $(BINDIR)
mkdir -p $(LIBDIR)
mkdir -p $(STUBLIBDIR)
mkdir -p $(COMPLIBDIR)
cp VERSION $(LIBDIR)/
mkdir -p $(INSTALL_BINDIR)
mkdir -p $(INSTALL_LIBDIR)
mkdir -p $(INSTALL_STUBLIBDIR)
mkdir -p $(INSTALL_COMPLIBDIR)
cp VERSION $(INSTALL_LIBDIR)/
cd byterun ; $(MAKEREC) install
cp ocamlc $(BINDIR)/ocamlc.exe
cp ocaml $(BINDIR)/ocaml.exe
cp ocamlc $(INSTALL_BINDIR)/ocamlc.exe
cp ocaml $(INSTALL_BINDIR)/ocaml.exe
cd stdlib ; $(MAKEREC) install
cp lex/ocamllex $(BINDIR)/ocamllex.exe
cp yacc/ocamlyacc.exe $(BINDIR)/ocamlyacc.exe
cp lex/ocamllex $(INSTALL_BINDIR)/ocamllex.exe
cp yacc/ocamlyacc.exe $(INSTALL_BINDIR)/ocamlyacc.exe
cp utils/*.cmi parsing/*.cmi typing/*.cmi bytecomp/*.cmi driver/*.cmi \
toplevel/*.cmi $(COMPLIBDIR)
toplevel/*.cmi $(INSTALL_COMPLIBDIR)
cp compilerlibs/ocamlcommon.cma compilerlibs/ocamlbytecomp.cma \
compilerlibs/ocamltoplevel.cma $(BYTESTART) $(TOPLEVELSTART) \
$(COMPLIBDIR)
cp expunge $(LIBDIR)/expunge.exe
cp toplevel/topdirs.cmi $(LIBDIR)
$(INSTALL_COMPLIBDIR)
cp expunge $(INSTALL_LIBDIR)/expunge.exe
cp toplevel/topdirs.cmi $(INSTALL_LIBDIR)
cd tools ; $(MAKEREC) install
for i in $(OTHERLIBRARIES); do $(MAKEREC) -C otherlibs/$$i install; done
if test -n "$(WITH_OCAMLDOC)"; then (cd ocamldoc; $(MAKEREC) install); \
@ -250,19 +256,19 @@ installbyt:
else :; fi
if test -n "$(WITH_OCAMLBUILD)"; then (cd ocamlbuild; $(MAKE) install); \
else :; fi
cp config/Makefile $(LIBDIR)/Makefile.config
cp README $(DISTRIB)/Readme.general.txt
cp README.win32 $(DISTRIB)/Readme.windows.txt
cp LICENSE $(DISTRIB)/License.txt
cp Changes $(DISTRIB)/Changes.txt
cp config/Makefile $(INSTALL_LIBDIR)/Makefile.config
cp README $(INSTALL_DISTRIB)/Readme.general.txt
cp README.win32 $(INSTALL_DISTRIB)/Readme.windows.txt
cp LICENSE $(INSTALL_DISTRIB)/License.txt
cp Changes $(INSTALL_DISTRIB)/Changes.txt
# Installation of the native-code compiler
installopt:
cd asmrun ; $(MAKEREC) install
cp ocamlopt $(BINDIR)/ocamlopt.exe
cp ocamlopt $(INSTALL_BINDIR)/ocamlopt.exe
cd stdlib ; $(MAKEREC) installopt
cp asmcomp/*.cmi $(COMPLIBDIR)
cp compilerlibs/ocamloptcomp.cma $(OPTSTART) $(COMPLIBDIR)
cp asmcomp/*.cmi $(INSTALL_COMPLIBDIR)
cp compilerlibs/ocamloptcomp.cma $(OPTSTART) $(INSTALL_COMPLIBDIR)
if test -n "$(WITH_OCAMLDOC)"; then (cd ocamldoc; $(MAKEREC) installopt); fi
if test -n "$(WITH_OCAMLBUILD)"; then (cd ocamlbuild; $(MAKE) installopt); \
else :; fi
@ -271,15 +277,15 @@ installopt:
cd tools; $(MAKE) installopt
installoptopt:
cp ocamlc.opt $(BINDIR)/ocamlc.opt$(EXE)
cp ocamlopt.opt $(BINDIR)/ocamlopt.opt$(EXE)
cp lex/ocamllex.opt $(BINDIR)/ocamllex.opt$(EXE)
cp ocamlc.opt $(INSTALL_BINDIR)/ocamlc.opt$(EXE)
cp ocamlopt.opt $(INSTALL_BINDIR)/ocamlopt.opt$(EXE)
cp lex/ocamllex.opt $(INSTALL_BINDIR)/ocamllex.opt$(EXE)
cp compilerlibs/ocamlcommon.cmxa compilerlibs/ocamlcommon.$(A) \
compilerlibs/ocamlbytecomp.cmxa compilerlibs/ocamlbytecomp.$(A) \
compilerlibs/ocamloptcomp.cmxa compilerlibs/ocamloptcomp.$(A) \
$(BYTESTART:.cmo=.cmx) $(BYTESTART:.cmo=.$(O)) \
$(OPTSTART:.cmo=.cmx) $(OPTSTART:.cmo=.$(O)) \
$(COMPLIBDIR)
$(INSTALL_COMPLIBDIR)
clean:: partialclean

View File

@ -60,26 +60,28 @@ libasmrunp.a: $(POBJS)
ar rc libasmrunp.a $(POBJS)
$(RANLIB) libasmrunp.a
INSTALL_LIBDIR=$(DESTDIR)$(LIBDIR)
install: install-default install-$(RUNTIMED) install-$(PROFILING)
install-default:
cp libasmrun.a $(LIBDIR)/libasmrun.a
cd $(LIBDIR); $(RANLIB) libasmrun.a
cp libasmrun.a $(INSTALL_LIBDIR)/libasmrun.a
cd $(INSTALL_LIBDIR); $(RANLIB) libasmrun.a
install-noruntimed:
.PHONY: install-noruntimed
install-runtimed:
cp libasmrund.a $(LIBDIR)/libasmrund.a
cd $(LIBDIR); $(RANLIB) libasmrund.a
cp libasmrund.a $(INSTALL_LIBDIR)/libasmrund.a
cd $(INSTALL_LIBDIR); $(RANLIB) libasmrund.a
.PHONY: install-runtimed
install-noprof:
rm -f $(LIBDIR)/libasmrunp.a; ln -s libasmrun.a $(LIBDIR)/libasmrunp.a
rm -f $(INSTALL_LIBDIR)/libasmrunp.a; ln -s libasmrun.a $(INSTALL_LIBDIR)/libasmrunp.a
install-prof:
cp libasmrunp.a $(LIBDIR)/libasmrunp.a
cd $(LIBDIR); $(RANLIB) libasmrunp.a
cp libasmrunp.a $(INSTALL_LIBDIR)/libasmrunp.a
cd $(INSTALL_LIBDIR); $(RANLIB) libasmrunp.a
power-bsd_elf.S: power-elf.S
cp power-elf.S power-bsd_elf.S

View File

@ -56,8 +56,10 @@ i386.o: i386.S
amd64.o: amd64.S
$(ASPP) -DSYS_$(SYSTEM) amd64.S
INSTALL_LIBDIR=$(DESTDIR)$(LIBDIR)
install:
cp libasmrun.$(A) $(LIBDIR)
cp libasmrun.$(A) $(INSTALL_LIBDIR)
$(LINKEDFILES): %.c: ../byterun/%.c
cp ../byterun/$*.c $*.c

View File

@ -46,7 +46,7 @@ libcamlrun_shared.so: $(PICOBJS)
install::
if test -f libcamlrun_shared.so; then \
cp libcamlrun_shared.so $(LIBDIR)/libcamlrun_shared.so; fi
cp libcamlrun_shared.so $(INSTALL_LIBDIR)/libcamlrun_shared.so; fi
clean::
rm -f libcamlrun_shared.so

View File

@ -48,15 +48,21 @@ ld.conf: ../config/Makefile
echo "$(STUBLIBDIR)" > ld.conf
echo "$(LIBDIR)" >> ld.conf
# Installation
INSTALL_BINDIR=$(DESTDIR)$(BINDIR)
INSTALL_LIBDIR=$(DESTDIR)$(LIBDIR)
install::
cp ocamlrun$(EXE) $(BINDIR)/ocamlrun$(EXE)
cp libcamlrun.$(A) $(LIBDIR)/libcamlrun.$(A)
cd $(LIBDIR); $(RANLIB) libcamlrun.$(A)
if test -d $(LIBDIR)/caml; then : ; else mkdir $(LIBDIR)/caml; fi
cp ocamlrun$(EXE) $(INSTALL_BINDIR)/ocamlrun$(EXE)
cp libcamlrun.$(A) $(INSTALL_LIBDIR)/libcamlrun.$(A)
cd $(INSTALL_LIBDIR); $(RANLIB) libcamlrun.$(A)
if test -d $(INSTALL_LIBDIR)/caml; then : ; else mkdir $(INSTALL_LIBDIR)/caml; fi
for i in $(PUBLIC_INCLUDES); do \
sed -f ../tools/cleanup-header $$i > $(LIBDIR)/caml/$$i; \
sed -f ../tools/cleanup-header $$i > $(INSTALL_LIBDIR)/caml/$$i; \
done
cp ld.conf $(LIBDIR)/ld.conf
cp ld.conf $(INSTALL_LIBDIR)/ld.conf
.PHONY: install
install:: install-$(RUNTIMED)
@ -65,8 +71,8 @@ install-noruntimed:
.PHONY: install-noruntimed
install-runtimed:
cp ocamlrund$(EXE) $(BINDIR)/ocamlrund$(EXE)
cp libcamlrund.$(A) $(LIBDIR)/libcamlrund.$(A)
cp ocamlrund$(EXE) $(INSTALL_BINDIR)/ocamlrund$(EXE)
cp libcamlrund.$(A) $(INSTALL_LIBDIR)/libcamlrund.$(A)
.PHONY: install-runtimed
# If primitives contain duplicated lines (e.g. because the code is defined

View File

@ -22,6 +22,8 @@ CAMLLEX=../boot/ocamlrun ../boot/ocamllex
CAMLDEP=../boot/ocamlrun ../tools/ocamldep
DEPFLAGS=$(INCLUDES)
INSTALL_BINDIR=$(DESTDIR)$(BINDIR)
INCLUDES=\
-I ../utils -I ../parsing -I ../typing -I ../bytecomp -I ../toplevel \
-I $(UNIXDIR)
@ -84,7 +86,7 @@ ocamldebug$(EXE): $(OBJS) $(OTHEROBJS)
$(CAMLC) $(LINKFLAGS) -o ocamldebug$(EXE) -linkall $(OTHEROBJS) $(OBJS)
install:
cp ocamldebug$(EXE) $(BINDIR)/ocamldebug$(EXE)
cp ocamldebug$(EXE) $(INSTALL_BINDIR)/ocamldebug$(EXE)
clean::
rm -f ocamldebug$(EXE)

View File

@ -12,10 +12,10 @@
include ../config/Makefile
DIR=$(MANDIR)/man$(MANEXT)
INSTALL_DIR=$(DESTDIR)$(MANDIR)/man$(MANEXT)
install:
for i in *.m; do cp $$i $(DIR)/`basename $$i .m`.$(MANEXT); done
echo '.so man$(MANEXT)/ocamlc.$(MANEXT)' > $(DIR)/ocamlc.opt.$(MANEXT)
echo '.so man$(MANEXT)/ocamlopt.$(MANEXT)' > $(DIR)/ocamlopt.opt.$(MANEXT)
echo '.so man$(MANEXT)/ocamlcp.$(MANEXT)' > $(DIR)/ocamloptp.$(MANEXT)
for i in *.m; do cp $$i $(INSTALL_DIR)/`basename $$i .m`.$(MANEXT); done
echo '.so man$(MANEXT)/ocamlc.$(MANEXT)' > $(INSTALL_DIR)/ocamlc.opt.$(MANEXT)
echo '.so man$(MANEXT)/ocamlopt.$(MANEXT)' > $(INSTALL_DIR)/ocamlopt.opt.$(MANEXT)
echo '.so man$(MANEXT)/ocamlcp.$(MANEXT)' > $(INSTALL_DIR)/ocamloptp.$(MANEXT)

View File

@ -86,6 +86,9 @@ INSTALL_LIB_OPT=\
ocamlbuild_pack.cmx \
$(EXTRA_CMO:.cmo=.cmx) $(EXTRA_CMO:.cmo=.$(O))
INSTALL_LIBDIR=$(DESTDIR)$(LIBDIR)/ocamlbuild
INSTALL_BINDIR=$(DESTDIR)$(BINDIR)
all: ocamlbuild.byte ocamlbuildlib.cma
# ocamlbuildlight.byte ocamlbuildlightlib.cma
allopt: ocamlbuild.native ocamlbuildlib.cmxa
@ -158,19 +161,19 @@ beforedepend:: glob_lexer.ml
# Installation
install:
$(CP) ocamlbuild.byte $(BINDIR)/ocamlbuild$(EXE)
$(CP) ocamlbuild.byte $(BINDIR)/ocamlbuild.byte$(EXE)
mkdir -p $(LIBDIR)/ocamlbuild
$(CP) $(INSTALL_LIB) $(LIBDIR)/ocamlbuild/
$(CP) ocamlbuild.byte $(INSTALL_BINDIR)/ocamlbuild$(EXE)
$(CP) ocamlbuild.byte $(INSTALL_BINDIR)/ocamlbuild.byte$(EXE)
mkdir -p $(INSTALL_LIBDIR)/ocamlbuild
$(CP) $(INSTALL_LIB) $(INSTALL_LIBDIR)/ocamlbuild/
installopt:
if test -f ocamlbuild.native; then $(MAKE) installopt_really; fi
installopt_really:
$(CP) ocamlbuild.native $(BINDIR)/ocamlbuild$(EXE)
$(CP) ocamlbuild.native $(BINDIR)/ocamlbuild.native$(EXE)
mkdir -p $(LIBDIR)/ocamlbuild
$(CP) $(INSTALL_LIB_OPT) $(LIBDIR)/ocamlbuild/
$(CP) ocamlbuild.native $(INSTALL_BINDIR)/ocamlbuild$(EXE)
$(CP) ocamlbuild.native $(INSTALL_BINDIR)/ocamlbuild.native$(EXE)
mkdir -p $(INSTALL_LIBDIR)/ocamlbuild
$(CP) $(INSTALL_LIB_OPT) $(INSTALL_LIBDIR)/ocamlbuild/
# The generic rules

View File

@ -37,10 +37,9 @@ OCAMLBUILD_LIBCMA=ocamlbuildlib.cma
OCAMLBUILD_LIBCMI=ocamlbuildlib.cmi
OCAMLBUILD_LIBCMXA=ocamlbuild.cmxa
OCAMLBUILD_LIBA=ocamlbuild.$(A)
INSTALL_LIBDIR=$(OCAMLLIB)/ocamlbuild
INSTALL_LIBDIR=$(DESTDIR)$(OCAMLLIB)/ocamlbuild
INSTALL_CUSTOMDIR=$(INSTALL_LIBDIR)/custom
INSTALL_BINDIR=$(OCAMLBIN)
INSTALL_MANODIR=$(MANDIR)/man3
INSTALL_BINDIR=$(DESTDIR)$(OCAMLBIN)
INSTALL_MLIS=
INSTALL_CMIS=$(INSTALL_MLIS:.mli=.cmi)

View File

@ -37,10 +37,11 @@ OCAMLDOC_LIBCMA=odoc_info.cma
OCAMLDOC_LIBCMI=odoc_info.cmi
OCAMLDOC_LIBCMXA=odoc_info.cmxa
OCAMLDOC_LIBA=odoc_info.$(A)
INSTALL_LIBDIR=$(OCAMLLIB)/ocamldoc
INSTALL_LIBDIR=$(DESTDIR)$(OCAMLLIB)/ocamldoc
INSTALL_CUSTOMDIR=$(INSTALL_LIBDIR)/custom
INSTALL_BINDIR=$(OCAMLBIN)
INSTALL_MANODIR=$(MANDIR)/man3
INSTALL_BINDIR=$(DESTDIR)$(OCAMLBIN)
#MANO: man ocamldoc
INSTALL_MANODIR=$(DESTDIR)$(MANDIR)/man3
INSTALL_MLIS=odoc_info.mli
INSTALL_CMIS=$(INSTALL_MLIS:.mli=.cmi)

View File

@ -37,9 +37,9 @@ OCAMLDOC_LIBCMA=odoc_info.cma
OCAMLDOC_LIBCMI=odoc_info.cmi
OCAMLDOC_LIBCMXA=odoc_info.cmxa
OCAMLDOC_LIBA=odoc_info.$(A)
INSTALL_LIBDIR=$(OCAMLLIB)/ocamldoc
INSTALL_LIBDIR=$(DESTDIR)$(OCAMLLIB)/ocamldoc
INSTALL_CUSTOMDIR=$(INSTALL_LIBDIR)/custom
INSTALL_BINDIR=$(OCAMLBIN)
INSTALL_BINDIR=$(DESTDIR)$(OCAMLBIN)
INSTALL_MLIS=odoc_info.mli
INSTALL_CMIS=$(INSTALL_MLIS:.mli=.cmi)

View File

@ -56,18 +56,21 @@ $(LIBNAME).cmxs: $(LIBNAME).cmxa lib$(CLIBNAME).$(A)
lib$(CLIBNAME).$(A): $(COBJS)
$(MKLIB) -oc $(CLIBNAME) $(COBJS) $(LDOPTS)
INSTALL_LIBDIR=$(DESTDIR)$(LIBDIR)
INSTALL_STUBLIBDIR=$(DESTDIR)$(STUBLIBDIR)
install::
if test -f dll$(CLIBNAME)$(EXT_DLL); then \
cp dll$(CLIBNAME)$(EXT_DLL) $(STUBLIBDIR)/; fi
cp lib$(CLIBNAME).$(A) $(LIBDIR)/
cd $(LIBDIR); $(RANLIB) lib$(CLIBNAME).$(A)
cp $(LIBNAME).cma $(CMIFILES) $(CMIFILES:.cmi=.mli) $(LIBDIR)/
if test -n "$(HEADERS)"; then cp $(HEADERS) $(LIBDIR)/caml/; fi
cp dll$(CLIBNAME)$(EXT_DLL) $(INSTALL_STUBLIBDIR)/; fi
cp lib$(CLIBNAME).$(A) $(INSTALL_LIBDIR)/
cd $(INSTALL_LIBDIR); $(RANLIB) lib$(CLIBNAME).$(A)
cp $(LIBNAME).cma $(CMIFILES) $(CMIFILES:.cmi=.mli) $(INSTALL_LIBDIR)/
if test -n "$(HEADERS)"; then cp $(HEADERS) $(INSTALL_LIBDIR)/caml/; fi
installopt:
cp $(CAMLOBJS_NAT) $(LIBNAME).cmxa $(LIBNAME).$(A) $(LIBDIR)/
cd $(LIBDIR); $(RANLIB) $(LIBNAME).a
if test -f $(LIBNAME).cmxs; then cp $(LIBNAME).cmxs $(LIBDIR)/; fi
cp $(CAMLOBJS_NAT) $(LIBNAME).cmxa $(LIBNAME).$(A) $(INSTALL_LIBDIR)/
cd $(INSTALL_LIBDIR); $(RANLIB) $(LIBNAME).a
if test -f $(LIBNAME).cmxs; then cp $(LIBNAME).cmxs $(INSTALL_LIBDIR)/; fi
partialclean:
rm -f *.cm*

View File

@ -70,14 +70,16 @@ dynlink.cmx: dynlink.cmi natdynlink.ml
extract_crc: dynlink.cma extract_crc.cmo
$(OCAMLC) $(COMPFLAGS) -o extract_crc dynlink.cma extract_crc.cmo
INSTALL_LIBDIR=$(DESTDIR)$(LIBDIR)
install:
cp dynlink.cmi dynlink.cma dynlink.mli $(LIBDIR)
cp extract_crc $(LIBDIR)/extract_crc$(EXE)
cp dynlink.cmi dynlink.cma dynlink.mli $(INSTALL_LIBDIR)
cp extract_crc $(INSTALL_LIBDIR)/extract_crc$(EXE)
installopt:
if $(NATDYNLINK); then \
cp $(NATOBJS) dynlink.cmxa dynlink.$(A) $(LIBDIR) && \
cd $(LIBDIR) && $(RANLIB) dynlink.$(A); \
cp $(NATOBJS) dynlink.cmxa dynlink.$(A) $(INSTALL_LIBDIR) && \
cd $(INSTALL_LIBDIR) && $(RANLIB) dynlink.$(A); \
fi
partialclean:

View File

@ -70,21 +70,24 @@ partialclean:
clean: partialclean
rm -f *.o *.a *.so
INSTALL_LIBDIR=$(DESTDIR)$(LIBDIR)
INSTALL_STUBLIBDIR=$(DESTDIR)$(STUBLIBDIR)
install:
if test -f dllthreads.so; then cp dllthreads.so $(STUBLIBDIR)/dllthreads.so; fi
cp libthreads.a $(LIBDIR)/libthreads.a
cd $(LIBDIR); $(RANLIB) libthreads.a
if test -d $(LIBDIR)/threads; then :; else mkdir $(LIBDIR)/threads; fi
cp $(THREAD_OBJS:.cmo=.cmi) threads.cma $(LIBDIR)/threads
rm -f $(LIBDIR)/threads/stdlib.cma
cp thread.mli mutex.mli condition.mli event.mli threadUnix.mli $(LIBDIR)
cp threads.h $(LIBDIR)/caml/threads.h
if test -f dllthreads.so; then cp dllthreads.so $(INSTALL_STUBLIBDIR)/dllthreads.so; fi
cp libthreads.a $(INSTALL_LIBDIR)/libthreads.a
cd $(INSTALL_LIBDIR); $(RANLIB) libthreads.a
if test -d $(INSTALL_LIBDIR)/threads; then :; else mkdir $(INSTALL_LIBDIR)/threads; fi
cp $(THREAD_OBJS:.cmo=.cmi) threads.cma $(INSTALL_LIBDIR)/threads
rm -f $(INSTALL_LIBDIR)/threads/stdlib.cma
cp thread.mli mutex.mli condition.mli event.mli threadUnix.mli $(INSTALL_LIBDIR)
cp threads.h $(INSTALL_LIBDIR)/caml/threads.h
installopt:
cp libthreadsnat.a $(LIBDIR)/libthreadsnat.a
cd $(LIBDIR); $(RANLIB) libthreadsnat.a
cp $(THREAD_OBJS:.cmo=.cmx) threads.cmxa threads.a $(LIBDIR)/threads
cd $(LIBDIR)/threads; $(RANLIB) threads.a
cp libthreadsnat.a $(INSTALL_LIBDIR)/libthreadsnat.a
cd $(INSTALL_LIBDIR); $(RANLIB) libthreadsnat.a
cp $(THREAD_OBJS:.cmo=.cmx) threads.cmxa threads.a $(INSTALL_LIBDIR)/threads
cd $(INSTALL_LIBDIR)/threads; $(RANLIB) threads.a
.SUFFIXES: .ml .mli .cmo .cmi .cmx

View File

@ -70,18 +70,21 @@ partialclean:
clean: partialclean
rm -f *.dll *.$(A) *.$(O)
INSTALL_LIBDIR=$(DESTDIR)$(LIBDIR)
INSTALL_STUBLIBDIR=$(DESTDIR)$(STUBLIBDIR)
install:
cp dllthreads.dll $(STUBLIBDIR)/dllthreads.dll
cp libthreads.$(A) $(LIBDIR)/libthreads.$(A)
mkdir -p $(LIBDIR)/threads
cp $(CMIFILES) threads.cma $(LIBDIR)/threads
rm -f $(LIBDIR)/threads/stdlib.cma
cp threads.h $(LIBDIR)/caml/threads.h
cp dllthreads.dll $(INSTALL_STUBLIBDIR)/dllthreads.dll
cp libthreads.$(A) $(INSTALL_LIBDIR)/libthreads.$(A)
mkdir -p $(INSTALL_LIBDIR)/threads
cp $(CMIFILES) threads.cma $(INSTALL_LIBDIR)/threads
rm -f $(INSTALL_LIBDIR)/threads/stdlib.cma
cp threads.h $(INSTALL_LIBDIR)/caml/threads.h
installopt:
cp libthreadsnat.$(A) $(LIBDIR)/libthreadsnat.$(A)
cp $(THREAD_OBJS:.cmo=.cmx) threads.cmxa threads.$(A) $(LIBDIR)/threads
cp threads.cmxs $(LIBDIR)/threads
cp libthreadsnat.$(A) $(INSTALL_LIBDIR)/libthreadsnat.$(A)
cp $(THREAD_OBJS:.cmo=.cmx) threads.cmxa threads.$(A) $(INSTALL_LIBDIR)/threads
cp threads.cmxs $(INSTALL_LIBDIR)/threads
.SUFFIXES: .ml .mli .cmo .cmi .cmx

View File

@ -96,15 +96,18 @@ clean: partialclean
rm -f libvmthreads.a dllvmthreads.so *.o
rm -f pervasives.mli marshal.mli unix.mli
INSTALL_LIBDIR=$(DESTDIR)$(LIBDIR)
INSTALL_STUBLIBDIR=$(DESTDIR)$(STUBLIBDIR)
install:
if test -f dllvmthreads.so; then cp dllvmthreads.so $(STUBLIBDIR)/.; fi
mkdir -p $(LIBDIR)/vmthreads
cp libvmthreads.a $(LIBDIR)/vmthreads/libvmthreads.a
cd $(LIBDIR)/vmthreads; $(RANLIB) libvmthreads.a
if test -f dllvmthreads.so; then cp dllvmthreads.so $(INSTALL_STUBLIBDIR)/.; fi
mkdir -p $(INSTALL_LIBDIR)/vmthreads
cp libvmthreads.a $(INSTALL_LIBDIR)/vmthreads/libvmthreads.a
cd $(INSTALL_LIBDIR)/vmthreads; $(RANLIB) libvmthreads.a
cp thread.cmi mutex.cmi condition.cmi event.cmi threadUnix.cmi \
threads.cma stdlib.cma unix.cma $(LIBDIR)/vmthreads
threads.cma stdlib.cma unix.cma $(INSTALL_LIBDIR)/vmthreads
cp thread.mli mutex.mli condition.mli event.mli threadUnix.mli \
$(LIBDIR)/vmthreads
$(INSTALL_LIBDIR)/vmthreads
installopt:

View File

@ -25,19 +25,19 @@ allopt-prof: stdlib.p.cmxa std_exit.p.cmx
installopt: installopt-default installopt-$(PROFILING)
installopt-default:
cp stdlib.cmxa stdlib.a std_exit.o *.cmx $(LIBDIR)
cd $(LIBDIR); $(RANLIB) stdlib.a
cp stdlib.cmxa stdlib.a std_exit.o *.cmx $(INSTALL_LIBDIR)
cd $(INSTALL_LIBDIR); $(RANLIB) stdlib.a
installopt-noprof:
rm -f $(LIBDIR)/stdlib.p.cmxa; ln -s stdlib.cmxa $(LIBDIR)/stdlib.p.cmxa
rm -f $(LIBDIR)/stdlib.p.a; ln -s stdlib.a $(LIBDIR)/stdlib.p.a
rm -f $(LIBDIR)/std_exit.p.cmx; \
ln -s std_exit.cmx $(LIBDIR)/std_exit.p.cmx
rm -f $(LIBDIR)/std_exit.p.o; ln -s std_exit.o $(LIBDIR)/std_exit.p.o
rm -f $(INSTALL_LIBDIR)/stdlib.p.cmxa; ln -s stdlib.cmxa $(INSTALL_LIBDIR)/stdlib.p.cmxa
rm -f $(INSTALL_LIBDIR)/stdlib.p.a; ln -s stdlib.a $(INSTALL_LIBDIR)/stdlib.p.a
rm -f $(INSTALL_LIBDIR)/std_exit.p.cmx; \
ln -s std_exit.cmx $(INSTALL_LIBDIR)/std_exit.p.cmx
rm -f $(INSTALL_LIBDIR)/std_exit.p.o; ln -s std_exit.o $(INSTALL_LIBDIR)/std_exit.p.o
installopt-prof:
cp stdlib.p.cmxa stdlib.p.a std_exit.p.cmx std_exit.p.o $(LIBDIR)
cd $(LIBDIR); $(RANLIB) stdlib.p.a
cp stdlib.p.cmxa stdlib.p.a std_exit.p.cmx std_exit.p.o $(INSTALL_LIBDIR)
cd $(INSTALL_LIBDIR); $(RANLIB) stdlib.p.a
stdlib.p.cmxa: $(OBJS:.cmo=.p.cmx)
$(CAMLOPT) -a -o stdlib.p.cmxa $(OBJS:.cmo=.p.cmx)

View File

@ -16,7 +16,7 @@ include Makefile.shared
allopt: stdlib.cmxa std_exit.cmx
installopt:
cp stdlib.cmxa stdlib.$(A) std_exit.$(O) *.cmx $(LIBDIR)
cp stdlib.cmxa stdlib.$(A) std_exit.$(O) *.cmx $(INSTALL_LIBDIR)
camlheader camlheader_ur: headernt.c ../config/Makefile
$(BYTECC) $(BYTECCCOMPOPTS) -c -I../byterun \

View File

@ -38,15 +38,17 @@ OTHERS=array.cmo list.cmo char.cmo string.cmo sys.cmo \
all: stdlib.cma std_exit.cmo camlheader camlheader_ur
INSTALL_LIBDIR=$(DESTDIR)$(LIBDIR)
install: install-$(RUNTIMED)
cp stdlib.cma std_exit.cmo *.cmi *.mli *.ml camlheader camlheader_ur \
$(LIBDIR)
$(INSTALL_LIBDIR)
install-noruntimed:
.PHONY: install-noruntimed
install-runtimed: camlheaderd
cp camlheaderd $(LIBDIR)
cp camlheaderd $(INSTALL_LIBDIR)
.PHONY: install-runtimed
stdlib.cma: $(OBJS)

View File

@ -19,7 +19,7 @@ ocamlmktop: ocamlmktop.tpl ../config/Makefile
chmod +x ocamlmktop
install::
cp ocamlmktop $(BINDIR)
cp ocamlmktop $(INSTALL_BINDIR)
clean::
rm -f ocamlmktop

View File

@ -21,7 +21,7 @@ ocamlmktop: $(OCAMLMKTOP)
$(CAMLC) $(LINKFLAGS) -o ocamlmktop $(OCAMLMKTOP_IMPORTS) $(OCAMLMKTOP)
install::
cp ocamlmktop $(BINDIR)/ocamlmktop$(EXE)
cp ocamlmktop $(INSTALL_BINDIR)/ocamlmktop$(EXE)
clean::
rm -f ocamlmktop$(EXE)

View File

@ -54,10 +54,14 @@ clean::
if test -f ocamldep; then mv -f ocamldep ocamldep.bak; else :; fi
rm -f ocamldep.opt
INSTALL_BINDIR=$(DESTDIR)$(BINDIR)
INSTALL_LIBDIR=$(DESTDIR)$(LIBDIR)
install::
cp ocamldep $(BINDIR)/ocamldep$(EXE)
cp ocamldep $(INSTALL_BINDIR)/ocamldep$(EXE)
if test -f ocamldep.opt; \
then cp ocamldep.opt $(BINDIR)/ocamldep.opt$(EXE); else :; fi
then cp ocamldep.opt $(INSTALL_BINDIR)/ocamldep.opt$(EXE); else :; fi
# The profiler
@ -79,13 +83,13 @@ ocamloptp: ocamloptp.cmo
opt:: profiling.cmx
install::
cp ocamlprof $(BINDIR)/ocamlprof$(EXE)
cp ocamlcp $(BINDIR)/ocamlcp$(EXE)
cp ocamloptp $(BINDIR)/ocamloptp$(EXE)
cp profiling.cmi profiling.cmo $(LIBDIR)
cp ocamlprof $(INSTALL_BINDIR)/ocamlprof$(EXE)
cp ocamlcp $(INSTALL_BINDIR)/ocamlcp$(EXE)
cp ocamloptp $(INSTALL_BINDIR)/ocamloptp$(EXE)
cp profiling.cmi profiling.cmo $(INSTALL_LIBDIR)
installopt::
cp profiling.cmx profiling.o $(LIBDIR)
cp profiling.cmx profiling.o $(INSTALL_LIBDIR)
clean::
rm -f ocamlprof ocamlcp ocamloptp
@ -97,7 +101,7 @@ ocamlmklib: ocamlmklibconfig.cmo ocamlmklib.cmo
$(CAMLC) $(LINKFLAGS) -o ocamlmklib ocamlmklibconfig.cmo ocamlmklib.cmo
install::
cp ocamlmklib $(BINDIR)/ocamlmklib$(EXE)
cp ocamlmklib $(INSTALL_BINDIR)/ocamlmklib$(EXE)
clean::
rm -f ocamlmklib
@ -132,7 +136,7 @@ lexer299.ml: lexer299.mll
$(CAMLLEX) lexer299.mll
#install::
# cp ocaml299to3 $(BINDIR)/ocaml299to3$(EXE)
# cp ocaml299to3 $(INSTALL_BINDIR)/ocaml299to3$(EXE)
clean::
rm -f ocaml299to3 lexer299.ml
@ -148,7 +152,7 @@ lexer301.ml: lexer301.mll
$(CAMLLEX) lexer301.mll
#install::
# cp scrapelabels $(LIBDIR)
# cp scrapelabels $(INSTALL_LIBDIR)
clean::
rm -f scrapelabels lexer301.ml
@ -164,7 +168,7 @@ addlabels: addlabels.cmo
$(ADDLABELS_IMPORTS) addlabels.cmo
#install::
# cp addlabels $(LIBDIR)
# cp addlabels $(INSTALL_LIBDIR)
clean::
rm -f addlabels
@ -285,8 +289,8 @@ objinfo: objinfo_helper$(EXE) $(OBJINFO)
$(CAMLC) -o objinfo $(OBJINFO)
install::
cp objinfo $(BINDIR)/ocamlobjinfo$(EXE)
cp objinfo_helper$(EXE) $(LIBDIR)/objinfo_helper$(EXE)
cp objinfo $(INSTALL_BINDIR)/ocamlobjinfo$(EXE)
cp objinfo_helper$(EXE) $(INSTALL_LIBDIR)/objinfo_helper$(EXE)
clean::
rm -f objinfo objinfo_helper$(EXE)