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 2020 Joyent, Inc.
14#
15
16include $(SRC)/Makefile.master
17
18PROG = sysevent
19
20SCRIPTS = cleanup \
21	resilver_restart_001 \
22	resilver_restart_002 \
23	setup
24
25include $(SRC)/cmd/Makefile.cmd
26include $(SRC)/test/Makefile.com
27
28ROOTOPTPKG = $(ROOT)/opt/zfs-tests
29TARGETDIR = $(ROOTOPTPKG)/tests/functional/resilver
30
31OBJS = $(PROG:%=%.o)
32SRCS = $(OBJS:%.o=%.c)
33SRCFILES = resilver.cfg
34
35CMDS = $(PROG:%=$(TARGETDIR)/%) $(SCRIPTS:%=$(TARGETDIR)/%)
36$(CMDS) := FILEMODE = 0555
37
38FILES = $(SRCFILES:%=$(TARGETDIR)/%)
39$(FILES) := FILEMODE = 0444
40
41CPPFLAGS += -D__EXTENSIONS__
42LDLIBS += -lsysevent
43
44CSTD = $(CSTD_GNU99)
45
46all: $(PROG)
47
48$(PROG): $(OBJS)
49	$(LINK.c) $(OBJS) -o $@ $(LDFLAGS) $(LDLIBS)
50	$(POST_PROCESS)
51
52%.o: %.c
53	$(COMPILE.c) $<
54
55install: all $(CMDS) $(FILES)
56
57clobber: clean
58	-$(RM) $(PROG)
59
60clean:
61	-$(RM) $(OBJS)
62
63$(CMDS): $(TARGETDIR) $(PROG)
64
65$(FILES): $(SRCFILES)
66
67$(TARGETDIR):
68	$(INS.dir)
69
70$(TARGETDIR)/%: %
71	$(INS.file)
72
73$(TARGETDIR)/%: %.ksh
74	$(INS.rename)
75