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 5*9d6681f7SRichard Lowe# Common Development and Distribution License (the "License"). 6*9d6681f7SRichard 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# 21*9d6681f7SRichard Lowe 227c478bd9Sstevel@tonic-gate# 23*9d6681f7SRichard Lowe# Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. 24*9d6681f7SRichard Lowe# Copyright (c) 2018, Joyent, Inc. 257c478bd9Sstevel@tonic-gate# 267c478bd9Sstevel@tonic-gate 27*9d6681f7SRichard LowePROG= savecore 28*9d6681f7SRichard LoweOBJS= savecore.o compress.o 297c478bd9Sstevel@tonic-gate 307c478bd9Sstevel@tonic-gateinclude ../Makefile.cmd 31*9d6681f7SRichard Loweinclude ../Makefile.cmd.64 327c478bd9Sstevel@tonic-gate 33*9d6681f7SRichard LoweCSTD = $(CSTD_GNU99) 347c478bd9Sstevel@tonic-gate 35*9d6681f7SRichard LoweCFLAGS += $(CCVERBOSE) 36*9d6681f7SRichard LoweCPPFLAGS += -DBZ_NO_STDIO -I$(SRC)/common -I$(SRC)/uts/common 377c478bd9Sstevel@tonic-gate 38*9d6681f7SRichard LoweLDLIBS += -L$(ROOT)/usr/lib/fm/64 -lfmevent -lnvpair 39*9d6681f7SRichard LoweLDFLAGS += -R/usr/lib/fm/64 40*9d6681f7SRichard Lowe 41*9d6681f7SRichard Lowe# not linted 42*9d6681f7SRichard LoweSMATCH=off 43*9d6681f7SRichard Lowe 44*9d6681f7SRichard Lowe# 45*9d6681f7SRichard Lowe# savecore is compiled with bits from $(SRC)/common/bzip2 and some function 46*9d6681f7SRichard Lowe# symbols there are defined as weak; if you leave them out of 47*9d6681f7SRichard Lowe# savecore.c it will compile, but trying to call that function 48*9d6681f7SRichard Lowe# will jump to 0. So we use -ztext to avoid that. 49*9d6681f7SRichard Lowe# 50*9d6681f7SRichard LoweLDFLAGS += $(ZTEXT) 51*9d6681f7SRichard Lowe 52*9d6681f7SRichard LoweBZIP2OBJS = bz2blocksort.o \ 53*9d6681f7SRichard Lowe bz2compress.o \ 54*9d6681f7SRichard Lowe bz2decompress.o \ 55*9d6681f7SRichard Lowe bz2randtable.o \ 56*9d6681f7SRichard Lowe bz2bzlib.o \ 57*9d6681f7SRichard Lowe bz2crctable.o \ 58*9d6681f7SRichard Lowe bz2huffman.o 597c478bd9Sstevel@tonic-gate 60*9d6681f7SRichard Lowe.KEEP_STATE: 617c478bd9Sstevel@tonic-gate 62*9d6681f7SRichard Loweall: $(PROG) 637c478bd9Sstevel@tonic-gate 64*9d6681f7SRichard Loweinstall: all $(ROOTPROG) 657c478bd9Sstevel@tonic-gate 66*9d6681f7SRichard Lowe$(PROG): $(OBJS) $(BZIP2OBJS) 67*9d6681f7SRichard Lowe $(LINK.c) -o $(PROG) $(OBJS) $(BZIP2OBJS) $(LDLIBS) 68*9d6681f7SRichard Lowe $(POST_PROCESS) 697c478bd9Sstevel@tonic-gate 70*9d6681f7SRichard Loweclean: 71*9d6681f7SRichard Lowe $(RM) $(OBJS) $(BZIP2OBJS) 727c478bd9Sstevel@tonic-gate 737c478bd9Sstevel@tonic-gateinclude ../Makefile.targ 74*9d6681f7SRichard Lowe 75*9d6681f7SRichard Lowe%.o: ../../uts/common/os/%.c 76*9d6681f7SRichard Lowe $(COMPILE.c) $< 77*9d6681f7SRichard Lowe $(POST_PROCESS_O) 78*9d6681f7SRichard Lowe 79*9d6681f7SRichard Lowebz2%.o: ../../common/bzip2/%.c 80*9d6681f7SRichard Lowe $(COMPILE.c) -o $@ -I$(SRC)/common/bzip2 $< 81*9d6681f7SRichard Lowe $(POST_PROCESS_O) 82