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