xref: /illumos-gate/usr/src/test/header-tests/tests/cxx-symbols/Makefile (revision f9db9ff779c49e6c6c53004fb478ca21c4cbdb57)
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 2014 Garrett D'Amore <garrett@damore.org>
14# Copyright 2018, Joyent, Inc.
15# Copyright 2026 Gordon W. Ross
16#
17
18include $(SRC)/Makefile.master
19
20TESTSUBDIR = cxx-symbols
21
22include ../Makefile.com
23
24KSHPROG = setup
25
26LINKS = \
27	cmath_h \
28	cstdio_h \
29	cstdlib_h \
30	cstring_h \
31	ctime_h \
32	cwchar_h
33
34CMDS =	$(LINKS:%=$(TESTDIR)/%) \
35	$(KSHPROG:%=$(TESTDIR)/%)
36
37all: $(KSHPROG)
38
39install:  $(TESTDIR) $(CMDS)
40
41clobber: clean
42	-$(RM) $(KSHPROG)
43
44clean:
45
46$(KSHPROG): $(KSHPROG).ksh
47	$(RM) $@
48	$(CP) $(KSHPROG).ksh $(@)
49	$(CHMOD) +x $@
50
51$(LINKS:%=$(TESTDIR)/%): $(TESTDIR)/setup
52	-$(RM) $@
53	$(LN) $(TESTDIR)/setup $@
54
55# Handy rule for running tests from the proto area.
56# Eg. make ucontext_h.run RUNOPTS=-D
57RUNLINKS=$(LINKS:%=%.run)
58RUNOPTS=
59test: $(RUNLINKS)
60
61%.run: $(TESTDIR)/%
62	( export HEADER_TEST_ROOT=$(ROOT) ;\
63	cd $(TESTDIR) && ./$* $(RUNOPTS) )
64