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