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 # 18 19 include $(SRC)/cmd/Makefile.cmd 20 include $(SRC)/test/Makefile.com 21 22 # These test programs are built as both 32- and 64-bit variants 23 PROGDA = rights recvmsg 24 25 PROG = conn dgram drop_priv nosignal sockpair \ 26 $(PROGDA:%=%.32) $(PROGDA:%=%.64) 27 28 LDLIBS += -lsocket 29 LDLIBS64 += -lsocket 30 31 CSTD = $(CSTD_GNU99) 32 CPPFLAGS += -D_XOPEN_SOURCE=600 -D__EXTENSIONS__ 33 34 # needs work 35 SMOFF += all_func_returns 36 37 nosignal := LDLIBS += -lnsl 38 rights.32 := LDLIBS += -lproc 39 rights.64 := LDLIBS64 += -lproc 40 41 ROOTOPTPKG = $(ROOT)/opt/os-tests 42 TESTDIR = $(ROOTOPTPKG)/tests/sockfs 43 44 CMDS = $(PROG:%=$(TESTDIR)/%) 45 $(CMDS) := FILEMODE = 0555 46 47 all: $(PROG) 48 49 install: $(CMDS) 50 51 clobber: clean 52 -$(RM) $(PROG) 53 54 clean: 55 56 $(CMDS): $(TESTDIR) $(PROG) 57 58 $(TESTDIR): 59 $(INS.dir) 60 61 $(TESTDIR)/%: % 62 $(INS.file) 63 64 %.64: %.c 65 $(LINK64.c) -o $@ $< $(LDLIBS64) 66 $(POST_PROCESS) 67 68 %.32: %.c 69 $(LINK.c) -o $@ $< $(LDLIBS) 70 $(POST_PROCESS)