xref: /titanic_50/usr/src/lib/libsmedia/library/Makefile.com (revision bdfc6d18da790deeec2e0eb09c625902defe2498)
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, Version 1.0 only
6# (the "License").  You may not use this file except in compliance
7# with the License.
8#
9# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10# or http://www.opensolaris.org/os/licensing.
11# See the License for the specific language governing permissions
12# and limitations under the License.
13#
14# When distributing Covered Code, include this CDDL HEADER in each
15# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16# If applicable, add the following below this CDDL HEADER, with the
17# fields enclosed by brackets "[]" replaced with your own identifying
18# information: Portions Copyright [yyyy] [name of copyright owner]
19#
20# CDDL HEADER END
21#
22#
23# Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
24# Use is subject to license terms.
25#
26# ident	"%Z%%M%	%I%	%E% SMI"
27#
28
29LIBRARY= libsmedia.a
30VERS=.1
31
32OBJECTS=	smed_clnt.o smed_xdr.o l_generic.o l_misc.o
33
34DERIVED_FILES = smed.h smed_clnt.c smed_xdr.c
35
36# include library definitions
37include ../../../Makefile.lib
38
39MAPFILE=	$(MAPDIR)/mapfile
40SRCS=		$(OBJECTS:%.o=../common/%.c)
41# We can't lint the rpcgen-generated files.
42# (Well, we could, but we couldn't fix them.)
43lintcheck := SRCS = ../common/l_generic.c ../common/l_misc.c
44
45LIBS = $(DYNLIB) $(LINTLIB)
46
47# definitions for lint
48
49LINTSRC=        $(LINTLIB:%.ln=%)
50$(LINTLIB):= SRCS = ../common/$(LINTSRC)
51
52CLEANFILES +=	$(DERIVED_FILES:%=../common/%)
53
54CPPFLAGS += -D_REENTRANT -I$(SRC)/cmd/smserverd/
55CFLAGS +=	$(CCVERBOSE)
56CFLAGS64 +=	$(CCVERBOSE)
57DYNFLAGS +=	-M $(MAPFILE)
58
59LDLIBS +=	-lnsl -lc
60
61.KEEP_STATE:
62
63all: $(LIBS)
64
65lint:	lintcheck
66
67$(DYNLIB):	$(MAPFILE)
68
69$(MAPFILE):
70	@cd $(MAPDIR); $(MAKE) mapfile
71
72# include library targets
73include ../../../Makefile.targ
74
75objs/%.o pics/%.o: ../common/%.c
76	$(COMPILE.c) -o $@ $<
77	$(POST_PROCESS_O)
78
79# install rule for lint library target
80
81$(ROOTLINTDIR64)/%: ../common/%
82	$(INS.file)
83
84$(ROOTLINTDIR)/%: ../common/%
85	$(INS.file)
86
87#
88# Derived files
89#
90
91../common/smed.h:	$(SRC)/cmd/smserverd/smed.x
92	$(RPCGEN) -C -h $(SRC)/cmd/smserverd/smed.x | \
93	$(SED) -e 's!$(SRC)/cmd/smserverd/smed.h!smed.h!' > $@
94
95../common/smed_clnt.c: $(SRC)/cmd/smserverd/smed.x ../common/smed.h
96	$(RPCGEN) -l $(SRC)/cmd/smserverd/smed.x | \
97	$(SED) -e 's!$(SRC)/cmd/smserverd/smed.h!smed.h!' > $@
98
99../common/smed_xdr.c: $(SRC)/cmd/smserverd/smed.x ../common/smed.h
100	$(RPCGEN) -c $(SRC)/cmd/smserverd/smed.x | \
101	$(SED) -e 's!$(SRC)/cmd/smserverd/smed.h!smed.h!' > $@
102
103