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 2020 OmniOS Community Edition (OmniOSce) Association.
  17 #
  18 
  19 SUBDIRS = \
  20         catopen \
  21         fpround \
  22         i18n \
  23         newlocale \
  24         nl_langinfo \
  25         priv_gettext \
  26         random \
  27         regex \
  28         select \
  29         stdio \
  30         strerror \
  31         symbols \
  32         threads \
  33         wcsrtombs \
  34         wctype
  35 
  36 PROGS = \
  37         aligned_alloc \
  38         c11_threads \
  39         c11_tss \
  40         call_once \
  41         endian \
  42         env-7076 \
  43         fnmatch \
  44         memset_s \
  45         posix_memalign \
  46         printf-9511 \
  47         psignal-5097 \
  48         quick_exit_order \
  49         quick_exit_status \
  50         set_constraint_handler_s \
  51         strcoll-strxfrm-6907 \
  52         timespec_get \
  53         wcsncasecmp \
  54         wcsncasecmp-7344 \
  55         wcsncasecmp-7350 \
  56         uchar \
  57         utimes
  58 
  59 SCRIPTS = \
  60         quick_exit \
  61         psignal
  62 
  63 CPPFLAGS += -D_REENTRANT
  64 
  65 PROGS32 = $(PROGS:%=%.32)
  66 PROGS64 = \
  67         $(PROGS:%=%.64) \
  68         printf-6961.64
  69 
  70 aligned_alloc.32 :=     LDLIBS += -lproc
  71 aligned_alloc.64 :=     LDLIBS64 += -lproc
  72 posix_memalign.32 :=    LDLIBS += -lproc
  73 posix_memalign.64 :=    LDLIBS64 += -lproc
  74 
  75 memset_s.32 :=  CPPFLAGS += -D__STDC_WANT_LIB_EXT1__=1
  76 memset_s.64 :=  CPPFLAGS += -D__STDC_WANT_LIB_EXT1__=1
  77 set_constraint_handler_s.32 := CPPFLAGS += -D__STDC_WANT_LIB_EXT1__=1
  78 set_constraint_handler_s.64 := CPPFLAGS += -D__STDC_WANT_LIB_EXT1__=1
  79 
  80 ROOTOPTDIR = $(ROOT)/opt/libc-tests/tests
  81 ROOTOPTPROGS = $(PROGS32:%=$(ROOTOPTDIR)/%) \
  82         $(PROGS64:%=$(ROOTOPTDIR)/%) \
  83         $(SCRIPTS:%=$(ROOTOPTDIR)/%)
  84 
  85 include $(SRC)/cmd/Makefile.cmd
  86 
  87 all     :=      TARGET = all
  88 install :=      TARGET = install
  89 clean   :=      TARGET = clean
  90 clobber :=      TARGET = clobber
  91 lint    :=      TARGET = lint
  92 
  93 .KEEP_STATE:
  94 
  95 install: $(SUBDIRS) $(ROOTOPTPROGS)
  96 
  97 all: $(SUBDIRS) $(PROGS32) $(PROGS64)
  98 
  99 clean lint: $(SUBDIRS)
 100 
 101 $(ROOTOPTPROGS): $(PROGS32) $(PROGS64) $(ROOTOPTDIR)
 102 
 103 $(ROOTOPTDIR):
 104         $(INS.dir)
 105 
 106 $(ROOTOPTDIR)/%: %
 107         $(INS.file)
 108 
 109 $(ROOTOPTDIR)/%: %.ksh
 110         $(INS.rename)
 111 
 112 %.64: %.c
 113         $(LINK64.c) -o $@ $< $(LDLIBS64)
 114         $(POST_PROCESS)
 115 
 116 %.32: %.c
 117         $(LINK.c) -o $@ $< $(LDLIBS)
 118         $(POST_PROCESS)
 119 
 120 clobber: $(SUBDIRS)
 121         $(RM) $(PROGS32) $(PROGS64)
 122 
 123 $(SUBDIRS): FRC
 124         @cd $@; pwd; $(MAKE) $(TARGET)
 125 
 126 FRC: