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.1     09/07/17 SMI"
  27 #
  28 
  29 #
  30 # lib/libyaz/Makefile.sfw
  31 #
  32 
  33 VER                  =  $(COMPONENT_NAME:sh)-$(COMPONENT_VERSION:sh)
  34 VER64                =  $(VER)-64
  35 TARBALL              =  $(VER).tar.gz
  36 
  37 PREFIX               =  $(ROOT)/usr
  38 
  39 CONFIGURE_GENERIC    =  LDFLAGS="$(LDFLAGS)"
  40 CONFIGURE_GENERIC    += PATH=$(SFW_PATH)
  41 CONFIGURE_GENERIC    += MAKE="$(CCSMAKE)"
  42 
  43 PRE_CONFIGURE        =  CC="$(CC)"
  44 PRE_CONFIGURE        += CFLAGS="$(CFLAGS)"
  45 PRE_CONFIGURE        += $(CONFIGURE_GENERIC)
  46 
  47 PRE_CONFIGURE_64     =  CC="$(CC64)"
  48 PRE_CONFIGURE_64     += CFLAGS="$(CFLAGS64)"
  49 PRE_CONFIGURE_64     += $(CONFIGURE_GENERIC)
  50 
  51 GENERIC_OPTIONS      =  --datarootdir="/usr/share"
  52 GENERIC_OPTIONS      += --includedir=$(CFGINC)
  53 GENERIC_OPTIONS      += --mandir=$(CFGMAN)
  54 GENERIC_OPTIONS      += INSTALL="$(INSTALL_PROTO)"
  55 GENERIC_OPTIONS      += INSTALL_DATA="$(INSTALL_PROTO) -m 444"
  56 
  57 CONFIGURE_OPTIONS_32 =  --bindir=$(CFGBIN)
  58 CONFIGURE_OPTIONS_32 += --libdir=$(CFGLIB)
  59 CONFIGURE_OPTIONS_32 += $(GENERIC_OPTIONS)
  60 
  61 CONFIGURE_OPTIONS_64 =  --bindir=$(CFGBIN64)
  62 CONFIGURE_OPTIONS_64 += --libdir=$(CFGLIB64)
  63 CONFIGURE_OPTIONS_64 += $(GENERIC_OPTIONS)
  64 
  65 include ../Makefile.lib
  66 
  67 all: all32 test32 install32 all64 test64 install64
  68 
  69 all32: $(VER)/config.status
  70         (cd $(VER); env - "CFLAGS=$(CFLAGS)" $(CONFIGURE_GENERIC) $(CCSMAKE))
  71 
  72 all64: $(VER64)/config.status
  73         (cd $(VER64); env - "CFLAGS=$(CFLAGS64)" $(CONFIGURE_GENERIC) $(CCSMAKE))
  74 
  75 test32:
  76         (cd $(VER); env - $(CCSMAKE) check)
  77 
  78 test64:
  79         (cd $(VER64); env - $(CCSMAKE) check)
  80 
  81 install: all
  82         for pkg in $(COMPONENT_PACKAGES:sh) ; do \
  83                 $(SRC)/tools/protofix --pkg $$pkg --perm ; \
  84         done
  85 
  86         ($(RM) \
  87                 $(ROOTBIN)/yaz-icu \
  88                 $(ROOTMAN1)/yaz-icu.1 \
  89                 $(ROOTLIB)/libyaz*.a \
  90                 $(ROOTLIB)/libyaz*.la \
  91                 $(ROOTBIN64)/yaz-* \
  92                 $(ROOTBIN64)/zoomsh \
  93                 $(ROOTLIB64)/libyaz*.a \
  94                 $(ROOTLIB64)/libyaz*.la \
  95                 $(ROOTLIB64)/pkgconfig/yaz.pc)
  96 
  97 install32: 
  98         (cd $(VER); env - $(CCSMAKE) MANSCRIPT=$(COMPONENT_TOP)/sunman-stability DESTDIR=$(ROOT) install)
  99 
 100 install64:
 101         (cd $(VER64); env - $(CCSMAKE) MANSCRIPT=$(COMPONENT_TOP)/sunman-stability DESTDIR=$(ROOT) install)
 102 
 103 $(VER)/config.status: $(VER)/configure
 104         (cd $(VER); env - $(PRE_CONFIGURE) $(SHELL) ./configure $(CONFIGURE_OPTIONS_32))
 105 
 106 $(VER64)/config.status: $(VER64)/configure
 107         (cd $(VER64); env - $(PRE_CONFIGURE_64) $(SHELL) ./configure $(CONFIGURE_OPTIONS_64))
 108 
 109 $(VER)/configure: $(TARBALL)
 110         $(GTAR) xzpf $(TARBALL) --no-same-owner
 111         $(TOUCH) $(VER)/configure
 112 
 113 $(VER64)/configure: $(TARBALL)
 114         $(MKDIR) -p tmp; (cd tmp; $(GTAR) xzpf ../$(TARBALL) --no-same-owner)
 115         $(MV) tmp/$(VER) $(VER64); $(RMDIR) tmp
 116         $(TOUCH) $(VER64)/configure
 117 
 118 clean:
 119         -rm -rf $(VER) $(VER64)
 120 
 121 install_h:
 122 
 123 include ../Makefile.targ