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) 2016, 2017 by Delphix. All rights reserved.
14# Copyright 2021 Tintri by DDN, Inc. All rights reserved.
15#
16
17# The following file name generation rules allow the addition of tests,
18# libraries and other miscellaneous files without having to specify them
19# all individually in lower level Makefiles.
20PROGS:sh = find . -maxdepth 1 -type f \( \
21    -name "*.ksh" -o \
22    -name "*.py" -o \
23    -name "*.sh" \)
24FILES:sh = find . -maxdepth 1 -type f \( \
25    -name "*.Z" -o \
26    -name "*.bz2" -o \
27    -name "*.cfg" -o \
28    -name "*.d" -o \
29    -name "*.err" -o \
30    -name "*.fio" -o \
31    -name "*.out" -o \
32    -name "*.run" -o \
33    -name "*shlib" -o \
34    -name "*.txt" -o \
35    -name "*.zcp" \)
36
37CMDS = $(PROGS:%.sh=$(TARGETDIR)/%)
38CMDS += $(PROGS:%.ksh=$(TARGETDIR)/%)
39CMDS += $(PROGS:%.py=$(TARGETDIR)/%)
40$(CMDS) := FILEMODE = 0555
41
42LIBS = $(FILES:%=$(TARGETDIR)/%)
43$(LIBS) := FILEMODE = 0444
44
45all clean clobber:
46
47install: $(CMDS) $(LIBS)
48
49$(CMDS): $(TARGETDIR)
50
51$(LIBS): $(TARGETDIR)
52
53$(TARGETDIR):
54	$(INS.dir)
55
56$(TARGETDIR)/%: %.sh
57	$(INS.rename)
58
59$(TARGETDIR)/%: %.ksh
60	$(INS.rename)
61
62$(TARGETDIR)/%: %.py
63	$(INS.pyfile)
64
65$(TARGETDIR)/%: %
66	$(INS.file)
67
68.PARALLEL: $(SUBDIRS)
69SUBDIRS:sh = find ./* -maxdepth 0 -type d ; exit 0
70