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