xref: /illumos-gate/usr/src/cmd/fm/mcdecode/Makefile (revision dd23d762c65e503874085a3893fbd3df9688da30)
1#
2# This file and its contents are supplied under the terms of the
3# Common Development and Distribution License ("CDDL"), version 1.0.
4# You may only use this file in accordance with the terms of version
5# 1.0 of the CDDL.
6#
7# A full copy of the text of the CDDL should have accompanied this
8# source.  A copy of the CDDL is also available via the Internet at
9# http://www.illumos.org/license/CDDL.
10#
11
12#
13# Copyright 2019 Joyent, Inc.
14# Copyright 2023 Oxide Computer Company
15#
16
17include ../../Makefile.cmd
18include ../../Makefile.ctf
19
20SRCS += mcdecode.c imc_decode.c imc_dump.c
21SRCS += zen_fabric_utils.c zen_umc_decode.c zen_umc_dump.c bitext.o
22OBJS = $(SRCS:%.c=%.o)
23
24PROG = mcdecode
25
26ROOTLIBFM = $(ROOT)/usr/lib/fm
27ROOTLIBFMD = $(ROOT)/usr/lib/fm/fmd
28ROOTPROG = $(ROOTLIBFMD)/$(PROG)
29
30$(NOT_RELEASE_BUILD)CPPFLAGS += -DDEBUG
31CPPFLAGS += -I$(SRC)/uts/intel/io/imc
32CPPFLAGS += -I$(SRC)/uts/intel/io/amdzen -I$(SRC)/uts/intel
33LDLIBS += -lnvpair
34
35CSTD = $(CSTD_GNU99)
36
37all: $(PROG)
38
39$(PROG): $(OBJS)
40	$(LINK.c) $(OBJS) -o $@ $(LDLIBS)
41	$(POST_PROCESS)
42
43%.o: %.c
44	$(COMPILE.c) $<
45	$(POST_PROCESS_O)
46
47%.o: $(SRC)/common/bitext/%.c
48	$(COMPILE.c) $<
49	$(POST_PROCESS_O)
50
51%.o: $(SRC)/common/mc/imc/%.c
52	$(COMPILE.c) $<
53	$(POST_PROCESS_O)
54
55%.o: $(SRC)/common/mc/zen_umc/%.c
56	$(COMPILE.c) $<
57	$(POST_PROCESS_O)
58
59%.o: $(SRC)/common/amdzen/%.c
60	$(COMPILE.c) $<
61	$(POST_PROCESS_O)
62
63clean:
64	$(RM) $(OBJS) $(LINTFILES)
65
66clobber: clean
67	$(RM) $(PROG)
68
69$(ROOTLIBFMD)/%: %
70	$(INS.file)
71
72install_h:
73
74install: all $(ROOTPROG)
75