xref: /illumos-gate/usr/src/test/util-tests/tests/smbios/Makefile (revision 8226594fdd4479be135127f43632f1f995074654)
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 (c) 2018, Joyent, Inc.
14# Copyright 2022 Oxide Computer Company
15#
16
17include $(SRC)/Makefile.master
18
19ROOTOPTPKG = $(ROOT)/opt/util-tests
20TESTDIR = $(ROOTOPTPKG)/tests/
21
22OBJS =	smbios.o \
23	smbios_test_chassis.o \
24	smbios_test_errors.o \
25	smbios_test_extmemdevice.o \
26	smbios_test_fwinfo.o \
27	smbios_test_memdevice.o \
28	smbios_test_proc.o \
29	smbios_test_pinfo.o \
30	smbios_test_slot.o \
31	smbios_test_strings.o \
32	smbios_test_strprop.o
33PROGS = smbios
34
35include $(SRC)/cmd/Makefile.cmd
36include $(SRC)/test/Makefile.com
37
38CMDS = $(PROGS:%=$(TESTDIR)/%)
39$(CMDS) := FILEMODE = 0555
40CSTD = $(GNU_C99)
41
42#
43# Since this program uses quite a number of variables declared on the
44# stack that are then written to by libsmbios, we opt to pay the cost
45# of always have the stack protector on every function as an additional
46# means of checking ourselves.
47#
48STACKPROTECT = all
49
50LDLIBS += -lsmbios -lumem
51CFLAGS += -_gcc=-Wall -_gcc=-Wextra -_gcc=-Wno-unknown-pragmas
52
53all: $(PROGS)
54
55install: all $(CMDS)
56
57clobber: clean
58	-$(RM) $(PROGS)
59
60clean:
61	-$(RM) $(OBJS)
62
63$(CMDS): $(TESTDIR) $(PROGS)
64
65$(TESTDIR):
66	$(INS.dir)
67
68$(TESTDIR)/%: %
69	$(INS.file)
70
71$(PROGS): $(OBJS)
72	$(LINK.c) -o $@ $(OBJS) $(LDLIBS)
73	$(POST_PROCESS)
74