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# 16 17include $(SRC)/Makefile.master 18 19TESTSUBDIR = c-symbols 20 21include ../Makefile.com 22 23KSHPROG = setup 24 25LINKS = \ 26 assert_h \ 27 ctype_h \ 28 dirent_h \ 29 fcntl_h \ 30 locale_h \ 31 math_h \ 32 netdb_h \ 33 pthread_h \ 34 stdalign_h \ 35 stddef_h \ 36 signal_h \ 37 stdio_h \ 38 stdlib_h \ 39 stdnoreturn_h \ 40 string_h \ 41 strings_h \ 42 sys_atomic_h \ 43 sys_mman_h \ 44 sys_stat_h \ 45 sys_time_h \ 46 sys_timeb_h \ 47 time_h \ 48 threads_h \ 49 ucontext_h \ 50 unistd_h \ 51 wchar_h \ 52 wctype_h 53 54CMDS = $(LINKS:%=$(TESTDIR)/%) \ 55 $(KSHPROG:%=$(TESTDIR)/%) 56 57all: $(KSHPROG) 58 59install: $(TESTDIR) $(CMDS) 60 61clobber: clean 62 -$(RM) $(KSHPROG) 63 64clean: 65 66$(KSHPROG): $(KSHPROG).ksh 67 $(RM) $@ 68 $(CP) $(KSHPROG).ksh $(@) 69 $(CHMOD) +x $@ 70 71$(LINKS:%=$(TESTDIR)/%): $(TESTDIR)/setup 72 -$(RM) $@ 73 $(LN) $(TESTDIR)/setup $@ 74 75# Handy rule for running tests from the proto area. 76# Eg. make ucontext_h.run RUNOPTS=-D 77RUNLINKS=$(LINKS:%=%.run) 78RUNOPTS= 79test: $(RUNLINKS) 80 81%.run: $(TESTDIR)/% 82 ( export HEADER_TEST_ROOT=$(ROOT) ;\ 83 cd $(TESTDIR) && ./$* $(RUNOPTS) ) 84