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 by Delphix. All rights reserved.
14 # Copyright 2016 Nexenta Systems, Inc. All rights reserved.
15 #
16 include $(SRC)/cmd/Makefile.cmd
17
18 ROOTOPTPKG = $(ROOT)/opt/nfsgen-tests
19 TESTBIN = $(ROOTOPTPKG)/$(BINDIR)
20
21 SRCS = $(PROGS:%=%.c)
22 OBJS = $(PROGS:%=%.o)
23
24 BINS = $(PROGS:%=$(TESTBIN)/%)
25 $(BINS) := FILEMODE = 0555
26
27 LIBNFSGEN = $(ROOTOPTPKG)/lib
28 NFSGENINC = $(SRC)/test/nfsgen-tests/include
29 CFLAGS = -erroff=%all # Ignore all lint msg now
30 CFLAGS += -I$(NFSGENINC)
31 LDLIBS += -L$(LIBNFSGEN) -lnfsgen
32
33 $(PROGS): $(OBJS)
34 $(LINK.c) -o $@ $@.o $(LDLIBS)
35 $(POST_PROCESS)
36
37 all install: $(BINS)
38
39 $(BINS): $(TESTBIN)
40
41 $(TESTBIN):
42 $(INS.dir)
43
44 $(TESTBIN)/%: %
45 $(INS.file)
46
47 lint:
48 for src in $(SRCS); \
49 do \
50 $(LINT.c) $(CFLAGS) $${src}; \
51 done
52
53 clobber clean:
54 -$(RM) $(OBJS) $(PROGS)