xref: /titanic_41/usr/src/cmd/ssh/Makefile.ssh-common (revision af33352a19f03e8fe054fe9b44b19c20aeed0da6)
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# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
22# Use is subject to license terms.
23#
24# Common definitions for all of usr/src/cmd/ssh subdirs
25#
26
27include $(SRC)/lib/openssl/Makefile.openssl
28
29TEXT_DOMAIN=SUNW_OST_OSCMD
30
31CFLAGS += $(CCVERBOSE)
32LDFLAGS += $(MAPFILE.NGB:%=-M%)
33
34SSH_VERSION=\"Sun_SSH_1.3\"
35
36C99MODE= $(C99_ENABLE)
37
38CPPFLAGS = -DSSH_VERSION=$(SSH_VERSION) \
39	-I../include -I../../include \
40	-D_FILE_OFFSET_BITS=64 \
41	-erroff=E_STATEMENT_NOT_REACHED \
42	$(CPPFLAGS.master)
43
44SSH_COMMON_LDLIBS = \
45	-L../libssh/$(MACH) -lssh \
46	-L../libopenbsd-compat/$(MACH) -lopenbsd-compat
47
48$(PROG): $(MAPFILE.NGB)
49
50#
51# Some the lint -erroff flags listed below are because of deficiencies in
52# lint not because we are hiding real errors or to avoid massive resync-
53# hindering changes that will not be returned to OpenSSH.
54#
55# OpenSSH has several instances of "do {...} while (0);" - a common
56# idiom in C macros, but it elicits E_CONSTANT_CONDITION from lint.
57#
58# The MD5 macros in <openssl/md5.h> trigger E_EXPR_NULL_EFFECT.
59#
60# Lots of function return values are ignored in OpenSSH.
61#
62# Lots of globals could be static, sometimes due to portable code paths
63# which are dead on Solaris.
64#
65LINTFLAGS += \
66	-erroff=E_FUNC_ARG_UNUSED \
67	-erroff=E_NAME_USED_NOT_DEF2 \
68	-erroff=E_FUNC_DECL_VAR_ARG2 \
69	-erroff=E_INCONS_VAL_TYPE_DECL2 \
70	-erroff=E_INCONS_ARG_DECL2 \
71	-erroff=E_STATIC_UNUSED \
72	-erroff=E_STATEMENT_NOT_REACHED \
73	-erroff=E_FUNC_RET_ALWAYS_IGNOR2 \
74	-erroff=E_FUNC_RET_MAYBE_IGNORED2 \
75	-erroff=E_GLOBAL_COULD_BE_STATIC2 \
76	-erroff=E_CONSTANT_CONDITION \
77	-erroff=E_EXPR_NULL_EFFECT \
78	-errtags=yes
79
80ROOTLIBSSH=	$(ROOTLIB)/ssh
81ROOTLIBSSHPROG=	$(PROG:%=$(ROOTLIBSSH)/%)
82
83POFILE= _messages.po
84
85$(ROOTLIBSSH)/%: %
86	$(INS.file)
87