xref: /illumos-gate/usr/src/test/zfs-tests/cmd/Makefile.subdirs (revision 7a6d80f1660abd4755c68cbd094d4a914681d26e)
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
27CSTD = $(CSTD_GNU99)
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
41clobber: clean
42	-$(RM) $(PROG)
43
44clean:
45	-$(RM) $(OBJS)
46
47$(CMDS): $(ROOTBIN) $(PROG)
48
49$(ROOTBIN):
50	$(INS.dir)
51
52$(ROOTBIN)/%: %
53	$(INS.file)
54