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 2026 Oxide Computer Company 14# 15 16PROGS = \ 17 memlist_test 18 19PROGS32 = $(PROGS:%=%.32) 20PROGS64 = $(PROGS:%=%.64) 21 22COMOBJS = memlist_new.o 23COMOBJS32 = $(COMOBJS:.o=.32.o) 24COMOBJS64 = $(COMOBJS:.o=.64.o) 25 26ROOTOPTDIR = $(ROOT)/opt/os-tests/tests 27ROOTOPTMEMLIST = $(ROOTOPTDIR)/memlist 28ROOTOPTPROGS = $(PROGS32:%=$(ROOTOPTMEMLIST)/%) $(PROGS64:%=$(ROOTOPTMEMLIST)/%) 29 30include $(SRC)/cmd/Makefile.cmd 31include $(SRC)/cmd/Makefile.ctf 32 33CSTD = $(CSTD_GNU17) 34 35CTF_MODE = link 36 37CPPFLAGS.first += -I$(SRC)/lib/libfakekernel/common -D_FAKE_KERNEL 38CPPFLAGS += -I$(SRC)/uts/common 39CPPFLAGS += -DDEBUG 40 41LDLIBS += -lfakekernel 42LDLIBS64 += -lfakekernel 43 44.KEEP_STATE: 45 46all: $(PROGS32) $(PROGS64) 47 48install: $(ROOTOPTPROGS) 49 50clean: 51 $(RM) $(COMOBJS32) $(COMOBJS64) 52 53$(ROOTOPTPROGS): $(PROGS32) $(PROGS64) $(ROOTOPTMEMLIST) 54 55$(ROOTOPTDIR): 56 $(INS.dir) 57 58$(ROOTOPTMEMLIST): $(ROOTOPTDIR) 59 $(INS.dir) 60 61$(ROOTOPTMEMLIST)/%: % 62 $(INS.file) 63 64%.32: %.c $(COMOBJS32) 65 $(LINK.c) -o $@ $^ $(LDLIBS) 66 $(POST_PROCESS) 67 68%.64: %.c $(COMOBJS64) 69 $(LINK64.c) -o $@ $^ $(LDLIBS64) 70 $(POST_PROCESS) 71 72memlist_new.32.o: $(SRC)/uts/common/os/memlist_new.c 73 $(COMPILE.c) -o $@ $(SRC)/uts/common/os/memlist_new.c 74 $(POST_PROCESS_O) 75 76memlist_new.64.o: $(SRC)/uts/common/os/memlist_new.c 77 $(COMPILE64.c) -o $@ $(SRC)/uts/common/os/memlist_new.c 78 $(POST_PROCESS_O) 79 80clobber: clean 81 $(RM) $(PROGS32) $(PROGS64) 82 83FRC: 84