xref: /titanic_41/usr/src/lib/libwanboot/Makefile.com (revision d58fda4376e4bf67072ce2e69f6f47036f9dbb68)
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, Version 1.0 only
6# (the "License").  You may not use this file except in compliance
7# with the License.
8#
9# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10# or http://www.opensolaris.org/os/licensing.
11# See the License for the specific language governing permissions
12# and limitations under the License.
13#
14# When distributing Covered Code, include this CDDL HEADER in each
15# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16# If applicable, add the following below this CDDL HEADER, with the
17# fields enclosed by brackets "[]" replaced with your own identifying
18# information: Portions Copyright [yyyy] [name of copyright owner]
19#
20# CDDL HEADER END
21#
22#
23# Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
24# Use is subject to license terms.
25#
26# ident	"%Z%%M%	%I%	%E% SMI"
27#
28
29LIBRARY =	libwanboot.a
30VERS =		.1
31
32include $(SRC)/lib/openssl/Makefile.openssl
33
34# List of locally located modules.
35LOC_DIR =	../common
36LOC_OBJS =	socket_inet.o bootinfo_aux.o
37LOC_SRCS =	$(LOC_OBJS:%.o=$(LOC_DIR)/%.c)
38
39# List of common wanboot objects.
40COM_DIR =	../../../common/net/wanboot
41COM_OBJS =	auxutil.o \
42		boot_http.o \
43		bootconf.o \
44		bootconf_errmsg.o \
45		bootinfo.o \
46		bootlog.o \
47		http_errorstr.o \
48		p12access.o \
49		p12auxpars.o \
50		p12auxutl.o \
51		p12err.o \
52		p12misc.o \
53		parseURL.o
54COM_SRCS =	$(COM_OBJS:%.o=$(COM_DIR)/%.c)
55
56# List of common DHCP modules.
57DHCP_DIR =	$(SRC)/common/net/dhcp
58DHCP_OBJS =	dhcpinfo.o
59DHCP_SRCS =	$(DHCP_OBJS:%.o=$(DHCP_DIR)/%.c)
60
61OBJECTS =	$(LOC_OBJS) $(COM_OBJS) $(DHCP_OBJS)
62
63MAPDIR =	../spec/$(TRANSMACH)
64SPECMAPFILE =	$(MAPDIR)/mapfile
65
66include ../../Makefile.lib
67
68LIBS +=		$(LINTLIB)
69LDLIBS +=	-lnvpair -lresolv -lnsl -lsocket -ldevinfo -ldhcputil \
70    		-linetutil -lc  $(OPENSSL_LDFLAGS) -lcrypto -lssl
71DYNFLAGS +=	$(OPENSSL_DYNFLAGS)
72#
73# Note this uses CPPFLAGS.master to prepend because our parent may have
74# an old version of the OpenSSL headers in $ROOT/usr/include/openssl
75CPPFLAGS =	$(OPENSSL_CPPFLAGS) \
76		-I$(SRC)/common/net/wanboot/crypt $(CPPFLAGS.master)
77
78# Must override SRCS from Makefile.lib since sources have
79# multiple source directories.
80SRCS =		$(LOC_SRCS) $(COM_SRCS) $(DHCP_SRCS)
81
82# Must define location of lint library source.
83SRCDIR =	$(LOC_DIR)
84$(LINTLIB) :=	SRCS = $(SRCDIR)/$(LINTSRC)
85
86# OpenSSL requires us to turn this off
87LINTFLAGS +=    -erroff=E_BAD_PTR_CAST_ALIGN
88
89CFLAGS +=	$(CCVERBOSE)
90CPPFLAGS +=	-I$(LOC_DIR) -I$(COM_DIR) -I$(DHCP_DIR)
91
92.KEEP_STATE:
93
94all: $(LIBS)
95
96lint: lintcheck
97
98pics/%.o: $(COM_DIR)/%.c
99	$(COMPILE.c) -o $@ $<
100	$(POST_PROCESS_O)
101
102pics/%.o: $(DHCP_DIR)/%.c
103	$(COMPILE.c) -o $@ $<
104	$(POST_PROCESS_O)
105
106include ../../Makefile.targ
107