Makefile revision 7014882c6a3672fd0e5d60200af8643ae53c5928
5c02d3183f46ba8621a4bdecc71facda5f8e0717Michael Graff#
5c02d3183f46ba8621a4bdecc71facda5f8e0717Michael Graff# CDDL HEADER START
5c02d3183f46ba8621a4bdecc71facda5f8e0717Michael Graff#
5c02d3183f46ba8621a4bdecc71facda5f8e0717Michael Graff# The contents of this file are subject to the terms of the
5c02d3183f46ba8621a4bdecc71facda5f8e0717Michael Graff# Common Development and Distribution License (the "License").
5c02d3183f46ba8621a4bdecc71facda5f8e0717Michael Graff# You may not use this file except in compliance with the License.
5c02d3183f46ba8621a4bdecc71facda5f8e0717Michael Graff#
5c02d3183f46ba8621a4bdecc71facda5f8e0717Michael Graff# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
5c02d3183f46ba8621a4bdecc71facda5f8e0717Michael Graff# or http://www.opensolaris.org/os/licensing.
5c02d3183f46ba8621a4bdecc71facda5f8e0717Michael Graff# See the License for the specific language governing permissions
5c02d3183f46ba8621a4bdecc71facda5f8e0717Michael Graff# and limitations under the License.
5c02d3183f46ba8621a4bdecc71facda5f8e0717Michael Graff#
5c02d3183f46ba8621a4bdecc71facda5f8e0717Michael Graff# When distributing Covered Code, include this CDDL HEADER in each
5c02d3183f46ba8621a4bdecc71facda5f8e0717Michael Graff# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
5c02d3183f46ba8621a4bdecc71facda5f8e0717Michael Graff# If applicable, add the following below this CDDL HEADER, with the
5c02d3183f46ba8621a4bdecc71facda5f8e0717Michael Graff# fields enclosed by brackets "[]" replaced with your own identifying
5c02d3183f46ba8621a4bdecc71facda5f8e0717Michael Graff# information: Portions Copyright [yyyy] [name of copyright owner]
5c02d3183f46ba8621a4bdecc71facda5f8e0717Michael Graff#
5c02d3183f46ba8621a4bdecc71facda5f8e0717Michael Graff# CDDL HEADER END
5c02d3183f46ba8621a4bdecc71facda5f8e0717Michael Graff#
5c02d3183f46ba8621a4bdecc71facda5f8e0717Michael Graff#
5c02d3183f46ba8621a4bdecc71facda5f8e0717Michael Graff# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
ff89d6add5f529ffd2119708ef6d70aca69f45b1Mark Andrews# Use is subject to license terms.
5c02d3183f46ba8621a4bdecc71facda5f8e0717Michael Graff#
5c02d3183f46ba8621a4bdecc71facda5f8e0717Michael Graff# cmd/vgrind/Makefile
5c02d3183f46ba8621a4bdecc71facda5f8e0717Michael Graff
5c02d3183f46ba8621a4bdecc71facda5f8e0717Michael Graff#
5c02d3183f46ba8621a4bdecc71facda5f8e0717Michael Graff# These are the objects associated with the overall vgrind command.
ff89d6add5f529ffd2119708ef6d70aca69f45b1Mark Andrews#
5c02d3183f46ba8621a4bdecc71facda5f8e0717Michael GraffVFONTEDPR= vfontedpr
5c02d3183f46ba8621a4bdecc71facda5f8e0717Michael GraffRETEST= retest
5c02d3183f46ba8621a4bdecc71facda5f8e0717Michael GraffMACROS= tmac.vgrind
5c02d3183f46ba8621a4bdecc71facda5f8e0717Michael GraffLANGDEFS= vgrindefs
56f6fd83625392a3055483e6a55c6d4b666fecd3Bob HalleyKSHPROG= vgrind
5c02d3183f46ba8621a4bdecc71facda5f8e0717Michael Graff
56f6fd83625392a3055483e6a55c6d4b666fecd3Bob Halley#
5c02d3183f46ba8621a4bdecc71facda5f8e0717Michael Graff# These macros captures objects that ultimately will be installed in
5c02d3183f46ba8621a4bdecc71facda5f8e0717Michael Graff# (respectively) /usr/bin, /usr/lib, and /usr/share/lib.
3724ec85fb720159dd4542d9c590725bb7effb6fBob Halley#
3724ec85fb720159dd4542d9c590725bb7effb6fBob Halley# Note also that retest is used strictly as a test program and is never
3724ec85fb720159dd4542d9c590725bb7effb6fBob Halley# installed. We omit it here, so that the NSE doesn't spend cycles
3724ec85fb720159dd4542d9c590725bb7effb6fBob Halley# on it when acquiring and reconciling.
3724ec85fb720159dd4542d9c590725bb7effb6fBob Halley#
3724ec85fb720159dd4542d9c590725bb7effb6fBob HalleyPROG= $(KSHPROG)
5c02d3183f46ba8621a4bdecc71facda5f8e0717Michael GraffLIBPROG= $(VFONTEDPR) $(LANGDEFS)
3724ec85fb720159dd4542d9c590725bb7effb6fBob HalleyTMACPROG= $(MACROS)
3724ec85fb720159dd4542d9c590725bb7effb6fBob Halley
3724ec85fb720159dd4542d9c590725bb7effb6fBob HalleyVFONTEDPROBJS= vfontedpr.o vgrindefs.o regexp.o
3724ec85fb720159dd4542d9c590725bb7effb6fBob HalleyRETESTOBJS= retest.o regexp.o
3724ec85fb720159dd4542d9c590725bb7effb6fBob Halley
3724ec85fb720159dd4542d9c590725bb7effb6fBob HalleyRETESTSRC= $(RETESTOBJS:%.o=%.c)
3724ec85fb720159dd4542d9c590725bb7effb6fBob Halley
3724ec85fb720159dd4542d9c590725bb7effb6fBob HalleyOBJS= $(VFONTEDPROBJS) $(RETESTOBJS)
3724ec85fb720159dd4542d9c590725bb7effb6fBob HalleySRCS= $(OBJS:%.o=%.c)
3724ec85fb720159dd4542d9c590725bb7effb6fBob Halley
3724ec85fb720159dd4542d9c590725bb7effb6fBob Halley#
3724ec85fb720159dd4542d9c590725bb7effb6fBob Halley# We can get away simply with omitting TMACPROGS to protect
3724ec85fb720159dd4542d9c590725bb7effb6fBob Halley# tmac.vgrind, since it's the only entry in that macro.
3724ec85fb720159dd4542d9c590725bb7effb6fBob Halley#
3724ec85fb720159dd4542d9c590725bb7effb6fBob HalleyCLOBBERFILES= $(LIBPROG) $(RETEST)
3724ec85fb720159dd4542d9c590725bb7effb6fBob Halley
3724ec85fb720159dd4542d9c590725bb7effb6fBob Halleyinclude ../Makefile.cmd
3724ec85fb720159dd4542d9c590725bb7effb6fBob Halley
3724ec85fb720159dd4542d9c590725bb7effb6fBob HalleyCERRWARN += -_gcc=-Wno-implicit-function-declaration
56f6fd83625392a3055483e6a55c6d4b666fecd3Bob HalleyCERRWARN += -_gcc=-Wno-parentheses
56f6fd83625392a3055483e6a55c6d4b666fecd3Bob HalleyCERRWARN += -_gcc=-Wno-unused-variable
5c02d3183f46ba8621a4bdecc71facda5f8e0717Michael GraffCERRWARN += -_gcc=-Wno-unused-function
54570ba7ffb85ad8449d86bd0e14fb6fb2e271c4James Brister
54570ba7ffb85ad8449d86bd0e14fb6fb2e271c4James Brister#
54570ba7ffb85ad8449d86bd0e14fb6fb2e271c4James Brister# Message catalog
54570ba7ffb85ad8449d86bd0e14fb6fb2e271c4James Brister#
54570ba7ffb85ad8449d86bd0e14fb6fb2e271c4James BristerPOFILES= $(OBJS:%.o=%.po)
54570ba7ffb85ad8449d86bd0e14fb6fb2e271c4James BristerPOFILE= vgrind.po
54570ba7ffb85ad8449d86bd0e14fb6fb2e271c4James BristerPOFILE_KSH= vgrind_ksh.po
54570ba7ffb85ad8449d86bd0e14fb6fb2e271c4James Brister
54570ba7ffb85ad8449d86bd0e14fb6fb2e271c4James Brister#
54570ba7ffb85ad8449d86bd0e14fb6fb2e271c4James Brister# Abbreviation for future use.
54570ba7ffb85ad8449d86bd0e14fb6fb2e271c4James Brister#
54570ba7ffb85ad8449d86bd0e14fb6fb2e271c4James BristerROOTTMAC= $(ROOT)/usr/share/lib/tmac
54570ba7ffb85ad8449d86bd0e14fb6fb2e271c4James Brister
54570ba7ffb85ad8449d86bd0e14fb6fb2e271c4James Brister#
54570ba7ffb85ad8449d86bd0e14fb6fb2e271c4James Brister# Override macro definitions from Makefile.cmd. Necessary because
54570ba7ffb85ad8449d86bd0e14fb6fb2e271c4James Brister# we're building targets for multiple destinations.
54570ba7ffb85ad8449d86bd0e14fb6fb2e271c4James Brister#
54570ba7ffb85ad8449d86bd0e14fb6fb2e271c4James BristerROOTLIBPROG= $(LIBPROG:%=$(ROOT)/usr/lib/%)
54570ba7ffb85ad8449d86bd0e14fb6fb2e271c4James BristerROOTTMACPROG= $(TMACPROG:%=$(ROOTTMAC)/%)
54570ba7ffb85ad8449d86bd0e14fb6fb2e271c4James Brister
54570ba7ffb85ad8449d86bd0e14fb6fb2e271c4James Brister#
54570ba7ffb85ad8449d86bd0e14fb6fb2e271c4James Brister# Conditional assignments pertinent to installation.
54570ba7ffb85ad8449d86bd0e14fb6fb2e271c4James Brister#
54570ba7ffb85ad8449d86bd0e14fb6fb2e271c4James Brister$(ROOTLIB)/$(LANGDEFS) := FILEMODE= $(LIBFILEMODE)
54570ba7ffb85ad8449d86bd0e14fb6fb2e271c4James Brister$(ROOTTMACPROG) := FILEMODE= 0644
54570ba7ffb85ad8449d86bd0e14fb6fb2e271c4James Brister
54570ba7ffb85ad8449d86bd0e14fb6fb2e271c4James Brister#
54570ba7ffb85ad8449d86bd0e14fb6fb2e271c4James Brister# The standard set of rules doesn't know about installing into
54570ba7ffb85ad8449d86bd0e14fb6fb2e271c4James Brister# subdirectories of /usr/share/lib, so we have to roll our own.
54570ba7ffb85ad8449d86bd0e14fb6fb2e271c4James Brister#
54570ba7ffb85ad8449d86bd0e14fb6fb2e271c4James Brister$(ROOTTMAC)/%: %
54570ba7ffb85ad8449d86bd0e14fb6fb2e271c4James Brister $(INS.file)
54570ba7ffb85ad8449d86bd0e14fb6fb2e271c4James Brister
54570ba7ffb85ad8449d86bd0e14fb6fb2e271c4James Brister.KEEP_STATE:
54570ba7ffb85ad8449d86bd0e14fb6fb2e271c4James Brister
54570ba7ffb85ad8449d86bd0e14fb6fb2e271c4James Brister#
54570ba7ffb85ad8449d86bd0e14fb6fb2e271c4James Brister# retest appears here only in source form; see comment above for PROG.
ff89d6add5f529ffd2119708ef6d70aca69f45b1Mark Andrews#
ff89d6add5f529ffd2119708ef6d70aca69f45b1Mark Andrewsall: $(PROG) $(LIBPROG) $(TMACPROG) $(RETESTSRC)
ff89d6add5f529ffd2119708ef6d70aca69f45b1Mark Andrews
ff89d6add5f529ffd2119708ef6d70aca69f45b1Mark Andrews#
ff89d6add5f529ffd2119708ef6d70aca69f45b1Mark Andrews# message catalog
ff89d6add5f529ffd2119708ef6d70aca69f45b1Mark Andrews#
ff89d6add5f529ffd2119708ef6d70aca69f45b1Mark Andrews$(POFILE): $(POFILES) $(POFILE_KSH)
ff89d6add5f529ffd2119708ef6d70aca69f45b1Mark Andrews rm -f $@
ff89d6add5f529ffd2119708ef6d70aca69f45b1Mark Andrews cat $(POFILES) $(POFILE_KSH) > $@
ff89d6add5f529ffd2119708ef6d70aca69f45b1Mark Andrews
ff89d6add5f529ffd2119708ef6d70aca69f45b1Mark Andrews$(VFONTEDPR): $(VFONTEDPROBJS)
ff89d6add5f529ffd2119708ef6d70aca69f45b1Mark Andrews $(CC) -o $@ $(VFONTEDPROBJS) $(LDFLAGS) $(LDLIBS)
ff89d6add5f529ffd2119708ef6d70aca69f45b1Mark Andrews $(POST_PROCESS)
ff89d6add5f529ffd2119708ef6d70aca69f45b1Mark Andrews
ff89d6add5f529ffd2119708ef6d70aca69f45b1Mark Andrews$(LANGDEFS): $(LANGDEFS).src
ff89d6add5f529ffd2119708ef6d70aca69f45b1Mark Andrews $(CP) $? $@
ff89d6add5f529ffd2119708ef6d70aca69f45b1Mark Andrews
ff89d6add5f529ffd2119708ef6d70aca69f45b1Mark Andrews$(RETEST): $(RETESTOBJS)
ff89d6add5f529ffd2119708ef6d70aca69f45b1Mark Andrews $(CC) -o $@ $(RETESTOBJS) $(LDFLAGS) $(LDLIBS)
ff89d6add5f529ffd2119708ef6d70aca69f45b1Mark Andrews $(POST_PROCESS)
ff89d6add5f529ffd2119708ef6d70aca69f45b1Mark Andrews
ff89d6add5f529ffd2119708ef6d70aca69f45b1Mark Andrews#
ff89d6add5f529ffd2119708ef6d70aca69f45b1Mark Andrews# We add all as a dependent to make sure that the install pattern
ff89d6add5f529ffd2119708ef6d70aca69f45b1Mark Andrews# matching rules see everything they should. (This is a safety net.)
ff89d6add5f529ffd2119708ef6d70aca69f45b1Mark Andrews#
ff89d6add5f529ffd2119708ef6d70aca69f45b1Mark Andrews# XXX: ROOTTMAC shouldn't appear as a dependent; it's here as a
ff89d6add5f529ffd2119708ef6d70aca69f45b1Mark Andrews# bandaid(TM) until /usr/lib/tmac becomes a symlink to
ff89d6add5f529ffd2119708ef6d70aca69f45b1Mark Andrews# /usr/share/lib/tmac.
ff89d6add5f529ffd2119708ef6d70aca69f45b1Mark Andrews#
ff89d6add5f529ffd2119708ef6d70aca69f45b1Mark Andrewsinstall: all $(ROOTTMAC) $(ROOTPROG) $(ROOTLIBPROG) $(ROOTTMACPROG)
ff89d6add5f529ffd2119708ef6d70aca69f45b1Mark Andrews
ff89d6add5f529ffd2119708ef6d70aca69f45b1Mark Andrews# XXX: see above.
ff89d6add5f529ffd2119708ef6d70aca69f45b1Mark Andrews$(ROOTTMAC):
ff89d6add5f529ffd2119708ef6d70aca69f45b1Mark Andrews $(INS.dir)
ff89d6add5f529ffd2119708ef6d70aca69f45b1Mark Andrews
56f6fd83625392a3055483e6a55c6d4b666fecd3Bob Halleyclean:
56f6fd83625392a3055483e6a55c6d4b666fecd3Bob Halley $(RM) $(OBJS)
56f6fd83625392a3055483e6a55c6d4b666fecd3Bob Halley
56f6fd83625392a3055483e6a55c6d4b666fecd3Bob Halley#
56f6fd83625392a3055483e6a55c6d4b666fecd3Bob Halley# Don't worry about linting retest.
56f6fd83625392a3055483e6a55c6d4b666fecd3Bob Halley#
56f6fd83625392a3055483e6a55c6d4b666fecd3Bob Halleylint:= SRCS = $(VFONTEDPROBJS:%.o=%.c)
56f6fd83625392a3055483e6a55c6d4b666fecd3Bob Halleylint: lint_SRCS
56f6fd83625392a3055483e6a55c6d4b666fecd3Bob Halley
56f6fd83625392a3055483e6a55c6d4b666fecd3Bob Halleyinclude ../Makefile.targ
5c02d3183f46ba8621a4bdecc71facda5f8e0717Michael Graff