xref: /illumos-gate/usr/src/test/libc-tests/tests/Makefile (revision b7a7784945b3504d0b69ea02a08e1cddb5578907)
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
19SUBDIRS = \
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
36PROGS = \
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
59SCRIPTS = \
60	quick_exit \
61	psignal
62
63CPPFLAGS += -D_REENTRANT
64
65PROGS32 = $(PROGS:%=%.32)
66PROGS64 = \
67	$(PROGS:%=%.64) \
68	printf-6961.64
69
70aligned_alloc.32 :=	LDLIBS += -lproc
71aligned_alloc.64 :=	LDLIBS64 += -lproc
72posix_memalign.32 :=	LDLIBS += -lproc
73posix_memalign.64 :=	LDLIBS64 += -lproc
74
75memset_s.32 :=	CPPFLAGS += -D__STDC_WANT_LIB_EXT1__=1
76memset_s.64 :=	CPPFLAGS += -D__STDC_WANT_LIB_EXT1__=1
77set_constraint_handler_s.32 := CPPFLAGS += -D__STDC_WANT_LIB_EXT1__=1
78set_constraint_handler_s.64 := CPPFLAGS += -D__STDC_WANT_LIB_EXT1__=1
79
80ROOTOPTDIR = $(ROOT)/opt/libc-tests/tests
81ROOTOPTPROGS = $(PROGS32:%=$(ROOTOPTDIR)/%) \
82	$(PROGS64:%=$(ROOTOPTDIR)/%) \
83	$(SCRIPTS:%=$(ROOTOPTDIR)/%)
84
85include $(SRC)/cmd/Makefile.cmd
86
87all     :=      TARGET = all
88install :=      TARGET = install
89clean   :=      TARGET = clean
90clobber :=      TARGET = clobber
91lint    :=      TARGET = lint
92
93.KEEP_STATE:
94
95install: $(SUBDIRS) $(ROOTOPTPROGS)
96
97all: $(SUBDIRS) $(PROGS32) $(PROGS64)
98
99clean 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
120clobber: $(SUBDIRS)
121	$(RM) $(PROGS32) $(PROGS64)
122
123$(SUBDIRS): FRC
124	@cd $@; pwd; $(MAKE) $(TARGET)
125
126FRC:
127