xref: /illumos-gate/usr/src/test/zfs-tests/tests/functional/channel_program/synctask_core/Makefile (revision 2a8bcb4efb45d99ac41c94a75c396b362c414f7f)
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# Copyright 2020 Joyent, Inc.
15#
16
17include $(SRC)/Makefile.master
18include $(SRC)/cmd/Makefile.cmd
19include $(SRC)/cmd/Makefile.ctf
20
21ROOTOPTPKG = $(ROOT)/opt/zfs-tests
22TESTDIR = $(ROOTOPTPKG)/tests/functional/channel_program/synctask_core
23
24KSHFILES :sh= ls *.ksh
25KSHPROGS = $(KSHFILES:.ksh=)
26
27SRCS :sh= ls *.c
28CPROGS = $(SRCS:%.c=%.exe)
29LDLIBS = $(LDLIBS.cmd)
30LDLIBS += -lzfs_core -lnvpair
31CSTD = $(CSTD_GNU99)
32OBJS = $(SRCS:%.c=%.o)
33
34PROGS = $(KSHPROGS) $(CPROGS)
35FILES :sh= ls *.zcp *.out *.err 2>/dev/null; true
36
37INSTPROGS = $(PROGS:%=$(TESTDIR)/%)
38INSTFILES = $(FILES:%=$(TESTDIR)/%)
39
40$(INSTPROGS) := FILEMODE = 0555
41$(INSTFILES) := FILEMODE = 0444
42
43all: $(CPROGS)
44
45clean clobber:
46
47install: $(INSTPROGS) $(INSTFILES)
48
49$(INSTPROGS): $(TESTDIR)
50$(INSTFILES): $(TESTDIR)
51
52$(TESTDIR):
53	$(INS.dir)
54
55$(TESTDIR)/%: %.ksh
56	$(INS.rename)
57
58$(TESTDIR)/%: %
59	$(INS.file)
60
61%.o: ../%.c
62	$(COMPILE.c) $<
63
64%.exe: %.o
65	$(LINK.c) $< -o $@ $(LDLIBS)
66	$(POST_PROCESS)
67
68clobber: clean
69	-$(RM) $(PROGS)
70
71clean:
72	-$(RM) $(OBJS)
73