xref: /illumos-gate/usr/src/test/os-tests/tests/Makefile (revision e746021fbe3aa947e0f363d242d2650b6beef68e)
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, 2016 by Delphix. All rights reserved.
14# Copyright 2020 Joyent, Inc.
15# Copyright 2021 Tintri by DDN, Inc. All rights reserved.
16# Copyright 2021 OmniOS Community Edition (OmniOSce) Association.
17# Copyright 2024 Oxide Computer Company
18#
19
20SUBDIRS_i386 =		\
21	i386		\
22	imc		\
23	saveargs	\
24	xsave		\
25	zen_umc
26
27SUBDIRS =       \
28		cores \
29		ddi_ufm \
30		definit \
31		execvpe \
32		file-locking \
33		ilstr \
34		ksensor \
35		ksid \
36		libtopo \
37		minttl \
38		oclo \
39		pf_key \
40		poll \
41		portfs \
42		regression \
43		sdevfs \
44		secflags \
45		signalfd \
46		sigqueue \
47		sockfs \
48		spoof-ras \
49		stackalign \
50		stress \
51		syscall \
52		tcpsig \
53		timer \
54		uccid \
55		vfs \
56		$(SUBDIRS_$(MACH))
57
58PROGS = \
59	clock_gettime \
60	eventfd \
61	fifo-tvnsec \
62	odirectory \
63	ucontext \
64	getcontext_extd \
65	writev
66
67CPPFLAGS += -D_REENTRANT
68PROGS32 = $(PROGS:%=%.32)
69PROGS64 = $(PROGS:%=%.64)
70
71ROOTOPTDIR = $(ROOT)/opt/os-tests/tests
72ROOTOPTPROGS = $(PROGS32:%=$(ROOTOPTDIR)/%) \
73	$(PROGS64:%=$(ROOTOPTDIR)/%) \
74	$(SCRIPTS:%=$(ROOTOPTDIR)/%)
75
76odirectory.32 :=	LDLIBS += -lsocket
77odirectory.64 :=	LDLIBS64 += -lsocket
78
79clock_gettime.32 :=	LDLIBS += -lproc
80clock_gettime.32 :=	CSTD = $(CSTD_GNU99)
81clock_gettime.64 :=	LDLIBS64 += -lproc
82clock_gettime.64 :=	CSTD = $(CSTD_GNU99)
83
84fifo-tvnsec.32 :=	CSTD = $(CSTD_GNU99)
85fifo-tvnsec.64 :=	CSTD = $(CSTD_GNU99)
86
87ucontext.32 :=		SMOFF += unreachable
88ucontext.64 :=		SMOFF += unreachable
89
90writev.32 :=		CPPFLAGS += -D_FILE_OFFSET_BITS=64
91writev.32 :=		CSTD = $(CSTD_GNU99)
92writev.64 :=		CSTD = $(CSTD_GNU99)
93
94include $(SRC)/cmd/Makefile.cmd
95
96all     :=      TARGET = all
97install :=      TARGET = install
98clean   :=      TARGET = clean
99clobber :=      TARGET = clobber
100
101.KEEP_STATE:
102
103install: $(SUBDIRS) $(ROOTOPTPROGS)
104
105all: $(SUBDIRS) $(PROGS32) $(PROGS64)
106
107clean: $(SUBDIRS)
108
109$(ROOTOPTPROGS): $(PROGS32) $(PROGS64) $(ROOTOPTDIR)
110
111$(ROOTOPTDIR):
112	$(INS.dir)
113
114$(ROOTOPTDIR)/%: %
115	$(INS.file)
116
117$(ROOTOPTDIR)/%: %.ksh
118	$(INS.rename)
119
120%.64: %.c
121	$(LINK64.c) -o $@ $< $(LDLIBS64)
122	$(POST_PROCESS)
123
124%.32: %.c
125	$(LINK.c) -o $@ $< $(LDLIBS)
126	$(POST_PROCESS)
127
128clobber: $(SUBDIRS)
129	$(RM) $(PROGS32) $(PROGS64)
130
131$(SUBDIRS): FRC
132	@cd $@; pwd; $(MAKE) $(TARGET)
133
134FRC:
135