xref: /illumos-gate/usr/src/test/zfs-tests/cmd/Makefile.subdirs (revision 92c82aaee9430c329e5095550e89559ba0dd9fee)
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) 2012, 2016 by Delphix. All rights reserved.
14#
15
16include $(SRC)/test/Makefile.com
17
18ROOTOPTPKG = $(ROOT)/opt/zfs-tests
19ROOTBIN = $(ROOTOPTPKG)/bin
20
21OBJS = $(PROG:%=%.o)
22SRCS = $(OBJS:%.o=%.c)
23
24CMDS = $(PROG:%=$(ROOTBIN)/%)
25$(CMDS) := FILEMODE = 0555
26
27C99MODE = $(C99_ENABLE)
28CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
29
30all: $(PROG)
31
32$(PROG): $(OBJS)
33	$(LINK.c) $(OBJS) -o $@ $(LDLIBS)
34	$(POST_PROCESS)
35
36%.o: ../%.c
37	$(COMPILE.c) $<
38
39install: all $(CMDS)
40
41lint: lint_SRCS
42
43clobber: clean
44	-$(RM) $(PROG)
45
46clean:
47	-$(RM) $(OBJS)
48
49$(CMDS): $(ROOTBIN) $(PROG)
50
51$(ROOTBIN):
52	$(INS.dir)
53
54$(ROOTBIN)/%: %
55	$(INS.file)
56