xref: /titanic_44/usr/src/cmd/ssh/Makefile.ssh-common (revision 7014882c6a3672fd0e5d60200af8643ae53c5928)
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#
216f786aceSNobutomo Nakano# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
227c478bd9Sstevel@tonic-gate# Use is subject to license terms.
237c478bd9Sstevel@tonic-gate#
2416b7b96cSMilan Jurik# Copyright 2012 Milan Jurik. All rights reserved.
2516b7b96cSMilan Jurik#
267c478bd9Sstevel@tonic-gate# Common definitions for all of usr/src/cmd/ssh subdirs
277c478bd9Sstevel@tonic-gate#
287c478bd9Sstevel@tonic-gate
297c478bd9Sstevel@tonic-gate
307c478bd9Sstevel@tonic-gateTEXT_DOMAIN=SUNW_OST_OSCMD
317c478bd9Sstevel@tonic-gate
327c478bd9Sstevel@tonic-gateCFLAGS += $(CCVERBOSE)
3324da5b34SrieLDFLAGS += $(MAPFILE.NGB:%=-M%)
347c478bd9Sstevel@tonic-gate
353a7bd039SJan PechanecSSH_VERSION=\"Sun_SSH_1.5\"
367c478bd9Sstevel@tonic-gate
377c478bd9Sstevel@tonic-gateC99MODE= $(C99_ENABLE)
387c478bd9Sstevel@tonic-gate
397c478bd9Sstevel@tonic-gateCPPFLAGS = -DSSH_VERSION=$(SSH_VERSION) \
407c478bd9Sstevel@tonic-gate	-I../include -I../../include \
417c478bd9Sstevel@tonic-gate	-D_FILE_OFFSET_BITS=64 \
427c478bd9Sstevel@tonic-gate	-erroff=E_STATEMENT_NOT_REACHED \
43257873cfSJohn.Zolnowsky@Sun.COM	$(CPPFLAGS.master)
447c478bd9Sstevel@tonic-gate
457c478bd9Sstevel@tonic-gateSSH_COMMON_LDLIBS = \
467c478bd9Sstevel@tonic-gate	-L../libssh/$(MACH) -lssh \
477c478bd9Sstevel@tonic-gate	-L../libopenbsd-compat/$(MACH) -lopenbsd-compat
487c478bd9Sstevel@tonic-gate
4924da5b34Srie$(PROG): $(MAPFILE.NGB)
5024da5b34Srie
517c478bd9Sstevel@tonic-gate#
527c478bd9Sstevel@tonic-gate# Some the lint -erroff flags listed below are because of deficiencies in
537c478bd9Sstevel@tonic-gate# lint not because we are hiding real errors or to avoid massive resync-
547c478bd9Sstevel@tonic-gate# hindering changes that will not be returned to OpenSSH.
557c478bd9Sstevel@tonic-gate#
567c478bd9Sstevel@tonic-gate# OpenSSH has several instances of "do {...} while (0);" - a common
577c478bd9Sstevel@tonic-gate# idiom in C macros, but it elicits E_CONSTANT_CONDITION from lint.
587c478bd9Sstevel@tonic-gate#
597c478bd9Sstevel@tonic-gate# The MD5 macros in <openssl/md5.h> trigger E_EXPR_NULL_EFFECT.
607c478bd9Sstevel@tonic-gate#
617c478bd9Sstevel@tonic-gate# Lots of function return values are ignored in OpenSSH.
627c478bd9Sstevel@tonic-gate#
637c478bd9Sstevel@tonic-gate# Lots of globals could be static, sometimes due to portable code paths
647c478bd9Sstevel@tonic-gate# which are dead on Solaris.
657c478bd9Sstevel@tonic-gate#
667c478bd9Sstevel@tonic-gateLINTFLAGS += \
677c478bd9Sstevel@tonic-gate	-erroff=E_FUNC_ARG_UNUSED \
687c478bd9Sstevel@tonic-gate	-erroff=E_NAME_USED_NOT_DEF2 \
697c478bd9Sstevel@tonic-gate	-erroff=E_FUNC_DECL_VAR_ARG2 \
707c478bd9Sstevel@tonic-gate	-erroff=E_INCONS_VAL_TYPE_DECL2 \
717c478bd9Sstevel@tonic-gate	-erroff=E_INCONS_ARG_DECL2 \
727c478bd9Sstevel@tonic-gate	-erroff=E_STATIC_UNUSED \
737c478bd9Sstevel@tonic-gate	-erroff=E_STATEMENT_NOT_REACHED \
747c478bd9Sstevel@tonic-gate	-erroff=E_FUNC_RET_ALWAYS_IGNOR2 \
757c478bd9Sstevel@tonic-gate	-erroff=E_FUNC_RET_MAYBE_IGNORED2 \
767c478bd9Sstevel@tonic-gate	-erroff=E_GLOBAL_COULD_BE_STATIC2 \
777c478bd9Sstevel@tonic-gate	-erroff=E_CONSTANT_CONDITION \
787c478bd9Sstevel@tonic-gate	-erroff=E_EXPR_NULL_EFFECT \
7916b7b96cSMilan Jurik	-erroff=E_STMT_NOT_REACHED \
807c478bd9Sstevel@tonic-gate	-errtags=yes
817c478bd9Sstevel@tonic-gate
82*7014882cSRichard LoweCERRWARN += -_gcc=-Wno-parentheses
83*7014882cSRichard LoweCERRWARN += -_gcc=-Wno-uninitialized
84*7014882cSRichard LoweCERRWARN += -_gcc=-Wno-unused-function
85*7014882cSRichard LoweCERRWARN += -_gcc=-Wno-unused-variable
86*7014882cSRichard Lowe
877c478bd9Sstevel@tonic-gateROOTLIBSSH=	$(ROOTLIB)/ssh
887c478bd9Sstevel@tonic-gateROOTLIBSSHPROG=	$(PROG:%=$(ROOTLIBSSH)/%)
897c478bd9Sstevel@tonic-gate
907c478bd9Sstevel@tonic-gatePOFILE= _messages.po
917c478bd9Sstevel@tonic-gate
927c478bd9Sstevel@tonic-gate$(ROOTLIBSSH)/%: %
937c478bd9Sstevel@tonic-gate	$(INS.file)
94