Makefile revision 7c478bd95313f5f23a4c958a745db2134aa03244
145N/A#
145N/A# CDDL HEADER START
145N/A#
145N/A# The contents of this file are subject to the terms of the
145N/A# Common Development and Distribution License, Version 1.0 only
145N/A# (the "License"). You may not use this file except in compliance
145N/A# with the License.
145N/A#
145N/A# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
145N/A# or http://www.opensolaris.org/os/licensing.
145N/A# See the License for the specific language governing permissions
145N/A# and limitations under the License.
145N/A#
145N/A# When distributing Covered Code, include this CDDL HEADER in each
145N/A# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
145N/A# If applicable, add the following below this CDDL HEADER, with the
145N/A# fields enclosed by brackets "[]" replaced with your own identifying
145N/A# information: Portions Copyright [yyyy] [name of copyright owner]
145N/A#
145N/A# CDDL HEADER END
5630N/A#
145N/A# Copyright 2005 Sun Microsystems, Inc. All rights reserved.
145N/A# Use is subject to license terms.
145N/A#
187N/A#ident "%Z%%M% %I% %E% SMI"
3996N/A#
187N/A# snmp/snmprelayd/Makefile
187N/A#
187N/A
145N/Ainclude ../../Makefile.vars
187N/A
187N/A# OPTIONAL_INCLUDE_FILE:sh = /bin/sh ../../misc.sh ../../../cmd/Makefile.cmd
187N/A# include $(OPTIONAL_INCLUDE_FILE)
145N/A
1273N/Ainclude $(SRC)/cmd/Makefile.cmd
1273N/A
1273N/A#
5630N/A# In order to conform with the Solaris 2.6 way of packaging things,
5630N/A# we now need to put any deliverable that is specified in the
5630N/A# prototype file into a common "proto" area, so that their
5630N/A# packaging scheme knows where to obtain the input binaries.
5630N/A#
187N/A
7034N/AAGENT = snmpdx
197N/ABINPROG = $(AGENT)
197N/APROG=$(BINPROG)
197N/A
197N/AOPTBIN = $(ROOT)/usr/lib/snmp
187N/AOPTPROG = $(PROG:%=$(OPTBIN)/%)
5630N/A
187N/A$(OPTPROG):= FILEMODE = 0755
5630N/A
5630N/A$(OPTBIN)/%: $(OPTBIN) %
5630N/A $(INS.file)
5630N/A
5630N/AMYCONF = $(CONFIG_FILES)
7034N/ACONFLOC = $(ROOT)/etc/snmp/conf
5630N/ACONFRULE = $(MYCONF:%=$(CONFLOC)/%)
5630N/A
5630N/A$(CONFLOC)/%: $(CONFLOC) %
145N/A $(INS.file)
4409N/A
4409N/A$(OPTBIN) $(CONFLOC):
4409N/A $(INS.dir)
4409N/A
4409N/ASTUB.c = mib_handler.c $(AGENT)_tree.c $(AGENT)_appl.c $(AGENT)_trap.c
4409N/ASTUB.h = $(AGENT)_stub.h
192N/A
192N/ASOURCES.c=\
192N/A agent.c\
145N/A subtree.c\
145N/A session.c\
145N/A dispatcher.c\
187N/A res.c\
4409N/A sh_table.c\
3468N/A $(STUB.c)
187N/A
5630N/ASOURCES.h=\
5630N/A ../snmplib/impl.h\
5630N/A ../snmplib/error.h\
5630N/A ../snmplib/trace.h\
187N/A ../snmplib/asn1.h\
1900N/A ../snmplib/signals.h\
191N/A ../snmplib/snmp.h\
145N/A ../snmplib/pdu.h\
5630N/A ../snmplib/request.h\
5630N/A snmprelay_msg.h\
5630N/A agent.h\
5630N/A subtree.h\
5630N/A session.h\
187N/A config.h\
2541N/A dispatcher.h\
187N/A res.h\
187N/A $(STUB.h)\
187N/A ../snmplib/trap.h\
187N/A ../agent/access.h\
187N/A ../agent/agent_msg.h\
1900N/A sh_table.h\
1900N/A name.h
1900N/A
187N/A#
187N/A# We need the config files to build the sacom directory,
187N/A# so pull them out of SCCS.
145N/A#
197N/A
197N/ACONFIG_FILES =\
197N/A mibiisa.rsrc-\
145N/A snmpdx.acl\
197N/A snmpdx.reg\
snmpdx.rsrc\
enterprises.oid
OBJECTS= $(SOURCES.c:%.c=$(BIN)/%.o)
EXT = 1
MYLIBS= ../agent/$(MACH)/libssagent.so.$(EXT) ../snmplib/$(MACH)/libssasnmp.so.$(EXT)
MYLINKLIBS += -L../agent/$(MACH) -lssagent -L../snmplib -lssasnmp
LIBS= -lsocket -lnsl -ll
CPPFLAGS += -I. -I../agent -I../snmplib -I../../include/netmgt -I${BIN}
CFLAGS += -c -D$(TARG_SYS)
LDFLAGS += $(LDLIBS)
LINT=lint
SNMP_ROOT= ..
PARSER_HOME= $(SNMP_ROOT)/parser
MIB_HOME= $(SNMP_ROOT)/mib
PURIFY_HOME= /usr/soft/purify3.0
MIBS= $(MIB_HOME)/mib_core.txt $(MIB_HOME)/snmpdx.mib
PARSER= $(PARSER_HOME)/$(BIN)/mibcodegen
.KEEP_STATE:
#######################################################
#
# all
#
FILEMODE = 0644
$(CONFLOC)/snmpdx.acl := FILEMODE = 0600
GROUP = sys
CLOBBERFILES= y.tab.c
all: $(SOURCES.h) $(BINPROG) $(CONFIG_FILES)
install: all $(OPTPROG) $(CONFRULE)
$(BINPROG): $(BIN) $(OBJECTS) $(BIN)/config.o $(MYLIBS)
$(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) $(BINPROG)
$(RM) $(BIN)/config.lex.c $(BIN)/config.c
realclobber: clean
sccs clean
# OPTIONAL_INCLUDE_FILE:sh = /bin/sh ../../misc.sh ../../../cmd/Makefile.targ
# include $(OPTIONAL_INCLUDE_FILE)
include $(SRC)/cmd/Makefile.targ