xref: /illumos-gate/usr/src/test/os-tests/tests/vfs/Makefile (revision 4763305e3243687c189d755d737d52205b2614ed)
1ea7b7d8aSRobert Mustacchi#
2ea7b7d8aSRobert Mustacchi# This file and its contents are supplied under the terms of the
3ea7b7d8aSRobert Mustacchi# Common Development and Distribution License ("CDDL"), version 1.0.
4ea7b7d8aSRobert Mustacchi# You may only use this file in accordance with the terms of version
5ea7b7d8aSRobert Mustacchi# 1.0 of the CDDL.
6ea7b7d8aSRobert Mustacchi#
7ea7b7d8aSRobert Mustacchi# A full copy of the text of the CDDL should have accompanied this
8ea7b7d8aSRobert Mustacchi# source.  A copy of the CDDL is also available via the Internet at
9ea7b7d8aSRobert Mustacchi# http://www.illumos.org/license/CDDL.
10ea7b7d8aSRobert Mustacchi#
11ea7b7d8aSRobert Mustacchi
12ea7b7d8aSRobert Mustacchi#
13ea7b7d8aSRobert Mustacchi# Copyright 2024 Oxide Computer Company
14ea7b7d8aSRobert Mustacchi#
15ea7b7d8aSRobert Mustacchi
16*4763305eSRobert MustacchiPROGS = statvfs \
17*4763305eSRobert Mustacchi	syncfs
18ea7b7d8aSRobert Mustacchi
19ea7b7d8aSRobert MustacchiPROGS32 = $(PROGS:%=%.32)
20ea7b7d8aSRobert MustacchiPROGS64 = $(PROGS:%=%.64)
21ea7b7d8aSRobert Mustacchi
22ea7b7d8aSRobert MustacchiOBJS32 = $(PROGS:%=%.32.o)
23ea7b7d8aSRobert MustacchiOBJS64 = $(PROGS:%=%.64.o)
24ea7b7d8aSRobert Mustacchi
25ea7b7d8aSRobert MustacchiROOTOPTDIR =	$(ROOT)/opt/os-tests/tests
26ea7b7d8aSRobert MustacchiROOTOPTPROGS =	$(PROGS32:%=$(ROOTOPTDIR)/%) \
27ea7b7d8aSRobert Mustacchi		$(PROGS64:%=$(ROOTOPTDIR)/%)
28ea7b7d8aSRobert Mustacchi
29ea7b7d8aSRobert Mustacchiinclude $(SRC)/cmd/Makefile.cmd
30ea7b7d8aSRobert Mustacchiinclude $(SRC)/cmd/Makefile.ctf
31ea7b7d8aSRobert Mustacchi
32ea7b7d8aSRobert MustacchiCSTD = $(GNU_C99)
33ea7b7d8aSRobert MustacchiCTF_MODE = link
34ea7b7d8aSRobert Mustacchi
35ea7b7d8aSRobert Mustacchistatvfs.32	:= CPPFLAGS += -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
36ea7b7d8aSRobert Mustacchistatvfs.32	:= LDLIBS += -lsocket
37ea7b7d8aSRobert Mustacchistatvfs.64	:= LDLIBS64 += -lsocket
38ea7b7d8aSRobert Mustacchi
39*4763305eSRobert Mustacchisyncfs.32	:= CPPFLAGS += -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
40*4763305eSRobert Mustacchisyncfs.32	:= LDLIBS += -lsocket
41*4763305eSRobert Mustacchisyncfs.64	:= LDLIBS64 += -lsocket
42*4763305eSRobert Mustacchi
43ea7b7d8aSRobert Mustacchi.KEEP_STATE:
44ea7b7d8aSRobert Mustacchi
45ea7b7d8aSRobert Mustacchiall: $(PROGS32) $(PROGS64)
46ea7b7d8aSRobert Mustacchi
47ea7b7d8aSRobert Mustacchiinstall: $(ROOTOPTPROGS)
48ea7b7d8aSRobert Mustacchi
49ea7b7d8aSRobert Mustacchiclean:
50ea7b7d8aSRobert Mustacchi	$(RM) $(OBJS32) $(OBJS64)
51ea7b7d8aSRobert Mustacchi
52ea7b7d8aSRobert Mustacchi$(PROGS32): $(OBJS32)
53ea7b7d8aSRobert Mustacchi$(PROGS64): $(OBJS64)
54ea7b7d8aSRobert Mustacchi
55ea7b7d8aSRobert Mustacchi$(ROOTOPTPROGS): $(PROGS32) $(PROGS64) $(ROOTOPTDIR)
56ea7b7d8aSRobert Mustacchi
57ea7b7d8aSRobert Mustacchi$(ROOTOPTDIR):
58ea7b7d8aSRobert Mustacchi	$(INS.dir)
59ea7b7d8aSRobert Mustacchi
60ea7b7d8aSRobert Mustacchi$(ROOTOPTDIR)/%: %
61ea7b7d8aSRobert Mustacchi	$(INS.file)
62ea7b7d8aSRobert Mustacchi
63ea7b7d8aSRobert Mustacchi%.32.o: %.c
64ea7b7d8aSRobert Mustacchi	$(COMPILE.c) -o $@ $<
65ea7b7d8aSRobert Mustacchi	$(POST_PROCESS_O)
66ea7b7d8aSRobert Mustacchi
67ea7b7d8aSRobert Mustacchi%.64.o: %.c
68ea7b7d8aSRobert Mustacchi	$(COMPILE64.c) -o $@ $<
69ea7b7d8aSRobert Mustacchi	$(POST_PROCESS_O)
70ea7b7d8aSRobert Mustacchi
71ea7b7d8aSRobert Mustacchi%.64: %.64.o
72ea7b7d8aSRobert Mustacchi	$(LINK64.c) -o $@ $< $(LDLIBS64)
73ea7b7d8aSRobert Mustacchi	$(POST_PROCESS)
74ea7b7d8aSRobert Mustacchi
75ea7b7d8aSRobert Mustacchi%.32: %.32.o
76ea7b7d8aSRobert Mustacchi	$(LINK.c) -o $@ $< $(LDLIBS)
77ea7b7d8aSRobert Mustacchi	$(POST_PROCESS)
78ea7b7d8aSRobert Mustacchi
79ea7b7d8aSRobert Mustacchiclobber: clean
80ea7b7d8aSRobert Mustacchi	$(RM) $(PROGS32) $(PROGS64)
81ea7b7d8aSRobert Mustacchi
82ea7b7d8aSRobert MustacchiFRC:
83