xref: /illumos-gate/usr/src/cmd/pcieadm/Makefile (revision e8d3efa1c56e5f2b5368600a2baeb7b1d54a07f8)
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 2026 Oxide Computer Company
14#
15
16PROG= pcieadm
17
18include ../Makefile.cmd
19include ../Makefile.cmd.64
20include ../Makefile.ctf
21
22CFLAGS += $(CCVERBOSE)
23CSTD = $(CSTD_GNU17)
24CPPFLAGS += -I$(SRC)/uts/common/io/pciex
25LDLIBS += -ldevinfo -lpcidb -lofmt
26LDLIBS += -L$(ROOT)/usr/lib/fm/64 -R/usr/lib/fm/64 -ltopo
27OBJS = \
28	pcieadm.o \
29	pcieadm_bar.o \
30	pcieadm_cfgspace.o \
31	pcieadm_devs.o \
32	pcieadm_link.o \
33	bitext.o
34ROOTCMDDIR = $(ROOTLIB)/pci
35
36.KEEP_STATE:
37
38$(PROG): $(OBJS)
39	$(LINK.c) -o $@ $(OBJS) $(LDLIBS)
40	$(POST_PROCESS)
41
42%.o: %.c
43	$(COMPILE.c) $<
44	$(POST_PROCESS_O)
45
46%.o: $(SRC)/common/bitext/%.c
47	$(COMPILE.c) $<
48	$(POST_PROCESS_O)
49
50all: $(PROG)
51
52install: all $(ROOTCMD)
53
54clean:
55	$(RM) $(OBJS)
56
57include ../Makefile.targ
58