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
55aefb655Srie# Common Development and Distribution License (the "License").
65aefb655Srie# 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#
215aefb655Srie
227c478bd9Sstevel@tonic-gate#
234f680cc6SAli Bahrami# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
247c478bd9Sstevel@tonic-gate# Use is subject to license terms.
257c478bd9Sstevel@tonic-gate#
26cf9a187cSAndy Fiddaman# Copyright 2019 OmniOS Community Edition (OmniOSce) Association.
27cf9a187cSAndy Fiddaman#
287c478bd9Sstevel@tonic-gate
29*69b1fd3fSRichard Lowepics/%.o:	$(SRCDIR)/common/%.c
307c478bd9Sstevel@tonic-gate		$(COMPILE.c) -o $@ $<
317c478bd9Sstevel@tonic-gate		$(POST_PROCESS_O)
327c478bd9Sstevel@tonic-gate
337c478bd9Sstevel@tonic-gatepics/%.o:	%.s
347c478bd9Sstevel@tonic-gate		$(COMPILE.s) -o $@ $<
357c478bd9Sstevel@tonic-gate		$(POST_PROCESS_O)
367c478bd9Sstevel@tonic-gate
37*69b1fd3fSRichard Lowepics/%32.o:	$(SRCDIR)/common/%.c
385aefb655Srie		$(COMPILE.c) -o $@ $<
395aefb655Srie		$(POST_PROCESS_O)
405aefb655Srie
41*69b1fd3fSRichard Lowepics/%64.o:	$(SRCDIR)/common/%.c
425aefb655Srie		$(COMPILE.c) -D_ELF64 -o $@ $<
435aefb655Srie		$(POST_PROCESS_O)
445aefb655Srie
457c478bd9Sstevel@tonic-gatepics/elfcap.o:	$(ELFCAP)/elfcap.c
4699f63845Sab		$(COMPILE.c) -o $@ $(ELFCAP)/elfcap.c
477c478bd9Sstevel@tonic-gate		$(POST_PROCESS_O)
487c478bd9Sstevel@tonic-gate
496a074c93Sab# This rule generates the report_bufsize.h include file used by libconv
506a074c93Sab# code to ensure that their private buffer size calculations agree with
516a074c93Sab# the public values exposed in sgs/include/conv.h. The limit value
526a074c93Sab# supplied must be larger than the largest buffer used in libconv. There
536a074c93Sab# is little penalty for making it very large, because the header file is
546a074c93Sab# only included in error situations where the compilation will fail.
556a074c93Sab#
566a074c93Sab# We make this depend on Makefile.targ, because a change to Makefile.targ
576a074c93Sab# can change the limit, in which case we want to force everything to rebuild.
58*69b1fd3fSRichard Lowereport_bufsize.h:	$(SRCDIR)/Makefile.targ
59*69b1fd3fSRichard Lowe		perl $(SRC)/cmd/sgs/tools/libconv_mk_report_bufsize.pl 8000
606a074c93Sab
61*69b1fd3fSRichard Lowe$(SRCDIR)/common/%.c $(SRCDIR)/common/%_machelf.c:	%_msg.h
627c478bd9Sstevel@tonic-gate
63*69b1fd3fSRichard Lowe%_msg.h + %_msg.c: $(SGSMSG) $(SRCDIR)/common/%.msg report_bufsize.h
644f680cc6SAli Bahrami		$(SGSMSG) $(SGSMSGFLAGS) -h $*_msg.h -d $*_msg.c \
654f680cc6SAli Bahrami			-n sgs_msg_libconv_$* $<
667c478bd9Sstevel@tonic-gate
673edf445cSabvernote.s:	bld_vernote $(README_REVISION) $(ONLDREADME)
683edf445cSab		./bld_vernote \
6934ae5cdfSJosef 'Jeff' Sipek			-R `perl $(README_REVISION) $(ONLDREADME)` \
707c478bd9Sstevel@tonic-gate			-r "$(RELEASE)" -o $@
717c478bd9Sstevel@tonic-gate
72*69b1fd3fSRichard Lowebld_vernote:	$(SRCDIR)/common/bld_vernote.ksh
737c478bd9Sstevel@tonic-gate		$(RM) -f $@
74*69b1fd3fSRichard Lowe		cp $(SRCDIR)/common/bld_vernote.ksh $@
757c478bd9Sstevel@tonic-gate		chmod a+x $@
767c478bd9Sstevel@tonic-gate
777c478bd9Sstevel@tonic-gate$(LIBRARY):	pics $$(PICS)
787c478bd9Sstevel@tonic-gate		@ $(RM) $(LIBRARY)
797c478bd9Sstevel@tonic-gate		$(AR) $(ARFLAGS) $@ $(PICS)
807c478bd9Sstevel@tonic-gate		$(POST_PROCESS_A)
817c478bd9Sstevel@tonic-gate
82cf9a187cSAndy Fiddamanchkmsg:		$(MSGSRCS)
83cf9a187cSAndy Fiddaman		sh $(CHKMSG) $(CHKMSGFLAGS) $(MSGSRCS)
847c478bd9Sstevel@tonic-gate
857c478bd9Sstevel@tonic-gatecatalog:
867c478bd9Sstevel@tonic-gate
877c478bd9Sstevel@tonic-gatepics:
88*69b1fd3fSRichard Lowe		$(MKDIR) -p $@
897c478bd9Sstevel@tonic-gate
907c478bd9Sstevel@tonic-gateclobber:	clean
917c478bd9Sstevel@tonic-gate		-$(RM) $(LIBRARY) $(CLOBBERFILES)
927c478bd9Sstevel@tonic-gate
937c478bd9Sstevel@tonic-gateclean:
947c478bd9Sstevel@tonic-gate		-$(RM) $(PICS) $(CLEANFILES)
95