xref: /illumos-gate/usr/src/test/util-tests/tests/libjedec/Makefile (revision 8119dad84d6416f13557b0ba8e2aaf9064cbcfd3)
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 2024 Oxide Computer Company
15#
16
17include $(SRC)/Makefile.master
18
19ROOTOPTPKG = $(ROOT)/opt/util-tests
20TESTDIR = $(ROOTOPTPKG)/tests/
21
22PROGS = libjedec_vendors libjedec_temp libjedec_spd
23PROGS32 = $(PROGS:%=%.32)
24PROGS64 = $(PROGS:%=%.64)
25
26ROOTOPTPROGS = $(PROGS32:%=$(TESTDIR)/%) \
27	$(PROGS64:%=$(TESTDIR)/%)
28
29include $(SRC)/cmd/Makefile.cmd
30include $(SRC)/test/Makefile.com
31
32SUBDIRS = hex2spd
33
34CMDS = $(PROGS:%=$(TESTDIR)/%)
35$(CMDS) := FILEMODE = 0555
36
37LDLIBS += -ljedec
38LDLIBS64 += -ljedec
39
40libjedec_spd.32		:= LDLIBS += -lnvpair
41libjedec_spd.64		:= LDLIBS64 += -lnvpair
42
43CSTD = $(GNU_C99)
44
45#
46# recursive support
47#
48all     :=      TARGET = all
49install :=      TARGET = install
50clean   :=      TARGET = clean
51clobber :=      TARGET = clobber
52
53$(SUBDIRS): FRC
54	cd $@; pwd; $(MAKE) $(TARGET)
55
56all: $(PROGS32) $(PROGS64) $(SUBDIRS)
57
58$(ROOTOPTPROGS): all
59
60install: all $(ROOTOPTPROGS) $(SUBDIRS)
61
62clobber: clean $(SUBDIRS)
63	-$(RM) $(PROGS32) $(PGROGS64)
64
65clean: $(SUBDIRS)
66
67$(CMDS): $(TESTDIR) $(PROG)
68
69$(TESTDIR):
70	$(INS.dir)
71
72$(TESTDIR)/%: %
73	$(INS.file)
74
75%.64: %.c
76	$(LINK64.c) -o $@ $< $(LDLIBS64)
77	$(POST_PROCESS)
78
79%.32: %.c
80	$(LINK.c) -o $@ $< $(LDLIBS)
81	$(POST_PROCESS)
82
83FRC:
84