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