xref: /illumos-gate/usr/src/tools/cw/Makefile (revision 88e61e85)
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.
427c478bd9Sstevel@tonic-gate$(__GNUC)CFLAGS=	-O -D__sun -Wall -Wno-unknown-pragmas -Werror \
43aa9ef484SJohn Levon			-std=gnu99 -nodefaultlibs
44aa9ef484SJohn Levon$(__SUNC)CFLAGS=	-xspace -Xa -xildoff -errtags=yes -errwarn=%all \
45aa9ef484SJohn Levon			-xc99=%all -W0,-xglobalstatic -v
466a3e8e86SRichard Lowe
477c478bd9Sstevel@tonic-gate
487c478bd9Sstevel@tonic-gate$(__GNUC)LDLIBS +=	-lc
49aa9ef484SJohn Levon$(__GNUC)LDFLAGS=	$(MAPFILE.NES:%=-Wl,-M%)
507c478bd9Sstevel@tonic-gate
516cad8c54SRyan Zezeski$(ROOTONBLDMAN1ONBLDFILES) := FILEMODE=      644
52*88e61e85SRichard LoweCSTD=	$(CSTD_GNU99)
5380ab886dSwesolows
54c0855578SRichard Lowe# Assume we don't have the install.bin available yet
55c0855578SRichard LoweINS.file=	$(RM) $@; $(CP) $< $(@D); $(CHMOD) $(FILEMODE) $@
56c0855578SRichard Lowe
577c478bd9Sstevel@tonic-gate.KEEP_STATE:
587c478bd9Sstevel@tonic-gate
596cad8c54SRyan Zezeskiall: $(PROG) $(MAN1ONBLDFILES)
607c478bd9Sstevel@tonic-gate
616cad8c54SRyan Zezeskiinstall: all .WAIT $(ROOTONBLDMACHPROG) $(ROOTONBLDMAN1ONBLDFILES)
627c478bd9Sstevel@tonic-gate
637c478bd9Sstevel@tonic-gatelint: lint_PROG
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