usr/src/cmd/mutt/Makefile.sfw
author Cyril Plisko <cyril.plisko@grigale.com>
Wed, 21 Oct 2009 17:43:30 +0200
changeset 0 b34509ac961f
child 1 37d545eabfea
permissions -rw-r--r--
Import sfw repo b126

#
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License (the "License").
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
# or http://www.opensolaris.org/os/licensing.
# See the License for the specific language governing permissions
# and limitations under the License.
#
# When distributing Covered Code, include this CDDL HEADER in each
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
# If applicable, add the following below this CDDL HEADER, with the
# fields enclosed by brackets "[]" replaced with your own identifying
# information: Portions Copyright [yyyy] [name of copyright owner]
#
# CDDL HEADER END
#

#
# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
# Use is subject to license terms.
#

#ident	"@(#)Makefile.sfw	1.6	09/02/19 SMI"

include ../Makefile.cmd

#
# Macros
#

VER = $(COMPONENT_VERSION:sh)
PROJECT = $(COMPONENT_NAME:sh)
PROD = $(PROJECT)-$(VER)
PKG = SUNW$(PROJECT)
GZFILE = $(PROD).tar.gz
DOCDIR=$(CFGDOC)/$(PROJECT)

CFLAGS += -I$(ROOT)/usr/include/idn -I/usr/include/idn

LDFLAGS += \
    -L$(ROOT)/usr/lib \
    -M $(SRC)/cmd/mapfile_noexstk \
    -z ignore

POST_PROCESS_BIN = $(SRC)/tools/post_process \
	$(ROOTBIN)/mutt \
	$(ROOTBIN)/pgpewrap \
	$(ROOTBIN)/pgpring

MANFILES_STUBBED = \
	$(ROOTMAN1)/pgpewrap.1 \
	$(ROOTMAN1)/pgpring.1 \
	$(ROOTMAN1)/smime_keys.1

# Command to create stubbed man pages
STUB_MAN = \
	for f in $(MANFILES_STUBBED); \
	do \
	    command="`$(ECHO) "$$f" | $(SED) 's@.*/@@; s@\\..*@@'`"; \
	    section="`$(ECHO) "$$f" | $(SED) 's@.*\\.@@'`"; \
	    $(SH) ./stubman.sh "$$command" "$$section" $(DOCDIR) > "$$f"; \
	done; echo

POST_PROCESS_MAN = $(SRC)/tools/sunman -n "$(PROJECT)" -p "$(PKG)" \
	-s Uncommitted	$(ROOTMAN1)/flea.1 \
	-s Uncommitted	$(ROOTMAN1)/mutt.1 \
	-s Uncommitted	$(ROOTMAN1)/muttbug.1 \
	-s Volatile	$(ROOTMAN1)/pgpewrap.1 \
	-s Volatile	$(ROOTMAN1)/pgpring.1 \
	-s Volatile	$(ROOTMAN1)/smime_keys.1 \
	-s Committed	$(ROOTMAN5)/mbox.5 \
	-s Committed	$(ROOTMAN5)/mmdf.5 \
	-s Volatile	$(ROOTMAN5)/muttrc.5

# Options for configure script
CONFIGURE_OPTIONS += --sysconfdir=$(CFGETC)/mutt
CONFIGURE_OPTIONS += --enable-pop
CONFIGURE_OPTIONS += --enable-imap
CONFIGURE_OPTIONS += --enable-smtp
CONFIGURE_OPTIONS += --with-regex
CONFIGURE_OPTIONS += --with-slang=$(ROOT)/usr
CONFIGURE_OPTIONS += --with-ssl

#
# Targets
#

all: $(PROD)/config.status
	(cd $(PROD); env - $(CCSMAKE) MAKE=$(CCSMAKE))

install: all stubman.sh
	(cd $(PROD); env - $(CCSMAKE) install \
	    MAKE=$(CCSMAKE) \
	    DESTDIR="$(ROOT)")
	$(RM) $(ROOT)/etc/mutt/*.dist
	$(STUB_MAN)
	$(POST_PROCESS_BIN)
	$(POST_PROCESS_MAN)

$(PROD)/configure: $(GZFILE)
	/usr/bin/gzcat $^ | $(TAR) xopf -
	$(TOUCH) $@

$(PROD)/config.status: $(PROD)/configure
	(cd $(PROD); env - ./configure \
	    $(CONFIGURE_OPTIONS) \
	    CC="$(CC)" \
	    CFLAGS="$(CFLAGS)" \
	    LDFLAGS="$(LDFLAGS)" \
	    INSTALL="$(INSTALL_PROTO) -m 755 " \
	    MAKE=$(CCSMAKE))

clean:
	-rm -rf $(PROD)

install_h:

include ../Makefile.targ