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