xref: /illumos-gate/usr/src/cmd/pcieadm/Makefile (revision a94efd7875d6cf7ca97bb9188beaed3bf1282a49)
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)
24LDLIBS += -ldevinfo -lpcidb -lofmt
25LDLIBS += -L$(ROOT)/usr/lib/fm/64 -R/usr/lib/fm/64 -ltopo
26OBJS = \
27	pcieadm.o \
28	pcieadm_bar.o \
29	pcieadm_cfgspace.o \
30	pcieadm_devs.o \
31	bitext.o
32ROOTCMDDIR = $(ROOTLIB)/pci
33
34.KEEP_STATE:
35
36$(PROG): $(OBJS)
37	$(LINK.c) -o $@ $(OBJS) $(LDLIBS)
38	$(POST_PROCESS)
39
40%.o: %.c
41	$(COMPILE.c) $<
42	$(POST_PROCESS_O)
43
44%.o: $(SRC)/common/bitext/%.c
45	$(COMPILE.c) $<
46	$(POST_PROCESS_O)
47
48all: $(PROG)
49
50install: all $(ROOTCMD)
51
52clean:
53	$(RM) $(OBJS)
54
55include ../Makefile.targ
56