xref: /titanic_50/usr/src/cmd/vgrind/Makefile (revision 275c9da86e89f8abf71135cf63d9fc23671b2e60)
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# ident	"%Z%%M%	%I%	%E% SMI"
24#
25# Copyright 1990-2002 Sun Microsystems, Inc.  All rights reserved.
26# Use is subject to license terms.
27#
28# cmd/vgrind/Makefile
29
30#
31# These are the objects associated with the overall vgrind command.
32#
33VFONTEDPR=	vfontedpr
34RETEST= 	retest
35MACROS=		tmac.vgrind
36LANGDEFS=	vgrindefs
37KSHPROG=	vgrind
38
39#
40# These macros captures objects that ultimately will be installed in
41# (respectively) /usr/bin, /usr/lib, and /usr/share/lib.
42#
43# Note also that retest is used strictly as a test program and is never
44# installed.  We omit it here, so that the NSE doesn't spend cycles
45# on it when acquiring and reconciling.
46#
47PROG= 		$(KSHPROG)
48LIBPROG= 	$(VFONTEDPR) $(LANGDEFS)
49TMACPROG=	$(MACROS)
50
51VFONTEDPROBJS=	vfontedpr.o vgrindefs.o regexp.o
52RETESTOBJS=	retest.o regexp.o
53
54RETESTSRC=	$(RETESTOBJS:%.o=%.c)
55
56OBJS= $(VFONTEDPROBJS) $(RETESTOBJS)
57SRCS= $(OBJS:%.o=%.c)
58
59#
60# We can get away simply with omitting TMACPROGS to protect
61# tmac.vgrind, since it's the only entry in that macro.
62#
63CLOBBERFILES=	$(LIBPROG) $(RETEST)
64
65include ../Makefile.cmd
66
67#
68# Message catalog
69#
70POFILES= $(OBJS:%.o=%.po)
71POFILE= vgrind.po
72POFILE_KSH= vgrind_ksh.po
73
74#
75# Abbreviation for future use.
76#
77ROOTTMAC= $(ROOT)/usr/share/lib/tmac
78
79#
80# Override macro definitions from Makefile.cmd.  Necessary because
81# we're building targets for multiple destinations.
82#
83ROOTLIBPROG= $(LIBPROG:%=$(ROOT)/usr/lib/%)
84ROOTTMACPROG= $(TMACPROG:%=$(ROOTTMAC)/%)
85
86#
87# Conditional assignments pertinent to installation.
88#
89$(ROOTLIB)/$(LANGDEFS) 	:= FILEMODE= $(LIBFILEMODE)
90$(ROOTTMACPROG) 	:= FILEMODE= 0644
91
92#
93# The standard set of rules doesn't know about installing into
94# subdirectories of /usr/share/lib, so we have to roll our own.
95#
96$(ROOTTMAC)/%: %
97	$(INS.file)
98
99.KEEP_STATE:
100
101#
102# retest appears here only in source form; see comment above for PROG.
103#
104all:	$(PROG) $(LIBPROG) $(TMACPROG) $(RETESTSRC)
105
106#
107# message catalog
108#
109$(POFILE): $(POFILES) $(POFILE_KSH)
110	rm -f $@
111	cat $(POFILES) $(POFILE_KSH) > $@
112
113$(VFONTEDPR): $(VFONTEDPROBJS)
114	$(CC) -o $@ $(VFONTEDPROBJS) $(LDFLAGS) $(LDLIBS)
115	$(POST_PROCESS)
116
117$(LANGDEFS):	$(LANGDEFS).src
118	$(CP) $? $@
119
120$(RETEST): $(RETESTOBJS)
121	$(CC) -o $@ $(RETESTOBJS) $(LDFLAGS) $(LDLIBS)
122	$(POST_PROCESS)
123
124#
125# XXX:	There should be a .ksh rule in default.mk.  Until there is, we
126# do it by hand.
127#
128$(KSHPROG): $(KSHPROG).ksh
129	$(RM) $@
130	sed -e "s/TEXT_DOMAIN/${TEXT_DOMAIN}/g" $(KSHPROG).ksh > $@
131	chmod +x $@
132
133
134
135#
136# We add all as a dependent to make sure that the install pattern
137# matching rules see everything they should.  (This is a safety net.)
138#
139# XXX:	ROOTTMAC shouldn't appear as a dependent; it's here as a
140# 	bandaid(TM) until /usr/lib/tmac becomes a symlink to
141#	/usr/share/lib/tmac.
142#
143install: all $(ROOTTMAC) $(ROOTPROG) $(ROOTLIBPROG) $(ROOTTMACPROG)
144
145# XXX: see above.
146$(ROOTTMAC):
147	$(INS.dir)
148
149clean:
150	$(RM) $(OBJS)
151
152#
153# Don't worry about linting retest.
154#
155lint:=	SRCS = $(VFONTEDPROBJS:%.o=%.c)
156lint: lint_SRCS
157
158include ../Makefile.targ
159