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