components/erlang/Makefile
changeset 346 d28be18217b8
child 351 4f0c1acc260d
equal deleted inserted replaced
345:61b29cf8b717 346:d28be18217b8
       
     1 #
       
     2 # CDDL HEADER START
       
     3 #
       
     4 # The contents of this file are subject to the terms of the
       
     5 # Common Development and Distribution License (the "License").
       
     6 # You may not use this file except in compliance with the License.
       
     7 #
       
     8 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
       
     9 # or http://www.opensolaris.org/os/licensing.
       
    10 # See the License for the specific language governing permissions
       
    11 # and limitations under the License.
       
    12 #
       
    13 # When distributing Covered Code, include this CDDL HEADER in each
       
    14 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
       
    15 # If applicable, add the following below this CDDL HEADER, with the
       
    16 # fields enclosed by brackets "[]" replaced with your own identifying
       
    17 # information: Portions Copyright [yyyy] [name of copyright owner]
       
    18 #
       
    19 # CDDL HEADER END
       
    20 #
       
    21 
       
    22 #
       
    23 # Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
       
    24 #
       
    25 
       
    26 include ../../make-rules/shared-macros.mk
       
    27 
       
    28 COMPONENT_NAME=		otp_src
       
    29 COMPONENT_VERSION_MAJOR=	12
       
    30 COMPONENT_VERSION_MINOR=	B
       
    31 COMPONENT_VERSION_MICRO=	5
       
    32 # IPS_COMPONENT_VERSION needs update whenever this is changed
       
    33 COMPONENT_VERSION=	R$(COMPONENT_VERSION_MAJOR)$(COMPONENT_VERSION_MINOR)-$(COMPONENT_VERSION_MICRO)
       
    34 COMPONENT_SRC=		$(COMPONENT_NAME)_$(COMPONENT_VERSION)
       
    35 COMPONENT_ARCHIVE=	$(COMPONENT_SRC).tar.gz
       
    36 COMPONENT_ARCHIVE_HASH=	sha1:6c45509acf70d35d5def2cbefd86ada093c1ac3a
       
    37 COMPONENT_ARCHIVE_URL=	http://www.erlang.org/download/$(COMPONENT_ARCHIVE)
       
    38 
       
    39 # manpages
       
    40 COMPONENT_NAME_1=	otp_doc_man
       
    41 COMPONENT_SRC_1=	$(COMPONENT_NAME_1)_$(COMPONENT_VERSION)
       
    42 COMPONENT_ARCHIVE_1=	$(COMPONENT_SRC_1).tar.gz
       
    43 COMPONENT_ARCHIVE_HASH_1=	sha1:ae7036bd2afc9d1fca97f0de2eca84f56656def8
       
    44 COMPONENT_ARCHIVE_URL_1=	http://www.erlang.org/download/$(COMPONENT_ARCHIVE_1)
       
    45 
       
    46 # HTML documentation
       
    47 COMPONENT_NAME_2=	otp_doc_html
       
    48 COMPONENT_SRC_2=	$(COMPONENT_NAME_2)_$(COMPONENT_VERSION)
       
    49 COMPONENT_ARCHIVE_2=	$(COMPONENT_SRC_2).tar.gz
       
    50 COMPONENT_ARCHIVE_HASH_2=	sha1:0bd369d02051e01bac58c9b8665bd3538e116f51
       
    51 COMPONENT_ARCHIVE_URL_2=	http://www.erlang.org/download/$(COMPONENT_ARCHIVE_2)
       
    52 
       
    53 include ../../make-rules/prep.mk
       
    54 include ../../make-rules/configure.mk
       
    55 include ../../make-rules/ips.mk
       
    56 
       
    57 # IPS_COMPONENT_VERSION is by default set to $(COMPONENT_VERSION) but it is not
       
    58 # enough for us. We need to include the $(COMPONENT_SUBVERSION) somehow.
       
    59 # Because the IPS_COMPONENT_VERSION cannot contain letters we use mapping:
       
    60 # R(major)(minor)-(micro) - (major).(minor as number).(micro)
       
    61 IPS_COMPONENT_VERSION=  $(COMPONENT_VERSION_MAJOR).2.$(COMPONENT_VERSION_MICRO)
       
    62 
       
    63 # Built in SFW with gcc and builds cleanly now only with gcc
       
    64 COMPILER = gcc
       
    65 
       
    66 CONFIGURE_OPTIONS += CFLAGS="$(CFLAGS)"
       
    67 CONFIGURE_OPTIONS += CPPFLAGS="$(CPPFLAGS) -I/usr/include/gd2"
       
    68 CONFIGURE_OPTIONS += INSTALL="/usr/ucb/install -c"
       
    69 CONFIGURE_OPTIONS += --enable-smp-support
       
    70 CONFIGURE_OPTIONS += --enable-threads
       
    71 CONFIGURE_OPTIONS += --enable-hipe
       
    72 CONFIGURE_OPTIONS += --with-ssl
       
    73 CONFIGURE_OPTIONS += --enable-dynamic-ssl-lib
       
    74 
       
    75 CONFIGURE_OPTIONS.64 += LDFLAGS="$(LDFLAGS) -m64"
       
    76 CONFIGURE_OPTIONS.64 += LIBS="-m64"
       
    77 
       
    78 COMPONENT_PRE_CONFIGURE_ACTION = \
       
    79 	($(CLONEY) $(SOURCE_DIR) $(@D))
       
    80 CONFIGURE_SCRIPT =	$(@D)/configure
       
    81 
       
    82 COMPONENT_INSTALL_ARGS += INSTALL_PREFIX=$(PROTO_DIR)
       
    83 
       
    84 # common targets
       
    85 build:	$(BUILD_32_and_64)
       
    86 
       
    87 install:	$(INSTALL_32_and_64)
       
    88 	# Undelivered useless files:
       
    89 	#    erlang/lib/crypto-*/priv/obj
       
    90 	#    erlang/lib/ssl-*/priv/obj
       
    91 	#    erlang/Install
       
    92 	#    erlang/misc
       
    93 	#    erlang/*/*.bat
       
    94 	#    manpages: start.1 werl.1
       
    95 	$(RM) -r documentation
       
    96 	$(MKDIR) documentation && cd documentation && \
       
    97 	$(UNPACK) $(UNPACK_ARGS) ../$(COMPONENT_ARCHIVE_1) && \
       
    98 	$(UNPACK) $(UNPACK_ARGS) ../$(COMPONENT_ARCHIVE_2)
       
    99 	# remove INSTALL_PREFIX from path
       
   100 	$(PERL) -pi -e "s|$(PROTO_DIR)||g" $(PROTO_DIR)/usr/lib/erlang/bin/erl \
       
   101 		$(PROTO_DIR)/usr/lib/$(MACH64)/erlang/bin/erl \
       
   102 		$(PROTO_DIR)/usr/lib/erlang/releases/RELEASES \
       
   103 		$(PROTO_DIR)/usr/lib/$(MACH64)/erlang/releases/RELEASES
       
   104 
       
   105 clean::
       
   106 	$(RM) -r documentation
       
   107 
       
   108 test:	$(NO_TESTS)
       
   109 
       
   110 BUILD_PKG_DEPENDENCIES =	$(BUILD_TOOLS)
       
   111 
       
   112 include ../../make-rules/depend.mk