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 by Delphix. All rights reserved.
14#
15
16# The following file name generation rules allow the addition of tests,
17# libraries and other miscellaneous files without having to specify them
18# all individually in lower level Makefiles.
19PROGS:sh = echo ~(N)*(*.sh|*.ksh)
20FILES:sh = echo ~(N)*(*.cfg|*shlib|*.run|*.bz2|*.d|*.fio)
21FILES:sh += echo ~(N)*(*.Z|*.txt|*.out|*.err|*.zcp)
22
23CMDS = $(PROGS:%.sh=$(TARGETDIR)/%)
24CMDS += $(PROGS:%.ksh=$(TARGETDIR)/%)
25$(CMDS) := FILEMODE = 0555
26
27LIBS = $(FILES:%=$(TARGETDIR)/%)
28$(LIBS) := FILEMODE = 0444
29
30all lint clean clobber:
31
32install: $(CMDS) $(LIBS)
33
34$(CMDS): $(TARGETDIR)
35
36$(LIBS): $(TARGETDIR)
37
38$(TARGETDIR):
39	$(INS.dir)
40
41$(TARGETDIR)/%: %.sh
42	$(INS.rename)
43
44$(TARGETDIR)/%: %.ksh
45	$(INS.rename)
46
47$(TARGETDIR)/%: %
48	$(INS.file)
49
50.PARALLEL: $(SUBDIRS)
51SUBDIRS:sh = find ./* -maxdepth 0 -type d
52