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