Makefile revision 4604:5989fb2cb1d5
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 2007 Sun Microsystems, Inc.  All rights reserved.
23# Use is subject to license terms.
24#
25#pragma ident	"%Z%%M%	%I%	%E% SMI"
26
27#######################################################
28#
29# Makefile for madman_api_test
30#
31#######################################################
32
33#
34# Makefile.vars
35#
36
37include ../../../Makefile.vars
38
39
40#
41# other variables
42#
43
44TARGET1=	$(BIN)/madman_api_test
45TARGET2=	$(BIN)/asn1_test
46TARGET3=	$(BIN)/error_test
47TARGET4=	$(BIN)/trap_test
48TARGET5=	$(BIN)/madman_trap_test
49TARGET6=	$(BIN)/madman_api_test_2
50
51
52.KEEP_STATE:
53
54SOURCES1.c= madman_api_test.c
55
56SOURCES2.c= asn1_test.c
57
58SOURCES3.c= error_test.c
59
60SOURCES4.c= trap_test.c
61
62SOURCES5.c= madman_trap_test.c
63
64SOURCES6.c= madman_api_test_2.c
65
66SOURCES.h=\
67	../snmp_msg.h\
68	../impl.h\
69	../error.h\
70	../trace.h\
71	../asn1.h\
72	../signals.h\
73	../snmp.h\
74	../pdu.h\
75	../request.h\
76	../snmp_api.h\
77	../madman_api.h
78
79OBJECTS1= $(SOURCES1.c:%.c=$(BIN)/%.o)
80OBJECTS2= $(SOURCES2.c:%.c=$(BIN)/%.o)
81OBJECTS3= $(SOURCES3.c:%.c=$(BIN)/%.o)
82OBJECTS4= $(SOURCES4.c:%.c=$(BIN)/%.o)
83OBJECTS5= $(SOURCES5.c:%.c=$(BIN)/%.o)
84OBJECTS6= $(SOURCES6.c:%.c=$(BIN)/%.o)
85
86OBJECTS= $(OBJECTS1) $(OBJECTS2) $(OBJECTS3) $(OBJECTS4) \
87	 $(OBJECTS5) $(OBJECTS6)
88
89MYLIBS= ../$(MACH)/libssasnmp.a
90
91LIBS=	-lsocket -lnsl -lelf -lgen 
92
93CPPFLAGS += -I. -I.. -I${BIN}
94
95CFLAGS += -c
96
97LDFLAGS += $(LDLIBS)
98
99LINT=	lint
100
101PURIFY_HOME= /usr/soft/purify3.0
102
103PURIFY= $(PURIFY_HOME)/purify
104
105
106#######################################################
107
108#
109# all
110#
111
112all: $(SOURCES.h) $(TARGET1) $(TARGET2) $(TARGET3) $(TARGET4) $(TARGET5) $(TARGET6)
113
114$(TARGET1): $(BIN) $(OBJECTS1) $(MYLIBS)
115	@echo -------------- $@ linkink begins --------------
116	$(CC) -o $(TARGET1) $(LDFLAGS) $(OBJECTS1) $(MYLIBS) $(LIBS)
117	@echo -------------- $@ linkink ended ---------------
118
119$(TARGET2): $(BIN) $(OBJECTS2) $(MYLIBS)
120	@echo -------------- $@ linkink begins --------------
121	$(CC) -o $(TARGET2) $(LDFLAGS) $(OBJECTS2) $(MYLIBS) $(LIBS)
122	@echo -------------- $@ linkink ended ---------------
123
124$(TARGET3): $(BIN) $(OBJECTS3) $(MYLIBS)
125	@echo -------------- $@ linkink begins --------------
126	$(CC) -o $(TARGET3) $(LDFLAGS) $(OBJECTS3) $(MYLIBS) $(LIBS)
127	@echo -------------- $@ linkink ended ---------------
128
129$(TARGET4): $(BIN) $(OBJECTS4) $(MYLIBS)
130	@echo -------------- $@ linkink begins --------------
131	$(CC) -o $(TARGET4) $(LDFLAGS) $(OBJECTS4) $(MYLIBS) $(LIBS)
132	@echo -------------- $@ linkink ended ---------------
133
134$(TARGET5): $(BIN) $(OBJECTS5) $(MYLIBS)
135	@echo -------------- $@ linkink begins --------------
136	$(CC) -o $(TARGET5) $(LDFLAGS) $(OBJECTS5) $(MYLIBS) $(LIBS)
137	@echo -------------- $@ linkink ended ---------------
138
139$(TARGET6): $(BIN) $(OBJECTS6) $(MYLIBS)
140	@echo -------------- $@ linkink begins --------------
141	$(CC) -o $(TARGET6) $(LDFLAGS) $(OBJECTS6) $(MYLIBS) $(LIBS)
142	@echo -------------- $@ linkink ended ---------------
143
144$(BIN)/%.o: %.c
145	@echo -------------- $@ compile begins --------------
146	$(CC) $(CFLAGS) $(CPPFLAGS) $(DEFINES) $*.c -o $@
147	@echo -------------- $@ compile ended ---------------
148
149
150#
151# lint
152#
153
154lint:
155	@echo -------------- $@ begins ----------------------
156	$(LINT) $(LDFLAGS) $(CPPFLAGS) $(DEFINES) $(SOURCES.c) $(MYLIBS) $(LIBS)
157	@echo -------------- $@ ended -----------------------
158
159
160#
161# purify
162#
163
164purify:
165	@echo -------------- $@ begins ----------------------
166	$(PURIFY) $(CC) -o $(TARGET) $(LDFLAGS) $(OBJECTS) $(MYLIBS) $(LIBS)
167	@echo -------------- $@ ended -----------------------
168
169
170#
171# directories
172#
173
174$(BIN):
175	$(TEST) -d $@ || mkdir $@
176
177
178#
179# clean
180#
181
182clean:
183	rm -f $(OBJECTS)
184
185clobber: clean
186