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 2024 Oxide Computer Company 14# 15 16ROOTOPTPKG = $(ROOT)/opt/os-tests 17TESTDIR = $(ROOTOPTPKG)/tests 18 19# 20# Test objects 21# 22OBJS = zen_umc_test.o \ 23 zen_umc_fabric_ids.o \ 24 zen_umc_test_basic.o \ 25 zen_umc_test_chans.o \ 26 zen_umc_test_cod.o \ 27 zen_umc_test_errors.o \ 28 zen_umc_test_hole.o \ 29 zen_umc_test_ilv.o \ 30 zen_umc_test_multi.o \ 31 zen_umc_test_np2_k.o \ 32 zen_umc_test_nps.o \ 33 zen_umc_test_nps_k.o \ 34 zen_umc_test_remap.o 35 36# 37# Common objects that we need. 38# 39OBJS += zen_fabric_utils.o zen_umc_decode.o bitext.o 40 41PROG = zen_umc_test 42 43include $(SRC)/cmd/Makefile.cmd 44include $(SRC)/test/Makefile.com 45include $(SRC)/cmd/Makefile.ctf 46 47CSTD = $(CSTD_GNU99) 48# 49# Ensure we always build with asserts. The first -I gives us access to 50# the zen_umc.h pieces while the second gives us the registers that are 51# required (dependency of the zen_umc.h header). 52# 53CPPFLAGS += -DDEBUG 54CPPFLAGS += -I$(SRC)/uts/intel/io/amdzen 55CPPFLAGS += -I$(SRC)/uts/intel/ 56 57CMDS = $(PROG:%=$(TESTDIR)/%) 58$(CMDS) := FILEMODE = 0555 59 60all: $(PROG) 61 62install: all $(CMDS) 63 64clobber: clean 65 -$(RM) $(PROG) 66 67clean: 68 -$(RM) *.o 69 70$(CMDS): $(TESTDIR) $(PROG) 71 72$(TESTDIR): 73 $(INS.dir) 74 75$(TESTDIR)/%: % 76 $(INS.file) 77 78$(PROG): $(OBJS) 79 $(LINK.c) -o $@ $(OBJS) $(LDLIBS) 80 $(POST_PROCESS) 81 82%.o: %.c 83 $(COMPILE.c) $< 84 $(POST_PROCESS_O) 85 86%.o: $(SRC)/common/bitext/%.c 87 $(COMPILE.c) $< 88 $(POST_PROCESS_O) 89 90%.o: $(SRC)/common/mc/zen_umc/%.c 91 $(COMPILE.c) $< 92 $(POST_PROCESS_O) 93 94%.o: $(SRC)/common/amdzen/%.c 95 $(COMPILE.c) $< 96 $(POST_PROCESS_O) 97