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 2025 Oxide Computer Company 14# 15 16PROGS = posix_spawn 17 18PROGS32 = $(PROGS:%=%.32) 19PROGS64 = $(PROGS:%=%.64) getsid.64 20 21ROOTOPTDIR = $(ROOT)/opt/libc-tests/tests 22ROOTOPTPROGS = $(PROGS32:%=$(ROOTOPTDIR)/%) \ 23 $(PROGS64:%=$(ROOTOPTDIR)/%) 24 25include $(SRC)/cmd/Makefile.cmd 26include $(SRC)/cmd/Makefile.ctf 27 28CSTD = $(CSTD_GNU17) 29CPPFLAGS += -D_REENTRANT 30CTF_MODE = link 31 32.KEEP_STATE: 33 34all: $(PROGS32) $(PROGS64) 35 36install: $(ROOTOPTPROGS) $(ROOTOPTDIR) 37 38$(ROOTOPTDIR): 39 $(INS.dir) 40 41$(ROOTOPTDIR)/%: % 42 $(INS.file) 43 44%.32.o: %.c 45 $(COMPILE.c) -o $@ $< 46 $(POST_PROCESS_O) 47 48%.32: %.32.o 49 $(LINK.c) -o $@ $< $(LDLIBS) 50 $(POST_PROCESS) 51 52%.64.o: %.c 53 $(COMPILE64.c) -o $@ $< 54 $(POST_PROCESS_O) 55 56%.64: %.64.o 57 $(LINK64.c) -o $@ $< $(LDLIBS64) 58 $(POST_PROCESS) 59 60clean: 61 $(RM) $(OBJS32) $(OBJS64) 62 63clobber: clean 64 $(RM) $(PROGS32) $(PROGS64) 65