Makefile revision 24fe0b3bf671e123467ce1df0b67cadd3614c8e4
0N/A#
0N/A# CDDL HEADER START
0N/A#
0N/A# The contents of this file are subject to the terms of the
911N/A# Common Development and Distribution License (the "License").
810N/A# You may not use this file except in compliance with the License.
0N/A#
0N/A# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
0N/A# or http://www.opensolaris.org/os/licensing.
0N/A# See the License for the specific language governing permissions
0N/A# and limitations under the License.
0N/A#
0N/A# When distributing Covered Code, include this CDDL HEADER in each
0N/A# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
0N/A# If applicable, add the following below this CDDL HEADER, with the
0N/A# fields enclosed by brackets "[]" replaced with your own identifying
0N/A# information: Portions Copyright [yyyy] [name of copyright owner]
0N/A#
0N/A# CDDL HEADER END
0N/A#
0N/A#
0N/A# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
0N/A# Use is subject to license terms.
0N/A#
0N/A
0N/Ainclude ../../Makefile.vars
0N/A
0N/AMANIFEST = snmpdx.xml
0N/ASVCMETHOD = svc-snmpdx
0N/A
0N/Ainclude $(SRC)/cmd/Makefile.cmd
0N/A
0N/A#
0N/A# In order to conform with the Solaris 2.6 way of packaging things,
156N/A# we now need to put any deliverable that is specified in the
493N/A# prototype file into a common "proto" area, so that their
0N/A# packaging scheme knows where to obtain the input binaries.
0N/A#
818N/A
0N/AAGENT = snmpdx
911N/ABINPROG = $(AGENT)
911N/APROG=$(BINPROG)
911N/A
911N/AOPTBIN = $(ROOT)/usr/lib/snmp
0N/AOPTPROG = $(PROG:%=$(OPTBIN)/%)
493N/A
493N/A$(OPTPROG):= FILEMODE = 0755
156N/A
0N/A$(OPTBIN)/%: $(OPTBIN) %
0N/A $(INS.file)
156N/A
156N/AMYCONF = $(CONFIG_FILES)
0N/ACONFLOC = $(ROOT)/etc/snmp/conf
0N/ACONFRULE = $(MYCONF:%=$(CONFLOC)/%)
818N/A
818N/A$(CONFLOC)/%: $(CONFLOC) %
779N/A $(INS.file)
364N/A
156N/A$(OPTBIN) $(CONFLOC):
156N/A $(INS.dir)
0N/A
591N/ASTUB.c = mib_handler.c $(AGENT)_tree.c $(AGENT)_appl.c $(AGENT)_trap.c
591N/ASTUB.h = $(AGENT)_stub.h
591N/A
591N/ASOURCES.c=\
591N/A agent.c\
591N/A subtree.c\
591N/A session.c\
0N/A dispatcher.c\
156N/A res.c\
493N/A sh_table.c\
493N/A $(STUB.c)
156N/A
493N/ASOURCES.h=\
493N/A ../snmplib/impl.h\
837N/A ../snmplib/error.h\
837N/A ../snmplib/trace.h\
846N/A ../snmplib/asn1.h\
493N/A ../snmplib/signals.h\
493N/A ../snmplib/snmp.h\
156N/A ../snmplib/pdu.h\
493N/A ../snmplib/request.h\
493N/A snmprelay_msg.h\
493N/A agent.h\
364N/A subtree.h\
0N/A session.h\
493N/A config.h\
493N/A dispatcher.h\
156N/A res.h\
493N/A $(STUB.h)\
493N/A ../snmplib/trap.h\
0N/A ../agent/access.h\
339N/A ../agent/agent_msg.h\
0N/A sh_table.h\
0N/A name.h
339N/A
339N/A#
0N/A# We need the config files to build the sacom directory,
837N/A# so pull them out of SCCS.
837N/A#
838N/A
837N/ACONFIG_FILES =\
837N/A mibiisa.rsrc-\
591N/A snmpdx.acl\
591N/A snmpdx.reg\
779N/A snmpdx.rsrc\
838N/A enterprises.oid
591N/A
493N/AOBJECTS= $(SOURCES.c:%.c=$(BIN)/%.o)
493N/A
0N/AEXT = 1
0N/AMYLIBS= ../agent/$(MACH)/libssagent.so.$(EXT) ../snmplib/$(MACH)/libssasnmp.so.$(EXT)
0N/AMYLINKLIBS += -L../agent/$(MACH) -lssagent -L../snmplib -lssasnmp
0N/A
591N/ALIBS= -lsocket -lnsl -ll
0N/A
339N/A# snmpdx has a name clash with main() and libl.so.1. However, snmpdx must
339N/A# still export a number of "yy*" (libl) interfaces, and interfaces for
591N/A# libssagent.so.1. Reduce all other symbols to local scope.
493N/AMAPFILES += $(MAPFILE.INT) $(MAPFILE.LEX) $(MAPFILE.NGB)
837N/AMAPOPTS = $(MAPFILES:%=-M%)
837N/A
837N/ACPPFLAGS += -I. -I../agent -I../snmplib -I../../include/netmgt -I${BIN}
837N/ACFLAGS += -c -D$(TARG_SYS)
837N/ALDFLAGS += $(MAPOPTS) $(LDLIBS)
848N/A
779N/ALINT=lint
156N/A
156N/ASNMP_ROOT= ..
810N/APARSER_HOME= $(SNMP_ROOT)/parser
591N/AMIB_HOME= $(SNMP_ROOT)/mib
591N/APURIFY_HOME= /usr/soft/purify3.0
591N/A
591N/A
591N/AMIBS= $(MIB_HOME)/mib_core.txt $(MIB_HOME)/snmpdx.mib
848N/APARSER= $(PARSER_HOME)/$(BIN)/mibcodegen
591N/A
591N/A.KEEP_STATE:
591N/A
591N/A#######################################################
591N/A
0N/A#
0N/A# all
#
ROOTMANIFESTDIR = $(ROOTSVCAPPLICATIONMANAGEMENT)
$(CONFRULE) := FILEMODE = 0644
$(CONFLOC)/snmpdx.acl := FILEMODE = 0600
CLOBBERFILES += y.tab.c $(BINPROG)
all: $(SOURCES.h) $(BINPROG) $(CONFIG_FILES)
install: all $(OPTPROG) $(CONFRULE) $(ROOTMANIFEST) $(ROOTSVCMETHOD)
check: $(CHKMANIFEST)
$(BINPROG): $(BIN) $(OBJECTS) $(BIN)/config.o $(MYLIBS) $(MAPFILES)
$(CC) -o $(BINPROG) $(LDFLAGS) $(OBJECTS) $(BIN)/config.o \
$(MYLINKLIBS) $(LIBS)
$(POST_PROCESS)
$(BIN)/%.o: %.c
$(CC) $(CFLAGS) $(CPPFLAGS) $(DEFINES) $*.c -o $@
${BIN}/config.c: config.y
$(YACC.y) config.y
$(CAT) name.h y.tab.c > ${BIN}/config.c
${BIN}/config.lex.c: config.l
$(LEX.l) config.l > ${BIN}/config.lex.c
$(BIN)/config.o: ${BIN}/config.c ${BIN}/config.lex.c
$(CC) $(CFLAGS) $(CPPFLAGS) $(DEFINES) ${BIN}/config.c -o $(BIN)/config.o
#
# parse
#
parse: $(MIBS)
$(PARSER) -b $(AGENT) -f $(MIBS)
#
# lint
#
lint:
$(LINT) $(LDFLAGS) $(CPPFLAGS) $(DEFINES) $(SOURCES.c) $(MYLINKLIBS) $(LIBS)
#
# purify
#
purify:
$(PURIFY) $(CC) -o $(BINPROG) $(LDFLAGS) $(OBJECTS) $(MYLINKLIBS) $(LIBS)
#
# directories
#
$(BIN):
@$(TEST) -d $@ || mkdir $@
#
# clean
#
gen:
$(RM) $(AGENT)_stub.h
$(RM) $(AGENT)_stub.c
$(RM) $(AGENT)_appl.c
$(RM) $(AGENT)_tree.c
$(RM) $(AGENT)_trap.c
clean:
$(RM) $(OBJECTS)
$(RM) $(BIN)/config.lex.c $(BIN)/config.c $(BIN)/config.o
include $(SRC)/cmd/Makefile.targ