xref: /illumos-gate/usr/src/test/libc-tests/tests/Makefile (revision 851677fbe21ab9cad62cea9e299167ea661fd1c8)
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	err \
24	fexecve \
25	fpround \
26	i18n \
27	newlocale \
28	nl_langinfo \
29	priv_gettext \
30	qsort \
31	random \
32	regex \
33	select \
34	stdio \
35	symbols \
36	threads \
37	wcsrtombs \
38	wctype
39
40PROGS = \
41	aligned_alloc \
42	asprintf-14933 \
43	c11_threads \
44	c11_tss \
45	call_once \
46	closefrom \
47	endian \
48	env-7076 \
49	fnmatch \
50	isatty \
51	memchr \
52	memset_s \
53	mutex-16200 \
54	posix_memalign \
55	printf-15294 \
56	printf-9511 \
57	psignal-5097 \
58	quick_exit_order \
59	quick_exit_status \
60	set_constraint_handler_s \
61	strcoll-strxfrm-6907 \
62	strerror \
63	strtonum \
64	timespec_get \
65	wcsncasecmp \
66	wcsncasecmp-7344 \
67	wcsncasecmp-7350 \
68	uchar \
69	utimes
70
71SCRIPTS = \
72	quick_exit \
73	psignal
74
75CPPFLAGS += -D_REENTRANT
76
77PROGS32 = $(PROGS:%=%.32)
78PROGS64 = \
79	$(PROGS:%=%.64) \
80	printf-6961.64
81
82aligned_alloc.32 :=	LDLIBS += -lproc
83aligned_alloc.64 :=	LDLIBS64 += -lproc
84posix_memalign.32 :=	LDLIBS += -lproc
85posix_memalign.64 :=	LDLIBS64 += -lproc
86
87asprintf-14933.32 :=	CSTD=$(GNU_C99)
88asprintf-14933.64 :=	CSTD=$(GNU_C99)
89
90memset_s.32 :=	CPPFLAGS += -D__STDC_WANT_LIB_EXT1__=1
91memset_s.64 :=	CPPFLAGS += -D__STDC_WANT_LIB_EXT1__=1
92set_constraint_handler_s.32 := CPPFLAGS += -D__STDC_WANT_LIB_EXT1__=1
93set_constraint_handler_s.64 := CPPFLAGS += -D__STDC_WANT_LIB_EXT1__=1
94
95isatty.32 :=	CSTD=$(GNU_C99)
96isatty.64 :=	CSTD=$(GNU_C99)
97
98mutex-16200.32 :=	LDLIBS += -lproc
99mutex-16200.64 :=	LDLIBS64 += -lproc
100mutex-16200.32 :=	CSTD=$(GNU_C99)
101mutex-16200.64 :=	CSTD=$(GNU_C99)
102
103strtonum.32 :=		CSTD=$(GNU_C99)
104strtonum.64 :=		CSTD=$(GNU_C99)
105
106ROOTOPTDIR = $(ROOT)/opt/libc-tests/tests
107ROOTOPTPROGS = $(PROGS32:%=$(ROOTOPTDIR)/%) \
108	$(PROGS64:%=$(ROOTOPTDIR)/%) \
109	$(SCRIPTS:%=$(ROOTOPTDIR)/%)
110
111include $(SRC)/cmd/Makefile.cmd
112
113all     :=      TARGET = all
114install :=      TARGET = install
115clean   :=      TARGET = clean
116clobber :=      TARGET = clobber
117lint    :=      TARGET = lint
118
119.KEEP_STATE:
120
121install: $(SUBDIRS) $(ROOTOPTPROGS)
122
123all: $(SUBDIRS) $(PROGS32) $(PROGS64)
124
125clean lint: $(SUBDIRS)
126
127$(ROOTOPTPROGS): $(PROGS32) $(PROGS64) $(ROOTOPTDIR)
128
129$(ROOTOPTDIR):
130	$(INS.dir)
131
132$(ROOTOPTDIR)/%: %
133	$(INS.file)
134
135$(ROOTOPTDIR)/%: %.ksh
136	$(INS.rename)
137
138%.64: %.c
139	$(LINK64.c) -o $@ $< $(LDLIBS64)
140	$(POST_PROCESS)
141
142%.32: %.c
143	$(LINK.c) -o $@ $< $(LDLIBS)
144	$(POST_PROCESS)
145
146clobber: $(SUBDIRS)
147	$(RM) $(PROGS32) $(PROGS64)
148
149$(SUBDIRS): FRC
150	@cd $@; pwd; $(MAKE) $(TARGET)
151
152FRC:
153