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