xref: /illumos-gate/usr/src/test/os-tests/tests/file-locking/Makefile (revision 45d3dd981abb9025d8ac994cf4cc8ce8cb1a9480)
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 2016 Joyent, Inc.
14#
15
16include $(SRC)/cmd/Makefile.cmd
17include $(SRC)/test/Makefile.com
18
19UTILS = util.c
20
21PROGS = \
22	runtests \
23	acquire-lock
24
25C99MODE = -xc99=%all
26
27SRCS = $(PROGS:%=%.c) $(UTILS)
28PROGS32 = $(PROGS:%=%.32)
29PROGS64 = $(PROGS:%=%.64)
30
31LINTS = $(PROGS:%=%.ln)
32LINTFLAGS += -erroff=E_NAME_DEF_NOT_USED2
33LINTFLAGS += -erroff=E_NAME_USED_NOT_DEF2
34
35ROOTOPTDIR = $(ROOT)/opt/os-tests/tests/file-locking
36ROOTOPTPROGS = $(PROGS32:%=$(ROOTOPTDIR)/%) \
37	$(PROGS64:%=$(ROOTOPTDIR)/%)
38
39.KEEP_STATE:
40
41install: $(ROOTOPTPROGS)
42
43all: $(PROGS32) $(PROGS64)
44
45lint: $(LINTS)
46
47clean:
48	-rm $(PROGS32) $(PROGS64)
49
50$(ROOTOPTPROGS): $(PROGS32) $(PROGS64) $(ROOTOPTDIR)
51
52$(ROOTOPTDIR):
53	$(INS.dir)
54
55$(ROOTOPTDIR)/%: %
56	$(INS.file)
57
58$(ROOTOPTDIR)/%: %.ksh
59	$(INS.rename)
60
61%.ln: %.c
62	$(LINT.c) $< $(UTILS) $(LDLIBS)
63
64%.64: %.c
65	$(LINK64.c) -o $@ $< $(UTILS) $(LDLIBS64)
66	$(POST_PROCESS)
67
68%.32: %.c
69	$(LINK.c) -o $@ $< $(UTILS) $(LDLIBS)
70	$(POST_PROCESS)
71
72clobber:
73	$(RM) $(PROGS32) $(PROGS64)
74
75FRC:
76