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# 22*f6e214c7SGavin Maltby# Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. 237c478bd9Sstevel@tonic-gate# 247c478bd9Sstevel@tonic-gate 257c478bd9Sstevel@tonic-gatePROG= savecore 267c478bd9Sstevel@tonic-gateSRCS= ../savecore.c ../../../uts/common/os/compress.c 2780ab886dSwesolowsOBJS= savecore.o compress.o 287c478bd9Sstevel@tonic-gate 297c478bd9Sstevel@tonic-gateinclude ../../Makefile.cmd 307c478bd9Sstevel@tonic-gate 31*f6e214c7SGavin MaltbyC99MODE = $(C99_ENABLE) 32*f6e214c7SGavin Maltby 337c478bd9Sstevel@tonic-gateCFLAGS += $(CCVERBOSE) 347c478bd9Sstevel@tonic-gateCFLAGS64 += $(CCVERBOSE) 35ca3e8d88SDave PlaugerCPPFLAGS += -D_LARGEFILE64_SOURCE=1 -DBZ_NO_STDIO -I$(SRC)/uts/common 36ca3e8d88SDave Plauger 37*f6e214c7SGavin Maltby# 38*f6e214c7SGavin Maltby# savecore is compiled with bits from $(SRC)/common/bzip2 and some function 39*f6e214c7SGavin Maltby# symbols there are defined as weak; if you leave them out of 40*f6e214c7SGavin Maltby# savecore.c it will compile, but trying to call that function 41*f6e214c7SGavin Maltby# will jump to 0. So we use -ztext to avoid that. 42*f6e214c7SGavin Maltby# 43*f6e214c7SGavin MaltbyLDFLAGS += -ztext 44*f6e214c7SGavin Maltby 45ca3e8d88SDave PlaugerBZIP2OBJS = bz2blocksort.o \ 46ca3e8d88SDave Plauger bz2compress.o \ 47ca3e8d88SDave Plauger bz2decompress.o \ 48ca3e8d88SDave Plauger bz2randtable.o \ 49ca3e8d88SDave Plauger bz2bzlib.o \ 50ca3e8d88SDave Plauger bz2crctable.o \ 51ca3e8d88SDave Plauger bz2huffman.o 527c478bd9Sstevel@tonic-gate 537c478bd9Sstevel@tonic-gate.KEEP_STATE: 547c478bd9Sstevel@tonic-gate 557c478bd9Sstevel@tonic-gateall: $(PROG) 567c478bd9Sstevel@tonic-gate 57ca3e8d88SDave Plauger$(PROG): $(OBJS) $(BZIP2OBJS) 58ca3e8d88SDave Plauger $(LINK.c) -o $(PROG) $(OBJS) $(BZIP2OBJS) $(LDLIBS) 597c478bd9Sstevel@tonic-gate $(POST_PROCESS) 607c478bd9Sstevel@tonic-gate 617c478bd9Sstevel@tonic-gateclean: 62ca3e8d88SDave Plauger $(RM) $(OBJS) $(BZIP2OBJS) 637c478bd9Sstevel@tonic-gate 64*f6e214c7SGavin Maltbylint := CPPFLAGS += -I$(SRC)/common 65*f6e214c7SGavin Maltby 66*f6e214c7SGavin Maltby# 67*f6e214c7SGavin Maltby# Linting the usr/src/common/bzip2 source produces reams of complaints. 68*f6e214c7SGavin Maltby# So we only lint regular SRCS, but we need to excuse two complaints 69*f6e214c7SGavin Maltby# related to bz_internal_error. 70*f6e214c7SGavin Maltby# 71*f6e214c7SGavin Maltby 72*f6e214c7SGavin Maltbylint := BZ2LINTCOPOUTS = -erroff=E_NAME_USED_NOT_DEF2 73*f6e214c7SGavin Maltbylint := BZ2LINTCOPOUTS += -erroff=E_NAME_DEF_NOT_USED2 74*f6e214c7SGavin Maltby 75*f6e214c7SGavin Maltbylint := LINTFLAGS += $(BZ2LINTCOPOUTS) 76*f6e214c7SGavin Maltbylint := LINTFLAGS64 += $(BZ2LINTCOPOUTS) 77*f6e214c7SGavin Maltby 78*f6e214c7SGavin Maltbylint: $(LINTSRCS) 79*f6e214c7SGavin Maltby $(LINT.c) $(SRCS) $(LDLIBS) 807c478bd9Sstevel@tonic-gate 817c478bd9Sstevel@tonic-gateinclude ../../Makefile.targ 8280ab886dSwesolows 8380ab886dSwesolows%.o: ../%.c 84ca3e8d88SDave Plauger $(COMPILE.c) -I$(SRC)/common $< 8580ab886dSwesolows $(POST_PROCESS_O) 8680ab886dSwesolows 8780ab886dSwesolows%.o: ../../../uts/common/os/%.c 8880ab886dSwesolows $(COMPILE.c) $< 8980ab886dSwesolows $(POST_PROCESS_O) 90ca3e8d88SDave Plauger 91ca3e8d88SDave Plaugerbz2%.o: ../../../common/bzip2/%.c 92ca3e8d88SDave Plauger $(COMPILE.c) -o $@ -I$(SRC)/common -I$(SRC)/common/bzip2 $< 93ca3e8d88SDave Plauger $(POST_PROCESS_O) 94