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