Home | History | Annotate | Download | only in ejabberd
      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 2009 Sun Microsystems, Inc.  All rights reserved.
     24 # Use is subject to license terms.
     25 #
     26 # ident	"@(#)Makefile.sfw	1.2	09/06/18 SMI"
     27 #
     28 
     29 VER =		$(COMPONENT_NAME:sh)-$(COMPONENT_VERSION:sh)
     30 TARBALL =	$(VER).tar.gz
     31 ESRC =		$(VER)/src
     32 PATCHES:sh =	echo Patches/*.patch
     33 
     34 include ../Makefile.cmd
     35 
     36 CONFIGURE_OPTIONS +=	--exec_prefix=/usr
     37 CONFIGURE_OPTIONS +=	--sysconfdir=/etc
     38 CONFIGURE_OPTIONS +=	--localstatedir=/var
     39 
     40 TARGET_ENV +=	CC="$(GCC)"
     41 TARGET_ENV +=	MAKE="$(GMAKE)"
     42 TARGET_ENV +=	HOME="/tmp"
     43 TARGET_ENV +=	LDFLAGS="-L$(ROOT)/lib -L$(ROOT)/usr/lib"
     44 
     45 all:=		TARGET = all
     46 install:=	TARGET = install
     47 install:=	TARGET_ENV += INSTALL="$(SRC)/tools/install-proto"
     48 install:=	TARGET_ENV += DESTDIR="$(ROOT)"
     49 
     50 install: all
     51 	-$(RM) $(ROOT)/etc/ejabberd/ejabberd.cfg
     52 	-$(RM) $(ROOT)/etc/ejabberd/ejabberdctl.cfg
     53 	(cd $(ESRC); env - $(TARGET_ENV) $(GMAKE) -e $(TARGET))
     54 	# install man pages
     55 	$(SHELL) ./install-sfw
     56 	# apply file attributes to files in proto area
     57 	for pkg in $(COMPONENT_PACKAGES:sh); do \
     58 		$(SRC)/tools/protofix --pkg $$pkg --perm; \
     59 	done
     60 
     61 all: $(ESRC)/config.status
     62 	(cd $(ESRC); env - $(TARGET_ENV) $(GMAKE) $(TARGET))
     63 
     64 $(ESRC)/config.status: $(ESRC)/configure
     65 	(cd $(ESRC); env - $(TARGET_ENV) ./configure $(CONFIGURE_OPTIONS))
     66 
     67 $(ESRC)/configure: $(VER)/.patched
     68 
     69 clean:
     70 	-rm -rf $(VER)
     71 
     72 include ../Makefile.targ
     73 
     74 FRC:
     75