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 2022 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_nps.o \ 32 zen_umc_test_remap.o 33 34# 35# Common objects that we need. 36# 37OBJS += zen_fabric_utils.o zen_umc_decode.o bitext.o 38 39PROG = zen_umc_test 40 41include $(SRC)/cmd/Makefile.cmd 42include $(SRC)/test/Makefile.com 43include $(SRC)/cmd/Makefile.ctf 44 45CSTD = $(CSTD_GNU99) 46# 47# Ensure we always build with asserts. The first -I gives us access to 48# the zen_umc.h pieces while the second gives us the registers that are 49# required (dependency of the zen_umc.h header). 50# 51CPPFLAGS += -DDEBUG 52CPPFLAGS += -I$(SRC)/uts/intel/io/amdzen 53CPPFLAGS += -I$(SRC)/uts/intel/ 54 55CMDS = $(PROG:%=$(TESTDIR)/%) 56$(CMDS) := FILEMODE = 0555 57 58all: $(PROG) 59 60install: all $(CMDS) 61 62clobber: clean 63 -$(RM) $(PROG) 64 65clean: 66 -$(RM) *.o 67 68$(CMDS): $(TESTDIR) $(PROG) 69 70$(TESTDIR): 71 $(INS.dir) 72 73$(TESTDIR)/%: % 74 $(INS.file) 75 76$(PROG): $(OBJS) 77 $(LINK.c) -o $@ $(OBJS) $(LDLIBS) 78 $(POST_PROCESS) 79 80%.o: %.c 81 $(COMPILE.c) $< 82 $(POST_PROCESS_O) 83 84%.o: $(SRC)/common/bitext/%.c 85 $(COMPILE.c) $< 86 $(POST_PROCESS_O) 87 88%.o: $(SRC)/common/mc/zen_umc/%.c 89 $(COMPILE.c) $< 90 $(POST_PROCESS_O) 91