xref: /illumos-gate/usr/src/tools/cw/Makefile (revision 8c426718)
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
580ab886dSwesolows# Common Development and Distribution License (the "License").
680ab886dSwesolows# 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#
2224da5b34Srie# Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
237c478bd9Sstevel@tonic-gate# Use is subject to license terms.
247c478bd9Sstevel@tonic-gate#
25aa9ef484SJohn Levon# Copyright 2018 Joyent, Inc.
267c478bd9Sstevel@tonic-gate
277c478bd9Sstevel@tonic-gatePROG	= cw
287c478bd9Sstevel@tonic-gate
296cad8c54SRyan ZezeskiMAN1ONBLDFILES=	cw.1onbld
3080ab886dSwesolows
317c478bd9Sstevel@tonic-gateinclude ../Makefile.tools
327c478bd9Sstevel@tonic-gate
337c478bd9Sstevel@tonic-gate# Bootstrap problem -- we have to build cw before we can use it
34*8c426718SRichard Lowei386_CC=	$(GNUC_ROOT)/bin/gcc
35*8c426718SRichard Lowesparc_CC=	$(GNUC_ROOT)/bin/gcc
367c478bd9Sstevel@tonic-gate
377c478bd9Sstevel@tonic-gateCFLAGS += $(CCVERBOSE)
387c478bd9Sstevel@tonic-gate
396a3e8e86SRichard Lowe# Override CFLAGS.  This is needed only for bootstrap of cw.
40*8c426718SRichard LoweCFLAGS=	-O -D__sun -Wall -Werror -std=gnu99 -nodefaultlibs
41*8c426718SRichard LoweLDLIBS +=	-Wl,-zassert-deflib=libc.so -lc
42*8c426718SRichard LoweLDFLAGS=	$(MAPFILE.NES:%=-Wl,-M%)
43*8c426718SRichard LoweZASSERTDEFLIB = -Wl,-zassert-deflib
44*8c426718SRichard LoweZFATALWARNINGS = -Wl,-zfatal-warnings
45*8c426718SRichard LoweZGUIDANCE = -Wl,-zguidance
465801b0f0SToomas SoomeLDFLAGS += -Wl,$(ZDIRECT)
477c478bd9Sstevel@tonic-gate
486cad8c54SRyan Zezeski$(ROOTONBLDMAN1ONBLDFILES) := FILEMODE=      644
4988e61e85SRichard LoweCSTD=	$(CSTD_GNU99)
5080ab886dSwesolows
51c0855578SRichard Lowe# Assume we don't have the install.bin available yet
52c0855578SRichard LoweINS.file=	$(RM) $@; $(CP) $< $(@D); $(CHMOD) $(FILEMODE) $@
53c0855578SRichard Lowe
547c478bd9Sstevel@tonic-gate.KEEP_STATE:
557c478bd9Sstevel@tonic-gate
566cad8c54SRyan Zezeskiall: $(PROG) $(MAN1ONBLDFILES)
577c478bd9Sstevel@tonic-gate
586cad8c54SRyan Zezeskiinstall: all .WAIT $(ROOTONBLDMACHPROG) $(ROOTONBLDMAN1ONBLDFILES)
597c478bd9Sstevel@tonic-gate
607c478bd9Sstevel@tonic-gateclean:
617c478bd9Sstevel@tonic-gate
62aa9ef484SJohn Levon#
63aa9ef484SJohn Levon# Not run by default: bootstrap...
64aa9ef484SJohn Levoncheck:
65aa9ef484SJohn Levon	$(ROOTONBLDBINMACH)/mandoc -Tlint -Wwarning $(MAN1ONBLDFILES)
66aa9ef484SJohn Levon
677c478bd9Sstevel@tonic-gateinclude ../Makefile.targ
68