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