xref: /illumos-gate/usr/src/cmd/savecore/Makefile (revision 16f0f9b3a6dec7c7fd20d32eb734697578942b90)
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
59d6681f7SRichard Lowe# Common Development and Distribution License (the "License").
69d6681f7SRichard Lowe# 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#
219d6681f7SRichard Lowe
227c478bd9Sstevel@tonic-gate#
239d6681f7SRichard Lowe# Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
249d6681f7SRichard Lowe# Copyright (c) 2018, Joyent, Inc.
25*16f0f9b3SAndy Fiddaman# Copyright 2024 Oxide Computer Company
267c478bd9Sstevel@tonic-gate#
277c478bd9Sstevel@tonic-gate
287c478bd9Sstevel@tonic-gatePROG= savecore
299d6681f7SRichard LoweOBJS= savecore.o compress.o
307c478bd9Sstevel@tonic-gate
317c478bd9Sstevel@tonic-gateinclude ../Makefile.cmd
329d6681f7SRichard Loweinclude ../Makefile.cmd.64
33*16f0f9b3SAndy Fiddamaninclude ../Makefile.ctf
347c478bd9Sstevel@tonic-gate
359d6681f7SRichard LoweCSTD = $(CSTD_GNU99)
367c478bd9Sstevel@tonic-gate
379d6681f7SRichard LoweCFLAGS += $(CCVERBOSE)
389d6681f7SRichard LoweCPPFLAGS += -DBZ_NO_STDIO -I$(SRC)/common -I$(SRC)/uts/common
399d6681f7SRichard Lowe
409d6681f7SRichard LoweLDLIBS += -L$(ROOT)/usr/lib/fm/64 -lfmevent -lnvpair
419d6681f7SRichard LoweLDFLAGS += -R/usr/lib/fm/64
429d6681f7SRichard Lowe
439d6681f7SRichard Lowe
449d6681f7SRichard Lowe#
459d6681f7SRichard Lowe# savecore is compiled with bits from $(SRC)/common/bzip2 and some function
469d6681f7SRichard Lowe# symbols there are defined as weak; if you leave them out of
479d6681f7SRichard Lowe# savecore.c it will compile, but trying to call that function
489d6681f7SRichard Lowe# will jump to 0.  So we use -ztext to avoid that.
499d6681f7SRichard Lowe#
509d6681f7SRichard LoweLDFLAGS += $(ZTEXT)
519d6681f7SRichard Lowe
529d6681f7SRichard LoweBZIP2OBJS =	bz2blocksort.o	\
539d6681f7SRichard Lowe		bz2compress.o	\
549d6681f7SRichard Lowe		bz2decompress.o	\
559d6681f7SRichard Lowe		bz2randtable.o	\
569d6681f7SRichard Lowe		bz2bzlib.o	\
579d6681f7SRichard Lowe		bz2crctable.o	\
589d6681f7SRichard Lowe		bz2huffman.o
597c478bd9Sstevel@tonic-gate
60*16f0f9b3SAndy Fiddaman$(BZIP2OBJS) := SMOFF=indenting
61*16f0f9b3SAndy Fiddaman
627c478bd9Sstevel@tonic-gate.KEEP_STATE:
637c478bd9Sstevel@tonic-gate
649d6681f7SRichard Loweall: $(PROG)
657c478bd9Sstevel@tonic-gate
669d6681f7SRichard Loweinstall: all $(ROOTPROG)
677c478bd9Sstevel@tonic-gate
689d6681f7SRichard Lowe$(PROG): $(OBJS) $(BZIP2OBJS)
699d6681f7SRichard Lowe	$(LINK.c) -o $(PROG) $(OBJS) $(BZIP2OBJS) $(LDLIBS)
709d6681f7SRichard Lowe	$(POST_PROCESS)
717c478bd9Sstevel@tonic-gate
729d6681f7SRichard Loweclean:
739d6681f7SRichard Lowe	$(RM) $(OBJS) $(BZIP2OBJS)
747c478bd9Sstevel@tonic-gate
757c478bd9Sstevel@tonic-gateinclude ../Makefile.targ
769d6681f7SRichard Lowe
779d6681f7SRichard Lowe%.o: ../../uts/common/os/%.c
789d6681f7SRichard Lowe	$(COMPILE.c) $<
799d6681f7SRichard Lowe	$(POST_PROCESS_O)
809d6681f7SRichard Lowe
819d6681f7SRichard Lowebz2%.o: ../../common/bzip2/%.c
829d6681f7SRichard Lowe	$(COMPILE.c) -o $@ -I$(SRC)/common/bzip2 $<
839d6681f7SRichard Lowe	$(POST_PROCESS_O)
84