xref: /illumos-gate/usr/src/test/os-tests/tests/vfs/Makefile (revision 4763305e3243687c189d755d737d52205b2614ed)
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 2024 Oxide Computer Company
14#
15
16PROGS = statvfs \
17	syncfs
18
19PROGS32 = $(PROGS:%=%.32)
20PROGS64 = $(PROGS:%=%.64)
21
22OBJS32 = $(PROGS:%=%.32.o)
23OBJS64 = $(PROGS:%=%.64.o)
24
25ROOTOPTDIR =	$(ROOT)/opt/os-tests/tests
26ROOTOPTPROGS =	$(PROGS32:%=$(ROOTOPTDIR)/%) \
27		$(PROGS64:%=$(ROOTOPTDIR)/%)
28
29include $(SRC)/cmd/Makefile.cmd
30include $(SRC)/cmd/Makefile.ctf
31
32CSTD = $(GNU_C99)
33CTF_MODE = link
34
35statvfs.32	:= CPPFLAGS += -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
36statvfs.32	:= LDLIBS += -lsocket
37statvfs.64	:= LDLIBS64 += -lsocket
38
39syncfs.32	:= CPPFLAGS += -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
40syncfs.32	:= LDLIBS += -lsocket
41syncfs.64	:= LDLIBS64 += -lsocket
42
43.KEEP_STATE:
44
45all: $(PROGS32) $(PROGS64)
46
47install: $(ROOTOPTPROGS)
48
49clean:
50	$(RM) $(OBJS32) $(OBJS64)
51
52$(PROGS32): $(OBJS32)
53$(PROGS64): $(OBJS64)
54
55$(ROOTOPTPROGS): $(PROGS32) $(PROGS64) $(ROOTOPTDIR)
56
57$(ROOTOPTDIR):
58	$(INS.dir)
59
60$(ROOTOPTDIR)/%: %
61	$(INS.file)
62
63%.32.o: %.c
64	$(COMPILE.c) -o $@ $<
65	$(POST_PROCESS_O)
66
67%.64.o: %.c
68	$(COMPILE64.c) -o $@ $<
69	$(POST_PROCESS_O)
70
71%.64: %.64.o
72	$(LINK64.c) -o $@ $< $(LDLIBS64)
73	$(POST_PROCESS)
74
75%.32: %.32.o
76	$(LINK.c) -o $@ $< $(LDLIBS)
77	$(POST_PROCESS)
78
79clobber: clean
80	$(RM) $(PROGS32) $(PROGS64)
81
82FRC:
83