Makefile revision 2899
1964N/A#
1964N/A# CDDL HEADER START
1964N/A#
1964N/A# The contents of this file are subject to the terms of the
1964N/A# Common Development and Distribution License (the "License").
1964N/A# You may not use this file except in compliance with the License.
1964N/A#
1964N/A# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
1964N/A# or http://www.opensolaris.org/os/licensing.
1964N/A# See the License for the specific language governing permissions
1964N/A# and limitations under the License.
1964N/A#
1964N/A# When distributing Covered Code, include this CDDL HEADER in each
1964N/A# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
1964N/A# If applicable, add the following below this CDDL HEADER, with the
1964N/A# fields enclosed by brackets "[]" replaced with your own identifying
1964N/A# information: Portions Copyright [yyyy] [name of copyright owner]
1964N/A#
1964N/A# CDDL HEADER END
1964N/A#
1964N/A
1964N/A#
2899N/A# Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
1964N/A#
1964N/A
1964N/Ainclude ../../make-rules/shared-macros.mk
1964N/A
1964N/APATH=/usr/bin:/usr/gnu/bin:/usr/sbin:$(SPRO_VROOT)/bin
1964N/A
1964N/ACOMPONENT_NAME= ocaml
1964N/ACOMPONENT_VERSION= 3.11.2
1964N/ACOMPONENT_PROJECT_URL= http://www.ocaml.org
1964N/ACOMPONENT_SRC= $(COMPONENT_NAME)-$(COMPONENT_VERSION)
1964N/ACOMPONENT_ARCHIVE= $(COMPONENT_SRC).tar.bz2
1964N/ACOMPONENT_ARCHIVE_HASH= \
1964N/A sha256:86f3387a0d7e7c8be2a3c53af083a5a726e333686208d5ea0dd6bb5ac3f58143
1964N/ACOMPONENT_ARCHIVE_URL= http://caml.inria.fr/distrib/ocaml-3.11/$(COMPONENT_ARCHIVE)
1964N/A
1964N/A# Documentation sources
1964N/A#
1964N/ACOMPONENT_ARCHIVE_1= ocaml-3.11-refman.html.tar.gz
1964N/ACOMPONENT_ARCHIVE_HASH_1= \
1964N/A sha256:1c65b334ccb155aefa1e5e930a91f816d843d37e26b27d3a0351c57149005a5c
1964N/ACOMPONENT_ARCHIVE_URL_1= http://caml.inria.fr/distrib/ocaml-3.11/$(COMPONENT_ARCHIVE_1)
1964N/A
1964N/ACOMPONENT_ARCHIVE_2= ocaml-3.11-refman.pdf
1964N/ACOMPONENT_ARCHIVE_HASH_2= \
1964N/A sha256:35f5adfeb92817f7e3ef66dec6b4ca910f48a3a2cf0bfa34bd155fe6866de405
1964N/ACOMPONENT_ARCHIVE_URL_2= http://caml.inria.fr/distrib/ocaml-3.11/$(COMPONENT_ARCHIVE_2)
1964N/A
1964N/ACOMPONENT_ARCHIVE_3= ocaml-3.11-refman.info.tar.gz
1964N/ACOMPONENT_ARCHIVE_HASH_3= \
1964N/A sha256:48eedc6a870bef84562b2d0ed25d9c3b15ab646f72ecfb4c6c2cbaccc6b4081d
1964N/ACOMPONENT_ARCHIVE_URL_3= http://caml.inria.fr/distrib/ocaml-3.11/$(COMPONENT_ARCHIVE_3)
1964N/A
1964N/ACOMPONENT_BUGDB= utility/ocaml
1964N/A
2899N/ATPNO= 9233
2899N/A
1964N/Ainclude ../../make-rules/prep.mk
1964N/Ainclude ../../make-rules/configure.mk
1964N/Ainclude ../../make-rules/ips.mk
1964N/A
1964N/ACONFIGURE_ENV += CFLAGS="$(CFLAGS)"
1964N/A
1964N/A# We don't support 64-bit yet, but this will be needed when we do.
1964N/ACONFIGURE_ENV.64 += UL_LDFLAGS="-m64"
1964N/A
1964N/A# Ocaml does not use a standard configure script, but has its own handwritten
1964N/A# one. So we must specify the arguments it accepts by hand.
1964N/A#
1964N/ACONFIGURE_OPTIONS = --bindir $(CONFIGURE_BINDIR.$(BITS))
1964N/ACONFIGURE_OPTIONS += --libdir $(CONFIGURE_LIBDIR.$(BITS))/ocaml
1964N/ACONFIGURE_OPTIONS += --x11lib $(CONFIGURE_LIBDIR.$(BITS))
1964N/ACONFIGURE_OPTIONS += --x11include $(CONFIGURE_INCLUDEDIR)
1964N/ACONFIGURE_OPTIONS += --mandir $(CONFIGURE_MANDIR)
1964N/ACONFIGURE_OPTIONS += -cc cc
1964N/ACONFIGURE_OPTIONS += -aspp "/usr/bin/as -P"
1964N/ACONFIGURE_OPTIONS += -as "/usr/bin/as"
1964N/A
1964N/ACOMPONENT_PRE_CONFIGURE_ACTION = \
1964N/A ($(CLONEY) $(SOURCE_DIR) $(@D))
1964N/A
1964N/ACOMPONENT_BUILD_TARGETS = world opt opt.opt
1964N/A
1964N/A# Set up some environment variables to make things look nicer.
1964N/A#
1964N/AUL_OCAML_PDFDOC = $(COMPONENT_DIR)/$(COMPONENT_ARCHIVE_2)
1964N/AUL_OCAML_INCLUDES = -nostdlib -I stdlib -I utils -I parsing -I typing -I bytecomp -I asmcomp -I driver
1964N/AUL_OCAML_ALLINCLUDES = $(UL_OCAML_INCLUDES) -I otherlibs/unix -I otherlibs/str -I otherlibs/dynlink
1964N/AUL_PROTO_BINDIR = $(PROTO_DIR)/$(CONFIGURE_BINDIR.$(BITS))
1964N/AUL_PROTO_LIBDIR = $(PROTO_DIR)/$(CONFIGURE_LIBDIR.$(BITS))
1964N/AUL_PROTO_INFODIR = $(PROTO_DIR)/$(CONFIGURE_INFODIR)
1964N/AUL_PROTO_DATADIR = $(PROTO_DIR)/$(CONFIGURE_PREFIX)/share
1964N/ACOMPONENT_INSTALL_ARGS += EMACSDIR="$(UL_PROTO_DATADIR)/emacs/site-lisp"
1964N/AUL_PROTO_DOCDIR = $(UL_PROTO_DATADIR)/doc/ocaml
1964N/AUL_PROTO_EXAM = $(UL_PROTO_DOCDIR)/otherlibs/labltk
1964N/A
1964N/A# This action unpacks the additional tarballs and builds some additional
1964N/A# useful programs. For example, the ocamlbyteinfo and ocamlplugininfo
1964N/A# utilities are useful additions from Debian, and also included in RHEL.
1964N/A# http://git.debian.org/?p=pkg-ocaml-maint/packages/ocaml.git;a=tree;f=debian/ocamlbyteinfo;hb=HEAD
1964N/A#
1964N/A
1964N/ACOMPONENT_POST_BUILD_ACTION = (cd $(@D); \
1964N/A export LD_EXEC_OPTIONS="-z aslr=disable"; \
1964N/A $(UNPACK) $(UNPACK_ARGS) ../../$(COMPONENT_ARCHIVE_1); \
1964N/A $(UNPACK) $(UNPACK_ARGS) ../../$(COMPONENT_ARCHIVE_3); \
1964N/A $(CP) $(COMPONENT_DIR)/files/ocamlbyteinfo.ml $(@D); \
1964N/A $(CP) $(COMPONENT_DIR)/files/ocamlplugininfo.ml $(@D); \
1964N/A $(CP) ./otherlibs/dynlink/natdynlink.ml .; \
1964N/A ($(ENV) $(COMPONENT_BUILD_ENV) $(GMAKE) \
1964N/A $(COMPONENT_BUILD_ARGS) -C emacs ocamltags); \
1964N/A ($(ENV) $(COMPONENT_BUILD_ENV) \
1964N/A boot/ocamlrun ./ocamlc $(UL_OCAML_ALLINCLUDES) \
1964N/A dynlinkaux.cmo ocamlbyteinfo.ml -o ocamlbyteinfo); \
1964N/A ($(ENV) $(COMPONENT_BUILD_ENV) \
1964N/A boot/ocamlrun ./ocamlopt $(UL_OCAML_ALLINCLUDES) \
1964N/A unix.cmxa str.cmxa natdynlink.ml ocamlplugininfo.ml \
1964N/A -o ocamlplugininfo); \
1964N/A ($(ENV) $(COMPONENT_BUILD_ENV) \
1964N/A boot/ocamlrun ./ocamlopt $(UL_OCAML_INCLUDES) \
1964N/A -o objinfo config.cmx tools/objinfo.ml))
1964N/A
1964N/ACOMPONENT_INSTALL_ARGS += BINDIR="$(UL_PROTO_BINDIR)"
1964N/ACOMPONENT_INSTALL_ARGS += LIBDIR="$(UL_PROTO_LIBDIR)/ocaml"
1964N/ACOMPONENT_INSTALL_ARGS += MANDIR="$(PROTOUSRSHAREMANDIR)"
1964N/ACOMPONENT_INSTALL_ARGS += EMACSDIR="$(UL_PROTO_DATADIR)/emacs/site-lisp"
1964N/A
1964N/A# This action moves additional files we want to install into the proto area.
1964N/A# I prefer using "cp -R" for copying the documentation tarball and example
1964N/A# contents since it will make it easier to see new files need to be packaged
1964N/A# when Ocaml is updated.
1964N/A#
1964N/ACOMPONENT_POST_INSTALL_ACTION = (cd $(@D)/emacs ; \
1964N/A $(ENV) $(COMPONENT_BUILD_ENV) $(GMAKE) install install-ocamltags $(COMPONENT_INSTALL_ARGS); \
1964N/A cd $(@D); \
1964N/A $(MKDIR) -p $(UL_PROTO_INFODIR); \
1964N/A $(CP) $(@D)/infoman/ocaml*.gz $(UL_PROTO_INFODIR); \
1964N/A $(MKDIR) -p $(UL_PROTO_EXAM); \
1964N/A $(CP) $(UL_OCAML_PDFDOC) $(UL_PROTO_DOCDIR)/refman.pdf; \
1964N/A $(CP) -R $(@D)/htmlman $(UL_PROTO_DOCDIR); \
1964N/A $(CP) -R $(@D)/otherlibs/labltk/examples_* $(UL_PROTO_EXAM); \
1964N/A $(RM) $(UL_PROTO_EXAM)/examples_*/.cvsignore)
1964N/A
1964N/A# ASLR should be enabled when 64-bit support is enabled, which is planned as
1964N/A# a follow-on step.
1964N/A#
1964N/AASLR_MODE = $(ASLR_DISABLE)
1964N/A
1964N/A# Files built in the COMPONENT_POST_INSTALL_ACTION are found by setting
1964N/A# PKG_PROTO_DIRS as follows:
1964N/A#
1964N/APKG_PROTO_DIRS += $(BUILD_DIR_$(BITS))
1964N/A
1964N/A# common targets
1964N/Abuild: $(BUILD_32)
1964N/A
1964N/Ainstall: $(INSTALL_32)
1964N/A
1964N/Atest: $(TEST_32)
1964N/A
1964N/ABUILD_PKG_DEPENDENCIES = $(BUILD_TOOLS)
1964N/A
1964N/Ainclude ../../make-rules/depend.mk