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 (c) 2012 by Delphix. All rights reserved. 25# 26 27LIBRARY = libwanboot.a 28VERS = .1 29 30# List of locally located modules. 31LOC_DIR = ../common 32LOC_OBJS = socket_inet.o bootinfo_aux.o 33LOC_SRCS = $(LOC_OBJS:%.o=$(LOC_DIR)/%.c) 34 35# List of common wanboot objects. 36COM_DIR = ../../../common/net/wanboot 37COM_OBJS = auxutil.o \ 38 boot_http.o \ 39 bootconf.o \ 40 bootconf_errmsg.o \ 41 bootinfo.o \ 42 bootlog.o \ 43 http_errorstr.o \ 44 p12access.o \ 45 p12auxpars.o \ 46 p12auxutl.o \ 47 p12err.o \ 48 p12misc.o \ 49 parseURL.o 50COM_SRCS = $(COM_OBJS:%.o=$(COM_DIR)/%.c) 51 52# List of common DHCP modules. 53DHCP_DIR = $(SRC)/common/net/dhcp 54DHCP_OBJS = dhcpinfo.o 55DHCP_SRCS = $(DHCP_OBJS:%.o=$(DHCP_DIR)/%.c) 56 57OBJECTS = $(LOC_OBJS) $(COM_OBJS) $(DHCP_OBJS) 58 59include ../../Makefile.lib 60 61LIBS += $(LINTLIB) 62LDLIBS += -lnvpair -lresolv -lnsl -lsocket -ldevinfo -ldhcputil \ 63 -linetutil -lc 64 65# libcrypto and libssl have no lint library, so we can only use it when 66# building 67$(DYNLIB) := LDLIBS += -lcrypto -lssl 68 69CPPFLAGS = -I$(SRC)/common/net/wanboot/crypt $(CPPFLAGS.master) 70CERRWARN += -_gcc=-Wno-switch 71CERRWARN += -_gcc=-Wno-parentheses 72CERRWARN += -_gcc=-Wno-unused-value 73CERRWARN += -_gcc=-Wno-uninitialized 74 75# Must override SRCS from Makefile.lib since sources have 76# multiple source directories. 77SRCS = $(LOC_SRCS) $(COM_SRCS) $(DHCP_SRCS) 78 79# Must define location of lint library source. 80SRCDIR = $(LOC_DIR) 81$(LINTLIB) := SRCS = $(SRCDIR)/$(LINTSRC) 82 83# OpenSSL requires us to turn this off 84LINTFLAGS += -erroff=E_BAD_PTR_CAST_ALIGN 85LINTFLAGS64 += -erroff=E_BAD_PTR_CAST_ALIGN 86 87CFLAGS += $(CCVERBOSE) 88CPPFLAGS += -I$(LOC_DIR) -I$(COM_DIR) -I$(DHCP_DIR) 89 90.KEEP_STATE: 91 92all: $(LIBS) 93 94lint: lintcheck 95 96pics/%.o: $(COM_DIR)/%.c 97 $(COMPILE.c) -o $@ $< 98 $(POST_PROCESS_O) 99 100pics/%.o: $(DHCP_DIR)/%.c 101 $(COMPILE.c) -o $@ $< 102 $(POST_PROCESS_O) 103 104include ../../Makefile.targ 105