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