xref: /illumos-gate/usr/src/test/util-tests/tests/awk/Makefile (revision e6d6c189fa3a95d7aa27bbe0aeacf7c1a6b57c8c)
1*e6d6c189SCody Peter Mello#
2*e6d6c189SCody Peter Mello# This file and its contents are supplied under the terms of the
3*e6d6c189SCody Peter Mello# Common Development and Distribution License ("CDDL"), version 1.0.
4*e6d6c189SCody Peter Mello# You may only use this file in accordance with the terms of version
5*e6d6c189SCody Peter Mello# 1.0 of the CDDL.
6*e6d6c189SCody Peter Mello#
7*e6d6c189SCody Peter Mello# A full copy of the text of the CDDL should have accompanied this
8*e6d6c189SCody Peter Mello# source.  A copy of the CDDL is also available via the Internet at
9*e6d6c189SCody Peter Mello# http://www.illumos.org/license/CDDL.
10*e6d6c189SCody Peter Mello#
11*e6d6c189SCody Peter Mello
12*e6d6c189SCody Peter Mello#
13*e6d6c189SCody Peter Mello# Copyright 2018 Joyent, Inc.
14*e6d6c189SCody Peter Mello#
15*e6d6c189SCody Peter Mello
16*e6d6c189SCody Peter Melloinclude $(SRC)/cmd/Makefile.cmd
17*e6d6c189SCody Peter Melloinclude $(SRC)/test/Makefile.com
18*e6d6c189SCody Peter Mello
19*e6d6c189SCody Peter MelloDATA_FILES =		\
20*e6d6c189SCody Peter Mello	test.countries	\
21*e6d6c189SCody Peter Mello	test.data
22*e6d6c189SCody Peter Mello
23*e6d6c189SCody Peter MelloEXAMPLES_FILES :sh= (cd examples/awk; print p.* t.*)
24*e6d6c189SCody Peter Mello
25*e6d6c189SCody Peter MelloTESTS_FILES :sh= (cd tests; print T.* *.p *.ok chem.awk latin1)
26*e6d6c189SCody Peter Mello
27*e6d6c189SCody Peter MelloGNU_AWK :sh= (cd gnu; print *.awk)
28*e6d6c189SCody Peter MelloGNU_KSH :sh= (cd gnu; print *.sh)
29*e6d6c189SCody Peter MelloGNU_IN :sh= (cd gnu; print *.in)
30*e6d6c189SCody Peter Mello
31*e6d6c189SCody Peter Mello#
32*e6d6c189SCody Peter Mello# For the imported gnu/ tests, we have three different styles:
33*e6d6c189SCody Peter Mello#
34*e6d6c189SCody Peter Mello#   - AWK scripts with input
35*e6d6c189SCody Peter Mello#   - AWK scripts with no input
36*e6d6c189SCody Peter Mello#   - Shell scripts that run AWK scripts themselves
37*e6d6c189SCody Peter Mello#
38*e6d6c189SCody Peter Mello# All of these have a corresponding *.ok file, and we generate a *.awk
39*e6d6c189SCody Peter Mello# dependency from each *.in file to check for bad test setups.
40*e6d6c189SCody Peter Mello#
41*e6d6c189SCody Peter MelloGNU_FILES =	\
42*e6d6c189SCody Peter Mello	$(GNU_AWK) $(GNU_AWK:%.awk=%.ok) \
43*e6d6c189SCody Peter Mello	$(GNU_KSH) $(GNU_KSH:%.sh=%.ok) \
44*e6d6c189SCody Peter Mello	$(GNU_IN) $(GNU_KSH:%.in=%.awk) \
45*e6d6c189SCody Peter Mello	out1.ok out2.ok out3.ok # Used by messages.sh
46*e6d6c189SCody Peter Mello
47*e6d6c189SCody Peter MelloSYN_FILES :sh= (cd syn; print *.awk)
48*e6d6c189SCody Peter Mello
49*e6d6c189SCody Peter MelloROOTFILES =					\
50*e6d6c189SCody Peter Mello	$(DATA_FILES:%=$(TESTDIR)/data/%)	\
51*e6d6c189SCody Peter Mello	$(EXAMPLES_FILES:%=$(TESTDIR)/examples/awk/%) \
52*e6d6c189SCody Peter Mello	$(EXAMPLES_FILES:%=$(TESTDIR)/examples/out/%) \
53*e6d6c189SCody Peter Mello	$(TESTS_FILES:%=$(TESTDIR)/tests/%)	\
54*e6d6c189SCody Peter Mello	$(GNU_FILES:%=$(TESTDIR)/gnu/%)	\
55*e6d6c189SCody Peter Mello	$(SYN_FILES:%=$(TESTDIR)/syn/%) \
56*e6d6c189SCody Peter Mello	$(SYN_FILES:%.awk=$(TESTDIR)/syn/%.ok) \
57*e6d6c189SCody Peter Mello	$(TESTDIR)/runtests.sh
58*e6d6c189SCody Peter Mello
59*e6d6c189SCody Peter MelloSUBDIRS = data examples/awk examples/out gnu syn tests
60*e6d6c189SCody Peter Mello
61*e6d6c189SCody Peter MelloROOTOPTPKG = $(ROOT)/opt/util-tests
62*e6d6c189SCody Peter MelloTESTDIR = $(ROOTOPTPKG)/tests/awk
63*e6d6c189SCody Peter MelloTESTSUBDIRS = $(SUBDIRS:%=$(TESTDIR)/%)
64*e6d6c189SCody Peter Mello
65*e6d6c189SCody Peter Melloall lint clean clobber:
66*e6d6c189SCody Peter Mello
67*e6d6c189SCody Peter Melloinstall: all $(ROOTFILES)
68*e6d6c189SCody Peter Mello
69*e6d6c189SCody Peter Mello$(TESTDIR)/examples/% := FILEMODE=0444
70*e6d6c189SCody Peter Mello$(TESTDIR)/data/% := FILEMODE=0444
71*e6d6c189SCody Peter Mello$(TESTDIR)/%.data := FILEMODE=0444
72*e6d6c189SCody Peter Mello$(TESTDIR)/%.awk := FILEMODE=0444
73*e6d6c189SCody Peter Mello$(TESTDIR)/%.in := FILEMODE=0444
74*e6d6c189SCody Peter Mello$(TESTDIR)/%.ok := FILEMODE=0444
75*e6d6c189SCody Peter Mello$(TESTDIR)/%.sh := FILEMODE=0555
76*e6d6c189SCody Peter Mello
77*e6d6c189SCody Peter Mello$(TESTDIR)/tests/latin1 := FILEMODE=0444
78*e6d6c189SCody Peter Mello$(TESTDIR)/tests/T.% := FILEMODE=0555
79*e6d6c189SCody Peter Mello$(TESTDIR)/tests/%.p := FILEMODE=0444
80*e6d6c189SCody Peter Mello
81*e6d6c189SCody Peter Mello$(TESTDIR):
82*e6d6c189SCody Peter Mello	$(INS.dir)
83*e6d6c189SCody Peter Mello
84*e6d6c189SCody Peter Mello$(TESTSUBDIRS): $(TESTDIR)
85*e6d6c189SCody Peter Mello	$(INS.dir)
86*e6d6c189SCody Peter Mello
87*e6d6c189SCody Peter Mello$(TESTDIR)/%: % $(TESTSUBDIRS)
88*e6d6c189SCody Peter Mello	$(INS.file)
89