xref: /illumos-gate/usr/src/test/util-tests/tests/libjedec/hex2spd/Makefile (revision bf05540c1d1b319d8e1d40f0e2fd9e84c5d2389e)
1*bf05540cSRobert Mustacchi#
2*bf05540cSRobert Mustacchi# This file and its contents are supplied under the terms of the
3*bf05540cSRobert Mustacchi# Common Development and Distribution License ("CDDL"), version 1.0.
4*bf05540cSRobert Mustacchi# You may only use this file in accordance with the terms of version
5*bf05540cSRobert Mustacchi# 1.0 of the CDDL.
6*bf05540cSRobert Mustacchi#
7*bf05540cSRobert Mustacchi# A full copy of the text of the CDDL should have accompanied this
8*bf05540cSRobert Mustacchi# source.  A copy of the CDDL is also available via the Internet at
9*bf05540cSRobert Mustacchi# http://www.illumos.org/license/CDDL.
10*bf05540cSRobert Mustacchi#
11*bf05540cSRobert Mustacchi
12*bf05540cSRobert Mustacchi#
13*bf05540cSRobert Mustacchi# Copyright 2024 Oxide Computer Company
14*bf05540cSRobert Mustacchi#
15*bf05540cSRobert Mustacchi
16*bf05540cSRobert MustacchiPROGS = libjedec_hex2spd
17*bf05540cSRobert MustacchiOBJS = \
18*bf05540cSRobert Mustacchi	libjedec_hex2spd.o	\
19*bf05540cSRobert Mustacchi	libjedec_hex2spd_ddr3.o	\
20*bf05540cSRobert Mustacchi	libjedec_hex2spd_ddr4.o	\
21*bf05540cSRobert Mustacchi	libjedec_hex2spd_ddr5.o	\
22*bf05540cSRobert Mustacchi	libjedec_hex2spd_lp3.o	\
23*bf05540cSRobert Mustacchi	libjedec_hex2spd_lp4.o	\
24*bf05540cSRobert Mustacchi	libjedec_hex2spd_lp5.o
25*bf05540cSRobert MustacchiSPD = \
26*bf05540cSRobert Mustacchi	ddr3/M393B4G70BM0-CMA09.spd		\
27*bf05540cSRobert Mustacchi	ddr3/MT36KSZF2G72LDZ-1G6E2A7.spd	\
28*bf05540cSRobert Mustacchi	ddr4/36ASF8G72PZ-3G2E1.spd		\
29*bf05540cSRobert Mustacchi	ddr4/AQD-D4U32N32-SBW.spd		\
30*bf05540cSRobert Mustacchi	ddr4/AQD-SD4U16GN32-SE1.spd		\
31*bf05540cSRobert Mustacchi	ddr4/M386AAK40B40-CWD70.spd		\
32*bf05540cSRobert Mustacchi	ddr5/AQD-D5V16GR48-SB.spd		\
33*bf05540cSRobert Mustacchi	ddr5/MTC40F2046S1RC48BA1.spd		\
34*bf05540cSRobert Mustacchi	lpddr3/NT6CL256T32CQ.spd		\
35*bf05540cSRobert Mustacchi	lpddr4/MT53D1024M32D4.spd		\
36*bf05540cSRobert Mustacchi	lpddr5/CAMM2.spd			\
37*bf05540cSRobert Mustacchi	lpddr5/MT62F4G32D8DV-023.spd
38*bf05540cSRobert MustacchiSPDDIR = ddr3 ddr4 ddr5 lpddr3 lpddr4 lpddr5
39*bf05540cSRobert Mustacchi
40*bf05540cSRobert MustacchiPROGS32 = $(PROGS:%=%.32)
41*bf05540cSRobert MustacchiPROGS64 = $(PROGS:%=%.64)
42*bf05540cSRobert MustacchiOBJS32 = $(OBJS:%.o=%.32.o)
43*bf05540cSRobert MustacchiOBJS64 = $(OBJS:%.o=%.64.o)
44*bf05540cSRobert Mustacchi
45*bf05540cSRobert MustacchiROOTOPTDIR = $(ROOT)/opt/util-tests/tests
46*bf05540cSRobert MustacchiROOTOPTPROGS = $(PROGS32:%=$(ROOTOPTDIR)/%) $(PROGS64:%=$(ROOTOPTDIR)/%)
47*bf05540cSRobert MustacchiROOTOPTHEX = $(ROOTOPTDIR)/hex2spd
48*bf05540cSRobert MustacchiROOTHEXDIRS = $(SPDDIR:%=$(ROOTOPTHEX)/%)
49*bf05540cSRobert MustacchiROOTHEXSPD = $(SPD:%=$(ROOTOPTHEX)/%)
50*bf05540cSRobert Mustacchi
51*bf05540cSRobert Mustacchi$(ROOTOPTPROGS) := FILEMODE = 0555
52*bf05540cSRobert Mustacchi$(ROOTHEXSPD) := FILEMODE = 0444
53*bf05540cSRobert Mustacchi
54*bf05540cSRobert Mustacchiinclude $(SRC)/cmd/Makefile.cmd
55*bf05540cSRobert Mustacchiinclude $(SRC)/cmd/Makefile.ctf
56*bf05540cSRobert Mustacchi
57*bf05540cSRobert MustacchiCSTD = $(GNU_C99)
58*bf05540cSRobert MustacchiCTF_MODE = link
59*bf05540cSRobert MustacchiLDLIBS += -ljedec -lnvpair
60*bf05540cSRobert MustacchiLDLIBS64 += -ljedec -lnvpair
61*bf05540cSRobert Mustacchi
62*bf05540cSRobert Mustacchi.KEEP_STATE:
63*bf05540cSRobert Mustacchi
64*bf05540cSRobert Mustacchiall: $(PROGS32) $(PROGS64)
65*bf05540cSRobert Mustacchi
66*bf05540cSRobert Mustacchiinstall: $(ROOTOPTPROGS) $(ROOTHEXSPD)
67*bf05540cSRobert Mustacchi
68*bf05540cSRobert Mustacchiclean:
69*bf05540cSRobert Mustacchi	$(RM) *.o
70*bf05540cSRobert Mustacchi
71*bf05540cSRobert Mustacchiclobber: clean
72*bf05540cSRobert Mustacchi	$(RM) $(PROGS32) $(PROGS64)
73*bf05540cSRobert Mustacchi
74*bf05540cSRobert Mustacchi$(ROOTOPTPROGS): $(ROOTOPTHEX)
75*bf05540cSRobert Mustacchi
76*bf05540cSRobert Mustacchi$(ROOTHEXSPD): $(ROOTHEXDIRS)
77*bf05540cSRobert Mustacchi
78*bf05540cSRobert Mustacchi$(ROOTOPTHEX):
79*bf05540cSRobert Mustacchi	$(INS.dir)
80*bf05540cSRobert Mustacchi
81*bf05540cSRobert Mustacchi$(ROOTHEXDIRS): $(ROOTOPTHEX)
82*bf05540cSRobert Mustacchi	$(INS.dir)
83*bf05540cSRobert Mustacchi
84*bf05540cSRobert Mustacchi$(ROOTOPTDIR)/%: %
85*bf05540cSRobert Mustacchi	$(INS.file)
86*bf05540cSRobert Mustacchi
87*bf05540cSRobert Mustacchi$(ROOTOPTHEX)/%: data/%
88*bf05540cSRobert Mustacchi	$(INS.file)
89*bf05540cSRobert Mustacchi
90*bf05540cSRobert Mustacchi%.32.o: %.c
91*bf05540cSRobert Mustacchi	$(COMPILE.c) -o $@ $<
92*bf05540cSRobert Mustacchi	$(POST_PROCESS_O)
93*bf05540cSRobert Mustacchi
94*bf05540cSRobert Mustacchi%.64.o: %.c
95*bf05540cSRobert Mustacchi	$(COMPILE64.c) -o $@ $<
96*bf05540cSRobert Mustacchi	$(POST_PROCESS_O)
97*bf05540cSRobert Mustacchi
98*bf05540cSRobert Mustacchi%.64: $(OBJS64)
99*bf05540cSRobert Mustacchi	$(LINK64.c) -o $@ $(OBJS64) $(LDLIBS64)
100*bf05540cSRobert Mustacchi	$(POST_PROCESS)
101*bf05540cSRobert Mustacchi
102*bf05540cSRobert Mustacchi%.32: $(OBJS32)
103*bf05540cSRobert Mustacchi	$(LINK.c) -o $@ $(OBJS32) $(LDLIBS)
104*bf05540cSRobert Mustacchi	$(POST_PROCESS)
105