xref: /titanic_44/usr/src/cmd/ssh/Makefile.ssh-common (revision 257873cfc1dd3337766407f80397db60a56f2f5a)
17c478bd9Sstevel@tonic-gate#
27c478bd9Sstevel@tonic-gate# CDDL HEADER START
37c478bd9Sstevel@tonic-gate#
47c478bd9Sstevel@tonic-gate# The contents of this file are subject to the terms of the
524da5b34Srie# Common Development and Distribution License (the "License").
624da5b34Srie# You may not use this file except in compliance with the License.
77c478bd9Sstevel@tonic-gate#
87c478bd9Sstevel@tonic-gate# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
97c478bd9Sstevel@tonic-gate# or http://www.opensolaris.org/os/licensing.
107c478bd9Sstevel@tonic-gate# See the License for the specific language governing permissions
117c478bd9Sstevel@tonic-gate# and limitations under the License.
127c478bd9Sstevel@tonic-gate#
137c478bd9Sstevel@tonic-gate# When distributing Covered Code, include this CDDL HEADER in each
147c478bd9Sstevel@tonic-gate# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
157c478bd9Sstevel@tonic-gate# If applicable, add the following below this CDDL HEADER, with the
167c478bd9Sstevel@tonic-gate# fields enclosed by brackets "[]" replaced with your own identifying
177c478bd9Sstevel@tonic-gate# information: Portions Copyright [yyyy] [name of copyright owner]
187c478bd9Sstevel@tonic-gate#
197c478bd9Sstevel@tonic-gate# CDDL HEADER END
207c478bd9Sstevel@tonic-gate#
21*257873cfSJohn.Zolnowsky@Sun.COM# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
227c478bd9Sstevel@tonic-gate# Use is subject to license terms.
237c478bd9Sstevel@tonic-gate#
247c478bd9Sstevel@tonic-gate# Common definitions for all of usr/src/cmd/ssh subdirs
257c478bd9Sstevel@tonic-gate#
267c478bd9Sstevel@tonic-gate
277c478bd9Sstevel@tonic-gateinclude $(SRC)/lib/openssl/Makefile.openssl
287c478bd9Sstevel@tonic-gate
297c478bd9Sstevel@tonic-gateTEXT_DOMAIN=SUNW_OST_OSCMD
307c478bd9Sstevel@tonic-gate
317c478bd9Sstevel@tonic-gateCFLAGS += $(CCVERBOSE)
3224da5b34SrieLDFLAGS += $(MAPFILE.NGB:%=-M%)
337c478bd9Sstevel@tonic-gate
349b03ea0fSjp161948SSH_VERSION=\"Sun_SSH_1.2\"
357c478bd9Sstevel@tonic-gate
367c478bd9Sstevel@tonic-gateC99MODE= $(C99_ENABLE)
377c478bd9Sstevel@tonic-gate
387c478bd9Sstevel@tonic-gateCPPFLAGS = -DSSH_VERSION=$(SSH_VERSION) \
397c478bd9Sstevel@tonic-gate	-I../include -I../../include \
407c478bd9Sstevel@tonic-gate	-D_FILE_OFFSET_BITS=64 \
417c478bd9Sstevel@tonic-gate	-erroff=E_STATEMENT_NOT_REACHED \
42*257873cfSJohn.Zolnowsky@Sun.COM	$(CPPFLAGS.master)
437c478bd9Sstevel@tonic-gate
447c478bd9Sstevel@tonic-gateSSH_COMMON_LDLIBS = \
457c478bd9Sstevel@tonic-gate	-L../libssh/$(MACH) -lssh \
467c478bd9Sstevel@tonic-gate	-L../libopenbsd-compat/$(MACH) -lopenbsd-compat
477c478bd9Sstevel@tonic-gate
4824da5b34Srie$(PROG): $(MAPFILE.NGB)
4924da5b34Srie
507c478bd9Sstevel@tonic-gate#
517c478bd9Sstevel@tonic-gate# Some the lint -erroff flags listed below are because of deficiencies in
527c478bd9Sstevel@tonic-gate# lint not because we are hiding real errors or to avoid massive resync-
537c478bd9Sstevel@tonic-gate# hindering changes that will not be returned to OpenSSH.
547c478bd9Sstevel@tonic-gate#
557c478bd9Sstevel@tonic-gate# OpenSSH has several instances of "do {...} while (0);" - a common
567c478bd9Sstevel@tonic-gate# idiom in C macros, but it elicits E_CONSTANT_CONDITION from lint.
577c478bd9Sstevel@tonic-gate#
587c478bd9Sstevel@tonic-gate# The MD5 macros in <openssl/md5.h> trigger E_EXPR_NULL_EFFECT.
597c478bd9Sstevel@tonic-gate#
607c478bd9Sstevel@tonic-gate# Lots of function return values are ignored in OpenSSH.
617c478bd9Sstevel@tonic-gate#
627c478bd9Sstevel@tonic-gate# Lots of globals could be static, sometimes due to portable code paths
637c478bd9Sstevel@tonic-gate# which are dead on Solaris.
647c478bd9Sstevel@tonic-gate#
657c478bd9Sstevel@tonic-gateLINTFLAGS += \
667c478bd9Sstevel@tonic-gate	-erroff=E_FUNC_ARG_UNUSED \
677c478bd9Sstevel@tonic-gate	-erroff=E_NAME_USED_NOT_DEF2 \
687c478bd9Sstevel@tonic-gate	-erroff=E_FUNC_DECL_VAR_ARG2 \
697c478bd9Sstevel@tonic-gate	-erroff=E_INCONS_VAL_TYPE_DECL2 \
707c478bd9Sstevel@tonic-gate	-erroff=E_INCONS_ARG_DECL2 \
717c478bd9Sstevel@tonic-gate	-erroff=E_STATIC_UNUSED \
727c478bd9Sstevel@tonic-gate	-erroff=E_STATEMENT_NOT_REACHED \
737c478bd9Sstevel@tonic-gate	-erroff=E_FUNC_RET_ALWAYS_IGNOR2 \
747c478bd9Sstevel@tonic-gate	-erroff=E_FUNC_RET_MAYBE_IGNORED2 \
757c478bd9Sstevel@tonic-gate	-erroff=E_GLOBAL_COULD_BE_STATIC2 \
767c478bd9Sstevel@tonic-gate	-erroff=E_CONSTANT_CONDITION \
777c478bd9Sstevel@tonic-gate	-erroff=E_EXPR_NULL_EFFECT \
787c478bd9Sstevel@tonic-gate	-errtags=yes
797c478bd9Sstevel@tonic-gate
807c478bd9Sstevel@tonic-gateROOTLIBSSH=	$(ROOTLIB)/ssh
817c478bd9Sstevel@tonic-gateROOTLIBSSHPROG=	$(PROG:%=$(ROOTLIBSSH)/%)
827c478bd9Sstevel@tonic-gate
837c478bd9Sstevel@tonic-gatePOFILE= _messages.po
847c478bd9Sstevel@tonic-gate
857c478bd9Sstevel@tonic-gate$(ROOTLIBSSH)/%: %
867c478bd9Sstevel@tonic-gate	$(INS.file)
87