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