xref: /illumos-gate/usr/src/tools/cw/Makefile (revision 22a8b493)
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
347c478bd9Sstevel@tonic-gatei386_CC=		$(SPRO_VROOT)/bin/cc
357c478bd9Sstevel@tonic-gatesparc_CC=		$(SPRO_VROOT)/bin/cc
367ed54634SRobert Mustacchi$(__GNUC)i386_CC=	$(GNUC_ROOT)/bin/gcc
377ed54634SRobert Mustacchi$(__GNUC)sparc_CC=	$(GNUC_ROOT)/bin/gcc
387c478bd9Sstevel@tonic-gate
397c478bd9Sstevel@tonic-gateCFLAGS += $(CCVERBOSE)
407c478bd9Sstevel@tonic-gate
416a3e8e86SRichard Lowe# Override CFLAGS.  This is needed only for bootstrap of cw.
42*22a8b493SToomas Soome$(__GNUC)CFLAGS=	-O -D__sun -Wall -Werror -std=gnu99 -nodefaultlibs
43aa9ef484SJohn Levon$(__SUNC)CFLAGS=	-xspace -Xa -xildoff -errtags=yes -errwarn=%all \
44aa9ef484SJohn Levon			-xc99=%all -W0,-xglobalstatic -v
456a3e8e86SRichard Lowe
465801b0f0SToomas Soome$(__GNUC)LDLIBS +=	-Wl,-zassert-deflib=libc.so -lc
47aa9ef484SJohn Levon$(__GNUC)LDFLAGS=	$(MAPFILE.NES:%=-Wl,-M%)
485801b0f0SToomas Soome$(__GNUC)ZASSERTDEFLIB = -Wl,-zassert-deflib
495801b0f0SToomas Soome$(__GNUC)ZFATALWARNINGS = -Wl,-zfatal-warnings
505801b0f0SToomas Soome$(__GNUC)ZGUIDANCE = -Wl,-zguidance
515801b0f0SToomas SoomeLDFLAGS += -Wl,$(ZDIRECT)
527c478bd9Sstevel@tonic-gate
536cad8c54SRyan Zezeski$(ROOTONBLDMAN1ONBLDFILES) := FILEMODE=      644
5488e61e85SRichard LoweCSTD=	$(CSTD_GNU99)
5580ab886dSwesolows
56c0855578SRichard Lowe# Assume we don't have the install.bin available yet
57c0855578SRichard LoweINS.file=	$(RM) $@; $(CP) $< $(@D); $(CHMOD) $(FILEMODE) $@
58c0855578SRichard Lowe
597c478bd9Sstevel@tonic-gate.KEEP_STATE:
607c478bd9Sstevel@tonic-gate
616cad8c54SRyan Zezeskiall: $(PROG) $(MAN1ONBLDFILES)
627c478bd9Sstevel@tonic-gate
636cad8c54SRyan Zezeskiinstall: all .WAIT $(ROOTONBLDMACHPROG) $(ROOTONBLDMAN1ONBLDFILES)
647c478bd9Sstevel@tonic-gate
657c478bd9Sstevel@tonic-gateclean:
667c478bd9Sstevel@tonic-gate
67aa9ef484SJohn Levon#
68aa9ef484SJohn Levon# Not run by default: bootstrap...
69aa9ef484SJohn Levoncheck:
70aa9ef484SJohn Levon	$(ROOTONBLDBINMACH)/mandoc -Tlint -Wwarning $(MAN1ONBLDFILES)
71aa9ef484SJohn Levon
727c478bd9Sstevel@tonic-gateinclude ../Makefile.targ
73