xref: /illumos-gate/usr/src/test/os-tests/tests/sockfs/Makefile (revision b1529121add3ff25fc7b58196363a5439c0f6b67)
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 (c) 2012 by Delphix. All rights reserved.
14# Copyright 2017 Gordon W. Ross
15# Copyright (c) 2018, Joyent, Inc.
16# Copyright 2020 OmniOS Community Edition (OmniOSce) Association.
17# Copyright 2024 Oxide Computer Company
18#
19
20include $(SRC)/cmd/Makefile.cmd
21include $(SRC)/test/Makefile.com
22
23# These test programs are built as both 32- and 64-bit variants
24PROGDA = rights recvmsg timeouts
25
26PROG =	conn dgram drop_priv nosignal sockpair \
27	$(PROGDA:%=%.32) $(PROGDA:%=%.64) \
28	so_protocol
29
30LDLIBS += -lsocket
31LDLIBS64 += -lsocket
32
33CSTD = $(CSTD_GNU99)
34CPPFLAGS += -D_XOPEN_SOURCE=600 -D__EXTENSIONS__
35
36# needs work
37SMOFF += all_func_returns
38
39nosignal := LDLIBS += -lnsl
40rights.32 := LDLIBS += -lproc
41rights.64 := LDLIBS64 += -lproc
42
43ROOTOPTPKG = $(ROOT)/opt/os-tests
44TESTDIR = $(ROOTOPTPKG)/tests/sockfs
45
46CMDS = $(PROG:%=$(TESTDIR)/%)
47$(CMDS) := FILEMODE = 0555
48
49all: $(PROG)
50
51install: $(CMDS)
52
53clobber: clean
54	-$(RM) $(PROG)
55
56clean:
57
58$(CMDS): $(TESTDIR) $(PROG)
59
60$(TESTDIR):
61	$(INS.dir)
62
63$(TESTDIR)/%: %
64	$(INS.file)
65
66%.64: %.c
67	$(LINK64.c) -o $@ $< $(LDLIBS64)
68	$(POST_PROCESS)
69
70%.32: %.c
71	$(LINK.c) -o $@ $< $(LDLIBS)
72	$(POST_PROCESS)
73