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 29PROG = dhcpagent 30ROOTFS_PROG = $(PROG) 31LOCOBJS = adopt.o agent.o arp_check.o async.o bound.o class_id.o defaults.o \ 32 dlpi_io.o dlprims.o inform.o init_reboot.o \ 33 interface.o ipc_action.o packet.o release.o renew.o request.o \ 34 script_handler.o select.o util.o 35COMDIR = $(SRC)/common/net/dhcp 36COMOBJS = ipv4_sum.o udp_sum.o 37INETDIR = $(SRC)/cmd/cmd-inet/common 38 39include ../../../Makefile.cmd 40 41DFLTD = $(ROOTETC)/default 42ETCDFLTPROG = $(PROG:%=$(DFLTD)/%) 43$(ETCDFLTPROG) := FILEMODE = 0444 44$(ETCDFLTPROG) := OWNER = root 45$(ETCDFLTPROG) := GROUP = sys 46 47OBJS = $(COMOBJS) $(LOCOBJS) 48SRCS = $(COMOBJS:%.o=$(COMDIR)/%.c) $(LOCOBJS:%.o=%.c) 49 50POFILES = $(LOCOBJS:%.o=%.po) 51XGETFLAGS += -a -x dhcpagent.xcl 52 53# 54# to compile a debug version, do a `make COPTFLAG="-g -XO0"' 55# 56 57CPPFLAGS += -I$(COMDIR) -I$(INETDIR) 58LDLIBS += -lsocket -lnvpair -lnsl -ldhcpagent -ldhcputil -linetutil -ldevinfo 59 60.KEEP_STATE: 61 62all: $(ROOTFS_PROG) $(PROG).dfl 63 64install: all $(ROOTSBINPROG) $(ETCDFLTPROG) 65 66$(PROG): $(OBJS) 67 $(LINK.c) -o $@ $(OBJS) $(LDLIBS) 68 $(POST_PROCESS) 69 70%.o: $(COMDIR)/%.c 71 $(COMPILE.c) $(OUTPUT_OPTION) $< 72 $(POST_PROCESS_O) 73 74%.o: $(INETDIR)/%.c 75 $(COMPILE.c) $(OUTPUT_OPTION) $< 76 $(POST_PROCESS_O) 77 78$(DFLTD)/%: %.dfl 79 $(INS.rename) 80 81$(POFILE): $(POFILES) 82 $(RM) $@; $(CAT) $(POFILES) > $@; $(RM) $(POFILES) 83 84clean: 85 $(RM) $(OBJS) 86 87lint: lint_SRCS 88 89include ../../../Makefile.targ 90