xref: /illumos-gate/usr/src/test/os-tests/tests/file-locking/Makefile (revision eef4f27b270242808b43b4b23bd161df52839361)
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
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.o: %.c
65	$(COMPILE64.c) $< -o $@
66
67%.32.o: %.c
68	$(COMPILE.c) $< -o $@
69
70%.64: %.64.o util.64.o
71	$(LINK64.c) -o $@ $< util.64.o $(LDLIBS64)
72	$(POST_PROCESS)
73
74%.32: %.32.o util.32.o
75	$(LINK.c) -o $@ $< util.32.o $(LDLIBS)
76	$(POST_PROCESS)
77
78clobber:
79	$(RM) $(PROGS32) $(PROGS64)
80
81FRC:
82