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 2008 Sun Microsystems, Inc.  All rights reserved.
  23 # Use is subject to license terms.
  24 #
  25 # cmd/cmd-inet/usr.lib/in.dhcpd/Makefile
  26 #
  27 
  28 CMN_DIR = $(SRC)/common/net/dhcp
  29 NSU_DIR = $(ROOTLIBINET)/dhcp/nsu
  30 
  31 PROG    = in.dhcpd
  32 MANIFEST= dhcp-server.xml
  33 
  34 LOCAL_OBJS =    bootp.o dhcp.o dhcptab.o encode.o generic.o hash.o icmp.o \
  35                 interfaces.o logging.o main.o misc.o per_dnet.o relay.o
  36 LOCAL_SRCS =    $(LOCAL_OBJS:%.o=%.c)
  37 
  38 CMN_OBJS =      ipv4_sum.o
  39 CMN_SRCS =      $(CMN_OBJS:%.o=$(CMN_DIR)/%.c)
  40 
  41 SRCS =          $(LOCAL_SRCS) $(CMN_SRCS)
  42 OBJS =          $(LOCAL_OBJS) $(CMN_OBJS)
  43 
  44 include ../../../Makefile.cmd
  45 
  46 ROOTMANIFESTDIR=        $(ROOTSVCNETWORK)
  47 
  48 CPPFLAGS  += -DNDEBUG -DNPROBE -D_REENTRANT -I./ -I$(CMN_DIR)
  49 #
  50 # -erroff=E_BAD_FORMAT_STR2 added to workaround bug 6696366 
  51 #
  52 LINTFLAGS += -u -erroff=E_BAD_FORMAT_STR2
  53 LDFLAGS   += -L$(NSU_DIR) -R/usr/lib/inet/dhcp/nsu $(MAPFILE.NGB:%=-M%)
  54 LDLIBS    += $(NSU_DIR)/rfc2136.so.1 -ldhcpsvc -ldhcputil -linetutil \
  55              -lsocket -lnsl -lmtmalloc -lresolv
  56 lint := LDLIBS = $(LDLIBS.cmd) -ldhcpsvc -ldhcputil -linetutil -lsocket -lnsl
  57 
  58 CERRWARN += -_gcc=-Wno-uninitialized
  59 CERRWARN += -_gcc=-Wno-unused-label
  60 CERRWARN += -_gcc=-Wno-parentheses
  61 
  62 #
  63 # Debugging support; toggle on if needed.
  64 #
  65 #CPPFLAGS += -DDEBUG            # if used, remove -DNDEBUG above
  66 #CPPFLAGS += -DTNF_DEBUG
  67 #COPTFLAG = -g
  68 #COPTFLAG += -xprofile=func
  69 
  70 # for messaging catalog. No messages are present in CMN_DIR sources.
  71 POFILES = $(LOCAL_OBJS:%.o=%.po)
  72 XGETFLAGS += -a -x in.dhcpd.xcl
  73 
  74 .PARALLEL:      $(OBJS)
  75 .WAIT:          $(PROG)
  76 .KEEP_STATE:
  77 
  78 all:            $(PROG)
  79 
  80 $(PROG):        $(OBJS) $(MAPFILE.NGB)
  81                 $(LINK.c) $(OBJS) -o $@ $(LDLIBS)
  82                 $(POST_PROCESS)
  83 
  84 include ../Makefile.lib
  85 
  86 install:        all $(ROOTLIBINETPROG) $(ROOTMANIFEST)
  87 
  88 %.o:            $(CMN_DIR)/%.c
  89                 $(COMPILE.c) $(OUTPUT_OPTION) $<
  90                 $(POST_PROCESS_O)
  91 
  92 $(POFILE):      $(POFILES)
  93                 $(RM)   $@
  94                 $(CAT) $(POFILES) > $@
  95 
  96 check:          $(CHKMANIFEST)
  97 
  98 clean:
  99                 $(RM) $(OBJS)
 100 
 101 lint:           lint_SRCS
 102 
 103 include ../../../Makefile.targ