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 (c) 2012 by Delphix. All rights reserved. 14# Copyright 2015 Garrett D'Amore <garrett@damore.org> 15# Copyright 2019 Joyent, Inc. 16# Copyright 2022 OmniOS Community Edition (OmniOSce) Association. 17# Copyright 2023 Bill Sommerfeld <sommerfeld@alum.mit.edu> 18# Copyright 2024 Oxide Computer Company 19# 20 21SUBDIRS = \ 22 catopen \ 23 clocklock \ 24 err \ 25 fexecve \ 26 fpround \ 27 i18n \ 28 newlocale \ 29 nl_langinfo \ 30 priv_gettext \ 31 qsort \ 32 random \ 33 regex \ 34 select \ 35 stdio \ 36 symbols \ 37 threads \ 38 wcsrtombs \ 39 wctype 40 41PROGS = \ 42 aligned_alloc \ 43 ascftime \ 44 asprintf-14933 \ 45 c11_threads \ 46 c11_tss \ 47 call_once \ 48 closefrom \ 49 endian \ 50 env-7076 \ 51 fnmatch \ 52 isatty \ 53 memchr \ 54 memset_s \ 55 mutex-16200 \ 56 posix_memalign \ 57 printf-15294 \ 58 printf-9511 \ 59 psignal-5097 \ 60 quick_exit_order \ 61 quick_exit_status \ 62 set_constraint_handler_s \ 63 strcoll-strxfrm-6907 \ 64 strerror \ 65 strtonum \ 66 timespec_get \ 67 wcsncasecmp \ 68 wcsncasecmp-7344 \ 69 wcsncasecmp-7350 \ 70 uchar \ 71 utimes 72 73SCRIPTS = \ 74 aligned_alloc \ 75 quick_exit \ 76 psignal 77 78CPPFLAGS += -D_REENTRANT 79 80PROGS32 = $(PROGS:%=%.32) 81PROGS64 = \ 82 $(PROGS:%=%.64) \ 83 printf-6961.64 84 85aligned_alloc.32 := CSTD=$(GNU_C99) 86aligned_alloc.64 := CSTD=$(GNU_C99) 87aligned_alloc.32 := LDLIBS += -lproc 88aligned_alloc.64 := LDLIBS64 += -lproc 89posix_memalign.32 := LDLIBS += -lproc 90posix_memalign.64 := LDLIBS64 += -lproc 91 92asprintf-14933.32 := CSTD=$(GNU_C99) 93asprintf-14933.64 := CSTD=$(GNU_C99) 94 95memset_s.32 := CPPFLAGS += -D__STDC_WANT_LIB_EXT1__=1 96memset_s.64 := CPPFLAGS += -D__STDC_WANT_LIB_EXT1__=1 97set_constraint_handler_s.32 := CPPFLAGS += -D__STDC_WANT_LIB_EXT1__=1 98set_constraint_handler_s.64 := CPPFLAGS += -D__STDC_WANT_LIB_EXT1__=1 99 100isatty.32 := CSTD=$(GNU_C99) 101isatty.64 := CSTD=$(GNU_C99) 102 103mutex-16200.32 := LDLIBS += -lproc 104mutex-16200.64 := LDLIBS64 += -lproc 105mutex-16200.32 := CSTD=$(GNU_C99) 106mutex-16200.64 := CSTD=$(GNU_C99) 107 108strtonum.32 := CSTD=$(GNU_C99) 109strtonum.64 := CSTD=$(GNU_C99) 110 111ROOTOPTDIR = $(ROOT)/opt/libc-tests/tests 112ROOTOPTPROGS = $(PROGS32:%=$(ROOTOPTDIR)/%) \ 113 $(PROGS64:%=$(ROOTOPTDIR)/%) \ 114 $(SCRIPTS:%=$(ROOTOPTDIR)/%) 115 116include $(SRC)/cmd/Makefile.cmd 117 118all := TARGET = all 119install := TARGET = install 120clean := TARGET = clean 121clobber := TARGET = clobber 122lint := TARGET = lint 123 124.KEEP_STATE: 125 126install: $(SUBDIRS) $(ROOTOPTPROGS) 127 128all: $(SUBDIRS) $(PROGS32) $(PROGS64) 129 130clean lint: $(SUBDIRS) 131 132$(ROOTOPTPROGS): $(PROGS32) $(PROGS64) $(ROOTOPTDIR) 133 134$(ROOTOPTDIR): 135 $(INS.dir) 136 137$(ROOTOPTDIR)/%: % 138 $(INS.file) 139 140$(ROOTOPTDIR)/%: %.ksh 141 $(INS.rename) 142 143%.64: %.c 144 $(LINK64.c) -o $@ $< $(LDLIBS64) 145 $(POST_PROCESS) 146 147%.32: %.c 148 $(LINK.c) -o $@ $< $(LDLIBS) 149 $(POST_PROCESS) 150 151clobber: $(SUBDIRS) 152 $(RM) $(PROGS32) $(PROGS64) 153 154$(SUBDIRS): FRC 155 @cd $@; pwd; $(MAKE) $(TARGET) 156 157FRC: 158