15103e761SPatrick Mooney# 25103e761SPatrick Mooney# This file and its contents are supplied under the terms of the 35103e761SPatrick Mooney# Common Development and Distribution License ("CDDL"), version 1.0. 45103e761SPatrick Mooney# You may only use this file in accordance with the terms of version 55103e761SPatrick Mooney# 1.0 of the CDDL. 65103e761SPatrick Mooney# 75103e761SPatrick Mooney# A full copy of the text of the CDDL should have accompanied this 85103e761SPatrick Mooney# source. A copy of the CDDL is also available via the Internet at 95103e761SPatrick Mooney# http://www.illumos.org/license/CDDL. 105103e761SPatrick Mooney# 115103e761SPatrick Mooney 12717646f7SJordan Paige Hendricks# Copyright 2023 Oxide Computer Company 135103e761SPatrick Mooney 145103e761SPatrick Mooneyinclude $(SRC)/cmd/Makefile.cmd 155103e761SPatrick Mooneyinclude $(SRC)/cmd/Makefile.cmd.64 165103e761SPatrick Mooneyinclude $(SRC)/test/Makefile.com 175103e761SPatrick Mooney 185103e761SPatrick MooneyPROG = vpmtmr_freq \ 195103e761SPatrick Mooney vhpet_freq \ 205103e761SPatrick Mooney vlapic_freq \ 215103e761SPatrick Mooney vlapic_freq_periodic \ 22d2f938fdSPatrick Mooney vlapic_mmio_access \ 23d2f938fdSPatrick Mooney vlapic_msr_access \ 24*a1d41cf9SPatrick Mooney vatpit_freq \ 25*a1d41cf9SPatrick Mooney vrtc_ops 265103e761SPatrick Mooney 27717646f7SJordan Paige Hendricks# These should probably go in the `vmm` tests, but since they depend on 28717646f7SJordan Paige Hendricks# in-guest payloads, it is easier to build them here. 29717646f7SJordan Paige HendricksPROG += guest_tsc_adjust \ 30717646f7SJordan Paige Hendricks tsc_freq_ctrl \ 31717646f7SJordan Paige Hendricks wrmsr_tsc \ 32717646f7SJordan Paige Hendricks rdmsr_tsc 33717646f7SJordan Paige Hendricks 345103e761SPatrick MooneyPAYLOADS = $(PROG) 355103e761SPatrick Mooneyinclude ../Makefile.in_guest 365103e761SPatrick Mooney 37717646f7SJordan Paige HendricksCOMMON_OBJS = in_guest.o common.o 385103e761SPatrick Mooney 395103e761SPatrick MooneyCLEANFILES = $(COMMON_OBJS) $(PAYLOAD_CLEANFILES) payload_utils.o 405103e761SPatrick MooneyCLOBBERFILES = $(PROG) 415103e761SPatrick Mooney 425103e761SPatrick MooneyROOTOPTPKG = $(ROOT)/opt/bhyve-tests 435103e761SPatrick MooneyTESTDIR = $(ROOTOPTPKG)/tests/kdev 445103e761SPatrick Mooney 455103e761SPatrick MooneyCMDS = $(PROG:%=$(TESTDIR)/%) 465103e761SPatrick Mooney$(CMDS) := FILEMODE = 0555 475103e761SPatrick Mooney 485103e761SPatrick MooneyCSTD= $(CSTD_GNU99) 495103e761SPatrick MooneyCPPFLAGS = -I$(COMPAT)/bhyve -I$(CONTRIB)/bhyve \ 505103e761SPatrick Mooney -I$(COMPAT)/bhyve/amd64 -I$(CONTRIB)/bhyve/amd64 \ 515103e761SPatrick Mooney $(CPPFLAGS.master) \ 527c8c0b82SPatrick Mooney -I$(SRC)/uts/intel/io/vmm \ 537c8c0b82SPatrick Mooney -I$(SRC)/uts/intel \ 545103e761SPatrick Mooney -I../common 555103e761SPatrick Mooney 565d9d9091SRichard LoweASFLAGS += -D_ASM 575d9d9091SRichard LoweASFLAGS64 += -D_ASM 585103e761SPatrick Mooney 595103e761SPatrick Mooney 605103e761SPatrick MooneyCFLAGS = -m64 615103e761SPatrick Mooney$(PROG) := LDLIBS += -lvmmapi 625103e761SPatrick Mooney 635103e761SPatrick Mooneyall: $(PROG) 645103e761SPatrick Mooney 655103e761SPatrick Mooneyinstall: all $(CMDS) 665103e761SPatrick Mooney 675103e761SPatrick Mooneyclean: 685103e761SPatrick Mooney -$(RM) $(CLEANFILES) 695103e761SPatrick Mooneyclobber: clean 705103e761SPatrick Mooney -$(RM) $(CLOBBERFILES) 715103e761SPatrick Mooney 725103e761SPatrick Mooney$(CMDS): $(TESTDIR) $(PROG) 735103e761SPatrick Mooney 745103e761SPatrick Mooney$(TESTDIR): 755103e761SPatrick Mooney $(INS.dir) 765103e761SPatrick Mooney 775103e761SPatrick Mooney$(TESTDIR)/%: % 785103e761SPatrick Mooney $(INS.file) 795103e761SPatrick Mooney 805103e761SPatrick Mooney%: %.c pobj_%.o $(COMMON_OBJS) 815103e761SPatrick Mooney $(LINK.c) -o $@ $^ $(LDLIBS) 825103e761SPatrick Mooney $(POST_PROCESS) 835103e761SPatrick Mooney 845103e761SPatrick Mooney%: %.o 855103e761SPatrick Mooney $(LINK.c) -o $@ $^ $(LDLIBS) 865103e761SPatrick Mooney $(POST_PROCESS) 875103e761SPatrick Mooney 885103e761SPatrick Mooney$(PAYLOADS:%=payload_%): payload_utils.o 89