xref: /titanic_51/usr/src/lib/libsmedia/library/Makefile.com (revision 1e49577a7fcde812700ded04431b49d67cc57d6d)
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 2006 Sun Microsystems, Inc.  All rights reserved.
23# Use is subject to license terms.
24#
25# ident	"%Z%%M%	%I%	%E% SMI"
26#
27
28LIBRARY= libsmedia.a
29VERS=.1
30
31OBJECTS=	smed_clnt.o smed_xdr.o l_generic.o l_misc.o
32
33DERIVED_FILES = smed.h smed_clnt.c smed_xdr.c
34
35# include library definitions
36include ../../../Makefile.lib
37
38SRCDIR =	../common
39
40# We can't lint the rpcgen-generated files.
41# (Well, we could, but we couldn't fix them.)
42lintcheck := SRCS = ../common/l_generic.c ../common/l_misc.c
43
44LIBS = $(DYNLIB) $(LINTLIB)
45
46# definitions for lint
47
48LINTSRC=        $(LINTLIB:%.ln=%)
49$(LINTLIB):= SRCS = ../common/$(LINTSRC)
50
51CLEANFILES +=	$(DERIVED_FILES:%=../common/%)
52
53CPPFLAGS += -D_REENTRANT -I$(SRC)/cmd/smserverd/
54CFLAGS +=	$(CCVERBOSE)
55CFLAGS64 +=	$(CCVERBOSE)
56
57LDLIBS +=	-lnsl -lc
58
59.KEEP_STATE:
60
61all: $(LIBS)
62
63lint:	lintcheck
64
65# include library targets
66include ../../../Makefile.targ
67
68objs/%.o pics/%.o: ../common/%.c
69	$(COMPILE.c) -o $@ $<
70	$(POST_PROCESS_O)
71
72# install rule for lint library target
73
74$(ROOTLINTDIR64)/%: ../common/%
75	$(INS.file)
76
77$(ROOTLINTDIR)/%: ../common/%
78	$(INS.file)
79
80#
81# Derived files
82#
83
84../common/smed.h:	$(SRC)/cmd/smserverd/smed.x
85	$(RPCGEN) -C -h $(SRC)/cmd/smserverd/smed.x | \
86	$(SED) -e 's!$(SRC)/cmd/smserverd/smed.h!smed.h!' > $@
87
88../common/smed_clnt.c: $(SRC)/cmd/smserverd/smed.x ../common/smed.h
89	$(RPCGEN) -l $(SRC)/cmd/smserverd/smed.x | \
90	$(SED) -e 's!$(SRC)/cmd/smserverd/smed.h!smed.h!' > $@
91
92../common/smed_xdr.c: $(SRC)/cmd/smserverd/smed.x ../common/smed.h
93	$(RPCGEN) -c $(SRC)/cmd/smserverd/smed.x | \
94	$(SED) -e 's!$(SRC)/cmd/smserverd/smed.h!smed.h!' > $@
95
96