xref: /illumos-gate/usr/src/test/libc-tests/tests/Makefile (revision 72af5a458c3acde8fe8b432dc826b8b100d005d1)
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	quick_exit \
74	psignal
75
76CPPFLAGS += -D_REENTRANT
77
78PROGS32 = $(PROGS:%=%.32)
79PROGS64 = \
80	$(PROGS:%=%.64) \
81	printf-6961.64
82
83aligned_alloc.32 :=	LDLIBS += -lproc
84aligned_alloc.64 :=	LDLIBS64 += -lproc
85posix_memalign.32 :=	LDLIBS += -lproc
86posix_memalign.64 :=	LDLIBS64 += -lproc
87
88asprintf-14933.32 :=	CSTD=$(GNU_C99)
89asprintf-14933.64 :=	CSTD=$(GNU_C99)
90
91memset_s.32 :=	CPPFLAGS += -D__STDC_WANT_LIB_EXT1__=1
92memset_s.64 :=	CPPFLAGS += -D__STDC_WANT_LIB_EXT1__=1
93set_constraint_handler_s.32 := CPPFLAGS += -D__STDC_WANT_LIB_EXT1__=1
94set_constraint_handler_s.64 := CPPFLAGS += -D__STDC_WANT_LIB_EXT1__=1
95
96isatty.32 :=	CSTD=$(GNU_C99)
97isatty.64 :=	CSTD=$(GNU_C99)
98
99mutex-16200.32 :=	LDLIBS += -lproc
100mutex-16200.64 :=	LDLIBS64 += -lproc
101mutex-16200.32 :=	CSTD=$(GNU_C99)
102mutex-16200.64 :=	CSTD=$(GNU_C99)
103
104strtonum.32 :=		CSTD=$(GNU_C99)
105strtonum.64 :=		CSTD=$(GNU_C99)
106
107ROOTOPTDIR = $(ROOT)/opt/libc-tests/tests
108ROOTOPTPROGS = $(PROGS32:%=$(ROOTOPTDIR)/%) \
109	$(PROGS64:%=$(ROOTOPTDIR)/%) \
110	$(SCRIPTS:%=$(ROOTOPTDIR)/%)
111
112include $(SRC)/cmd/Makefile.cmd
113
114all     :=      TARGET = all
115install :=      TARGET = install
116clean   :=      TARGET = clean
117clobber :=      TARGET = clobber
118lint    :=      TARGET = lint
119
120.KEEP_STATE:
121
122install: $(SUBDIRS) $(ROOTOPTPROGS)
123
124all: $(SUBDIRS) $(PROGS32) $(PROGS64)
125
126clean lint: $(SUBDIRS)
127
128$(ROOTOPTPROGS): $(PROGS32) $(PROGS64) $(ROOTOPTDIR)
129
130$(ROOTOPTDIR):
131	$(INS.dir)
132
133$(ROOTOPTDIR)/%: %
134	$(INS.file)
135
136$(ROOTOPTDIR)/%: %.ksh
137	$(INS.rename)
138
139%.64: %.c
140	$(LINK64.c) -o $@ $< $(LDLIBS64)
141	$(POST_PROCESS)
142
143%.32: %.c
144	$(LINK.c) -o $@ $< $(LDLIBS)
145	$(POST_PROCESS)
146
147clobber: $(SUBDIRS)
148	$(RM) $(PROGS32) $(PROGS64)
149
150$(SUBDIRS): FRC
151	@cd $@; pwd; $(MAKE) $(TARGET)
152
153FRC:
154