10Sstevel@tonic-gate# 20Sstevel@tonic-gate# CDDL HEADER START 30Sstevel@tonic-gate# 40Sstevel@tonic-gate# The contents of this file are subject to the terms of the 5*4604Sstevel# Common Development and Distribution License (the "License"). 6*4604Sstevel# You may not use this file except in compliance with the License. 70Sstevel@tonic-gate# 80Sstevel@tonic-gate# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 90Sstevel@tonic-gate# or http://www.opensolaris.org/os/licensing. 100Sstevel@tonic-gate# See the License for the specific language governing permissions 110Sstevel@tonic-gate# and limitations under the License. 120Sstevel@tonic-gate# 130Sstevel@tonic-gate# When distributing Covered Code, include this CDDL HEADER in each 140Sstevel@tonic-gate# file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15*4604Sstevel# If applicable, add the following below this CDDL HEADER, with the 160Sstevel@tonic-gate# fields enclosed by brackets "[]" replaced with your own identifying 170Sstevel@tonic-gate# information: Portions Copyright [yyyy] [name of copyright owner] 180Sstevel@tonic-gate# 190Sstevel@tonic-gate# CDDL HEADER END 200Sstevel@tonic-gate# 21*4604Sstevel# Copyright 2007 Sun Microsystems, Inc. All rights reserved. 220Sstevel@tonic-gate# Use is subject to license terms. 230Sstevel@tonic-gate# 240Sstevel@tonic-gate# ident "%Z%%M% %I% %E% SMI" 250Sstevel@tonic-gate# 260Sstevel@tonic-gate 270Sstevel@tonic-gate############################################## 280Sstevel@tonic-gate# 290Sstevel@tonic-gate# Makefile for parser 300Sstevel@tonic-gate# 310Sstevel@tonic-gate############################################## 320Sstevel@tonic-gate 330Sstevel@tonic-gate# 340Sstevel@tonic-gate# Makefile.vars 350Sstevel@tonic-gate# 360Sstevel@tonic-gate 370Sstevel@tonic-gateinclude ../../Makefile.vars 380Sstevel@tonic-gate 390Sstevel@tonic-gateinclude $(SRC)/cmd/Makefile.cmd 400Sstevel@tonic-gate 410Sstevel@tonic-gateTARGET= mibcodegen 420Sstevel@tonic-gate 430Sstevel@tonic-gate# 440Sstevel@tonic-gateOPTBIN = $(ROOT)/usr/bin 450Sstevel@tonic-gateOPTPROG = $(PROG:%=$(OPTBIN)/%) 460Sstevel@tonic-gate 470Sstevel@tonic-gate# 480Sstevel@tonic-gate# other variables 490Sstevel@tonic-gate# 500Sstevel@tonic-gate 510Sstevel@tonic-gate.KEEP_STATE: 520Sstevel@tonic-gate 530Sstevel@tonic-gateSOURCES.c=\ 540Sstevel@tonic-gate parse.c\ 550Sstevel@tonic-gate backend.c 560Sstevel@tonic-gate 570Sstevel@tonic-gateSOURCES.h=\ 580Sstevel@tonic-gate ../snmplib/impl.h\ 590Sstevel@tonic-gate ../snmplib/error.h\ 600Sstevel@tonic-gate ../snmplib/asn1.h\ 610Sstevel@tonic-gate parse.h 620Sstevel@tonic-gate 630Sstevel@tonic-gateOBJECTS= $(SOURCES.c:%.c=$(BIN)/%.o) 640Sstevel@tonic-gate 650Sstevel@tonic-gateEXT = 1 660Sstevel@tonic-gateMYLIBS= ../snmplib/$(MACH)/libssasnmp.so.$(EXT) 670Sstevel@tonic-gateMYLINKLIBS += -L../snmplib -lssasnmp 680Sstevel@tonic-gate 690Sstevel@tonic-gateLIBS= -lsocket -lnsl 700Sstevel@tonic-gate 710Sstevel@tonic-gateDEFINES= -D$(TARG_SYS) 720Sstevel@tonic-gate 730Sstevel@tonic-gateCPPFLAGS += -I. -I../snmplib -I../../include/netmgt 740Sstevel@tonic-gate 750Sstevel@tonic-gateCFLAGS += -c 760Sstevel@tonic-gate 770Sstevel@tonic-gateLDFLAGS += $(LDLIBS) 780Sstevel@tonic-gate 790Sstevel@tonic-gateLINT= lint 800Sstevel@tonic-gate 810Sstevel@tonic-gateMIB_HOME= ../mib 820Sstevel@tonic-gate 830Sstevel@tonic-gateMIBS= $(MIB_HOME)/mib_core.txt $(MIB_HOME)/mib_example.txt 840Sstevel@tonic-gate 850Sstevel@tonic-gateLINTFLAGS= -aumx 860Sstevel@tonic-gate 870Sstevel@tonic-gateLINT= lint 880Sstevel@tonic-gate 89*4604SstevelCLOBBERFILES += $(TARGET) 900Sstevel@tonic-gate 910Sstevel@tonic-gate############################################## 920Sstevel@tonic-gate 930Sstevel@tonic-gate# 940Sstevel@tonic-gate# all 950Sstevel@tonic-gate# 960Sstevel@tonic-gate 970Sstevel@tonic-gateall: $(SOURCES.h) $(TARGET) 980Sstevel@tonic-gate 990Sstevel@tonic-gateinstall: all 1000Sstevel@tonic-gate 1010Sstevel@tonic-gate$(TARGET): $(BIN) $(OBJECTS) $(MYLIBS) 1020Sstevel@tonic-gate $(CC) -o $(TARGET) $(LDFLAGS) $(OBJECTS) $(MYLINKLIBS) $(LIBS) 1030Sstevel@tonic-gate 1040Sstevel@tonic-gate$(BIN)/%.o: %.c 1050Sstevel@tonic-gate $(CC) $(CFLAGS) $(CPPFLAGS) $(DEFINES) $*.c -o $@ 1060Sstevel@tonic-gate 1070Sstevel@tonic-gate# 1080Sstevel@tonic-gate# lint 1090Sstevel@tonic-gate# 1100Sstevel@tonic-gate 1110Sstevel@tonic-gatelint: 1120Sstevel@tonic-gate $(LINT) $(CPPFLAGS) $(DEFINES) $(SOURCES.c) 1130Sstevel@tonic-gate 1140Sstevel@tonic-gatelintlib: $(BIN) $(LINTTARGET) 1150Sstevel@tonic-gate 1160Sstevel@tonic-gate$(LINTTARGET) : $(LINTOBJECTS) 1170Sstevel@tonic-gate $(LINT) $(LINTOBJECTS) -o $(LIBNAME) 1180Sstevel@tonic-gate mv llib-l$(LIBNAME).ln $(LINTTARGET) 1190Sstevel@tonic-gate 1200Sstevel@tonic-gate$(BIN)/%.ln: %.c 1210Sstevel@tonic-gate $(LINT) $(CPPFLAGS) $(DEFINES) $*.c -C $(BIN)/$* 1220Sstevel@tonic-gate 1230Sstevel@tonic-gate# 1240Sstevel@tonic-gate# example 1250Sstevel@tonic-gate# 1260Sstevel@tonic-gate 1270Sstevel@tonic-gateexample: 1280Sstevel@tonic-gate $(TARGET) example $(MIBS); 1290Sstevel@tonic-gate 1300Sstevel@tonic-gate 1310Sstevel@tonic-gate# 1320Sstevel@tonic-gate# directories 1330Sstevel@tonic-gate# 134*4604Sstevel 1350Sstevel@tonic-gate$(BIN): 1360Sstevel@tonic-gate @$(TEST) -d $@ || mkdir $@ 1370Sstevel@tonic-gate 1380Sstevel@tonic-gate 1390Sstevel@tonic-gate# 1400Sstevel@tonic-gate# clean 1410Sstevel@tonic-gate# 1420Sstevel@tonic-gate 1430Sstevel@tonic-gateclean: 144*4604Sstevel $(RM) $(OBJECTS) 1450Sstevel@tonic-gate 1460Sstevel@tonic-gateinclude $(SRC)/cmd/Makefile.targ 147