xref: /titanic_41/usr/src/lib/libwanbootutil/Makefile.com (revision f3312ec0e8acbd249df97358fb8c3ca92f4e089c)
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#
22# Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
23# Use is subject to license terms.
24#
25# Copyright (c) 2012 by Delphix. All rights reserved.
26#
27
28LIBRARY	=	libwanbootutil.a
29VERS =		.1
30
31# List of locally located modules.
32LOC_DIR =	../common
33LOC_OBJS =	key_xdr.o \
34		key_util.o \
35		wbio.o
36LOC_SRCS =	$(LOC_OBJS:%.o=$(LOC_DIR)/%.c)
37
38# The crypto modules are located under usr/src/common.
39CRYPTO_DIR =	$(SRC)/common/net/wanboot/crypt
40CRYPTO_OBJS =	hmac_sha1.o \
41		aes.o \
42		des3.o \
43		des.o \
44		cbc.o
45CRYPTO_SRCS =	$(CRYPTO_OBJS:%.o=$(CRYPTO_DIR)/%.c)
46
47# Together the local and crypto modules makeup the entire wad.
48OBJECTS	=	$(LOC_OBJS) $(CRYPTO_OBJS)
49
50include $(SRC)/lib/Makefile.lib
51
52LIBS +=		$(LINTLIB)
53LDLIBS +=	-lc -lnsl -lmd
54
55# Must override SRCS from Makefile.lib since sources have
56# multiple source directories.
57SRCS =		$(LOC_SRCS) $(CRYPTO_SRCS)
58
59# Must define location of lint library source.
60SRCDIR =	$(LOC_DIR)
61$(LINTLIB):=	SRCS = $(SRCDIR)/$(LINTSRC)
62
63# Library includes sources created via rpcgen. And rpcgen unfortunately
64# created unused function variables.
65LINTFLAGS   +=	-erroff=E_FUNC_VAR_UNUSED
66LINTFLAGS64 +=	-erroff=E_FUNC_VAR_UNUSED
67
68CPPFLAGS +=	-I$(CRYPTO_DIR)
69
70CERRWARN +=	-_gcc=-Wno-unused-variable
71CERRWARN +=	-_gcc=-Wno-type-limits
72CERRWARN +=	-_gcc=-Wno-uninitialized
73
74install:	all
75
76all:		$(LIBS)
77
78lint:		lintcheck
79
80
81# Define rule for local modules.
82objs/%.o pics/%.o:	$(LOC_DIR)/%.c
83			$(COMPILE.c) -o $@ $<
84			$(POST_PROCESS_O)
85
86# Define rule for crypto modules.
87objs/%.o pics/%.o:	$(CRYPTO_DIR)/%.c
88			$(COMPILE.c) -o $@ $<
89			$(POST_PROCESS_O)
90
91include $(SRC)/lib/Makefile.targ
92