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