xref: /illumos-gate/usr/src/cmd/vgrind/Makefile (revision 58e78d16)
17c478bd9Sstevel@tonic-gate#
27c478bd9Sstevel@tonic-gate# CDDL HEADER START
37c478bd9Sstevel@tonic-gate#
47c478bd9Sstevel@tonic-gate# The contents of this file are subject to the terms of the
599ba4d70SRussell Blaine# Common Development and Distribution License (the "License").
699ba4d70SRussell Blaine# You may not use this file except in compliance with the License.
77c478bd9Sstevel@tonic-gate#
87c478bd9Sstevel@tonic-gate# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
97c478bd9Sstevel@tonic-gate# or http://www.opensolaris.org/os/licensing.
107c478bd9Sstevel@tonic-gate# See the License for the specific language governing permissions
117c478bd9Sstevel@tonic-gate# and limitations under the License.
127c478bd9Sstevel@tonic-gate#
137c478bd9Sstevel@tonic-gate# When distributing Covered Code, include this CDDL HEADER in each
147c478bd9Sstevel@tonic-gate# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
157c478bd9Sstevel@tonic-gate# If applicable, add the following below this CDDL HEADER, with the
167c478bd9Sstevel@tonic-gate# fields enclosed by brackets "[]" replaced with your own identifying
177c478bd9Sstevel@tonic-gate# information: Portions Copyright [yyyy] [name of copyright owner]
187c478bd9Sstevel@tonic-gate#
197c478bd9Sstevel@tonic-gate# CDDL HEADER END
207c478bd9Sstevel@tonic-gate#
217c478bd9Sstevel@tonic-gate#
2299ba4d70SRussell Blaine# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
237c478bd9Sstevel@tonic-gate# Use is subject to license terms.
247c478bd9Sstevel@tonic-gate#
255661bb76SJohn Levon# Copyright (c) 2018, Joyent, Inc.
267c478bd9Sstevel@tonic-gate
277c478bd9Sstevel@tonic-gate#
287c478bd9Sstevel@tonic-gate# These are the objects associated with the overall vgrind command.
297c478bd9Sstevel@tonic-gate#
307c478bd9Sstevel@tonic-gateVFONTEDPR=	vfontedpr
31*58e78d16SToomas SoomeRETEST=		retest
327c478bd9Sstevel@tonic-gateMACROS=		tmac.vgrind
337c478bd9Sstevel@tonic-gateLANGDEFS=	vgrindefs
347c478bd9Sstevel@tonic-gateKSHPROG=	vgrind
357c478bd9Sstevel@tonic-gate
367c478bd9Sstevel@tonic-gate#
377c478bd9Sstevel@tonic-gate# These macros captures objects that ultimately will be installed in
387c478bd9Sstevel@tonic-gate# (respectively) /usr/bin, /usr/lib, and /usr/share/lib.
397c478bd9Sstevel@tonic-gate#
407c478bd9Sstevel@tonic-gate# Note also that retest is used strictly as a test program and is never
417c478bd9Sstevel@tonic-gate# installed.  We omit it here, so that the NSE doesn't spend cycles
427c478bd9Sstevel@tonic-gate# on it when acquiring and reconciling.
437c478bd9Sstevel@tonic-gate#
44*58e78d16SToomas SoomePROG=		$(KSHPROG)
45*58e78d16SToomas SoomeLIBPROG=	$(VFONTEDPR) $(LANGDEFS)
467c478bd9Sstevel@tonic-gateTMACPROG=	$(MACROS)
477c478bd9Sstevel@tonic-gate
487c478bd9Sstevel@tonic-gateVFONTEDPROBJS=	vfontedpr.o vgrindefs.o regexp.o
497c478bd9Sstevel@tonic-gateRETESTOBJS=	retest.o regexp.o
507c478bd9Sstevel@tonic-gate
517c478bd9Sstevel@tonic-gateRETESTSRC=	$(RETESTOBJS:%.o=%.c)
527c478bd9Sstevel@tonic-gate
537c478bd9Sstevel@tonic-gateOBJS= $(VFONTEDPROBJS) $(RETESTOBJS)
547c478bd9Sstevel@tonic-gateSRCS= $(OBJS:%.o=%.c)
557c478bd9Sstevel@tonic-gate
567c478bd9Sstevel@tonic-gate#
577c478bd9Sstevel@tonic-gate# We can get away simply with omitting TMACPROGS to protect
587c478bd9Sstevel@tonic-gate# tmac.vgrind, since it's the only entry in that macro.
597c478bd9Sstevel@tonic-gate#
607c478bd9Sstevel@tonic-gateCLOBBERFILES=	$(LIBPROG) $(RETEST)
617c478bd9Sstevel@tonic-gate
627c478bd9Sstevel@tonic-gateinclude ../Makefile.cmd
637c478bd9Sstevel@tonic-gate
647014882cSRichard LoweCERRWARN += -_gcc=-Wno-implicit-function-declaration
657014882cSRichard LoweCERRWARN += -_gcc=-Wno-parentheses
667014882cSRichard LoweCERRWARN += -_gcc=-Wno-unused-variable
677014882cSRichard LoweCERRWARN += -_gcc=-Wno-unused-function
687014882cSRichard Lowe
695661bb76SJohn Levon# not linted
705661bb76SJohn LevonSMATCH=off
715661bb76SJohn Levon
727c478bd9Sstevel@tonic-gate#
737c478bd9Sstevel@tonic-gate# Message catalog
747c478bd9Sstevel@tonic-gate#
757c478bd9Sstevel@tonic-gatePOFILES= $(OBJS:%.o=%.po)
767c478bd9Sstevel@tonic-gatePOFILE= vgrind.po
777c478bd9Sstevel@tonic-gatePOFILE_KSH= vgrind_ksh.po
787c478bd9Sstevel@tonic-gate
797c478bd9Sstevel@tonic-gate#
807c478bd9Sstevel@tonic-gate# Abbreviation for future use.
817c478bd9Sstevel@tonic-gate#
827c478bd9Sstevel@tonic-gateROOTTMAC= $(ROOT)/usr/share/lib/tmac
837c478bd9Sstevel@tonic-gate
847c478bd9Sstevel@tonic-gate#
857c478bd9Sstevel@tonic-gate# Override macro definitions from Makefile.cmd.  Necessary because
867c478bd9Sstevel@tonic-gate# we're building targets for multiple destinations.
877c478bd9Sstevel@tonic-gate#
887c478bd9Sstevel@tonic-gateROOTLIBPROG= $(LIBPROG:%=$(ROOT)/usr/lib/%)
897c478bd9Sstevel@tonic-gateROOTTMACPROG= $(TMACPROG:%=$(ROOTTMAC)/%)
907c478bd9Sstevel@tonic-gate
917c478bd9Sstevel@tonic-gate#
927c478bd9Sstevel@tonic-gate# Conditional assignments pertinent to installation.
937c478bd9Sstevel@tonic-gate#
94*58e78d16SToomas Soome$(ROOTLIB)/$(LANGDEFS)	:= FILEMODE= $(LIBFILEMODE)
95*58e78d16SToomas Soome$(ROOTTMACPROG)		:= FILEMODE= 0644
967c478bd9Sstevel@tonic-gate
977c478bd9Sstevel@tonic-gate#
987c478bd9Sstevel@tonic-gate# The standard set of rules doesn't know about installing into
997c478bd9Sstevel@tonic-gate# subdirectories of /usr/share/lib, so we have to roll our own.
1007c478bd9Sstevel@tonic-gate#
1017c478bd9Sstevel@tonic-gate$(ROOTTMAC)/%: %
1027c478bd9Sstevel@tonic-gate	$(INS.file)
1037c478bd9Sstevel@tonic-gate
1047c478bd9Sstevel@tonic-gate.KEEP_STATE:
1057c478bd9Sstevel@tonic-gate
1067c478bd9Sstevel@tonic-gate#
1077c478bd9Sstevel@tonic-gate# retest appears here only in source form; see comment above for PROG.
1087c478bd9Sstevel@tonic-gate#
1097c478bd9Sstevel@tonic-gateall:	$(PROG) $(LIBPROG) $(TMACPROG) $(RETESTSRC)
1107c478bd9Sstevel@tonic-gate
1117c478bd9Sstevel@tonic-gate#
1127c478bd9Sstevel@tonic-gate# message catalog
1137c478bd9Sstevel@tonic-gate#
1147c478bd9Sstevel@tonic-gate$(POFILE): $(POFILES) $(POFILE_KSH)
1157c478bd9Sstevel@tonic-gate	rm -f $@
1167c478bd9Sstevel@tonic-gate	cat $(POFILES) $(POFILE_KSH) > $@
1177c478bd9Sstevel@tonic-gate
1187c478bd9Sstevel@tonic-gate$(VFONTEDPR): $(VFONTEDPROBJS)
119*58e78d16SToomas Soome	$(LINK.c) -o $@ $(VFONTEDPROBJS) $(LDLIBS)
1207c478bd9Sstevel@tonic-gate	$(POST_PROCESS)
1217c478bd9Sstevel@tonic-gate
1227c478bd9Sstevel@tonic-gate$(LANGDEFS):	$(LANGDEFS).src
1237c478bd9Sstevel@tonic-gate	$(CP) $? $@
1247c478bd9Sstevel@tonic-gate
1257c478bd9Sstevel@tonic-gate$(RETEST): $(RETESTOBJS)
126*58e78d16SToomas Soome	$(LINK.c) -o $@ $(RETESTOBJS) $(LDLIBS)
1277c478bd9Sstevel@tonic-gate	$(POST_PROCESS)
1287c478bd9Sstevel@tonic-gate
1297c478bd9Sstevel@tonic-gate#
1307c478bd9Sstevel@tonic-gate# We add all as a dependent to make sure that the install pattern
1317c478bd9Sstevel@tonic-gate# matching rules see everything they should.  (This is a safety net.)
1327c478bd9Sstevel@tonic-gate#
1337c478bd9Sstevel@tonic-gate# XXX:	ROOTTMAC shouldn't appear as a dependent; it's here as a
134*58e78d16SToomas Soome#	bandaid(TM) until /usr/lib/tmac becomes a symlink to
1357c478bd9Sstevel@tonic-gate#	/usr/share/lib/tmac.
1367c478bd9Sstevel@tonic-gate#
1377c478bd9Sstevel@tonic-gateinstall: all $(ROOTTMAC) $(ROOTPROG) $(ROOTLIBPROG) $(ROOTTMACPROG)
1387c478bd9Sstevel@tonic-gate
1397c478bd9Sstevel@tonic-gate# XXX: see above.
1407c478bd9Sstevel@tonic-gate$(ROOTTMAC):
1417c478bd9Sstevel@tonic-gate	$(INS.dir)
1427c478bd9Sstevel@tonic-gate
1437c478bd9Sstevel@tonic-gateclean:
1447c478bd9Sstevel@tonic-gate	$(RM) $(OBJS)
1457c478bd9Sstevel@tonic-gate
1467c478bd9Sstevel@tonic-gate#
1477c478bd9Sstevel@tonic-gate# Don't worry about linting retest.
1487c478bd9Sstevel@tonic-gate#
1497c478bd9Sstevel@tonic-gatelint:=	SRCS = $(VFONTEDPROBJS:%.o=%.c)
1507c478bd9Sstevel@tonic-gatelint: lint_SRCS
1517c478bd9Sstevel@tonic-gate
1527c478bd9Sstevel@tonic-gateinclude ../Makefile.targ
153