xref: /illumos-gate/usr/src/cmd/savecore/Makefile (revision 9c994d5813a279f66e588d5d28541b252e482bae)
1#
2# CDDL HEADER START
3#
4# The contents of this file are subject to the terms of the
5# Common Development and Distribution License (the "License").
6# You may not use this file except in compliance with the License.
7#
8# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9# or http://www.opensolaris.org/os/licensing.
10# See the License for the specific language governing permissions
11# and limitations under the License.
12#
13# When distributing Covered Code, include this CDDL HEADER in each
14# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15# If applicable, add the following below this CDDL HEADER, with the
16# fields enclosed by brackets "[]" replaced with your own identifying
17# information: Portions Copyright [yyyy] [name of copyright owner]
18#
19# CDDL HEADER END
20#
21
22#
23# Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
24# Copyright (c) 2018, Joyent, Inc.
25#
26
27PROG= savecore
28OBJS= savecore.o compress.o
29
30include ../Makefile.cmd
31include ../Makefile.cmd.64
32
33CSTD = $(CSTD_GNU99)
34
35CFLAGS += $(CCVERBOSE)
36CPPFLAGS += -DBZ_NO_STDIO -I$(SRC)/common -I$(SRC)/uts/common
37
38LDLIBS += -L$(ROOT)/usr/lib/fm/64 -lfmevent -lnvpair
39LDFLAGS += -R/usr/lib/fm/64
40
41# not linted
42SMATCH=off
43
44#
45# savecore is compiled with bits from $(SRC)/common/bzip2 and some function
46# symbols there are defined as weak; if you leave them out of
47# savecore.c it will compile, but trying to call that function
48# will jump to 0.  So we use -ztext to avoid that.
49#
50LDFLAGS += $(ZTEXT)
51
52BZIP2OBJS =	bz2blocksort.o	\
53		bz2compress.o	\
54		bz2decompress.o	\
55		bz2randtable.o	\
56		bz2bzlib.o	\
57		bz2crctable.o	\
58		bz2huffman.o
59
60.KEEP_STATE:
61
62all: $(PROG)
63
64install: all $(ROOTPROG)
65
66$(PROG): $(OBJS) $(BZIP2OBJS)
67	$(LINK.c) -o $(PROG) $(OBJS) $(BZIP2OBJS) $(LDLIBS)
68	$(POST_PROCESS)
69
70clean:
71	$(RM) $(OBJS) $(BZIP2OBJS)
72
73include ../Makefile.targ
74
75%.o: ../../uts/common/os/%.c
76	$(COMPILE.c) $<
77	$(POST_PROCESS_O)
78
79bz2%.o: ../../common/bzip2/%.c
80	$(COMPILE.c) -o $@ -I$(SRC)/common/bzip2 $<
81	$(POST_PROCESS_O)
82