xref: /illumos-gate/usr/src/test/os-tests/tests/Makefile (revision 5400c85432c0a689ecefb8c19b8f9861809ca093)
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		memlist \
45		minttl \
46		oclo \
47		pf_key \
48		poll \
49		portfs \
50		regression \
51		sdevfs \
52		secflags \
53		secure_getenv \
54		signalfd \
55		sigqueue \
56		sockfs \
57		sockopt \
58		spawn \
59		spoof-ras \
60		stackalign \
61		stress \
62		syscall \
63		tcpsig \
64		timer \
65		uccid \
66		vfs \
67		$(SUBDIRS_$(MACH))
68
69PROGS = \
70	clock_gettime \
71	close_range \
72	eventfd \
73	fifo-tvnsec \
74	odirectory \
75	ucontext \
76	getcontext_extd \
77	writev
78
79CPPFLAGS += -D_REENTRANT
80PROGS32 = $(PROGS:%=%.32)
81PROGS64 = $(PROGS:%=%.64)
82
83ROOTOPTDIR = $(ROOT)/opt/os-tests/tests
84ROOTOPTPROGS = $(PROGS32:%=$(ROOTOPTDIR)/%) \
85	$(PROGS64:%=$(ROOTOPTDIR)/%) \
86	$(SCRIPTS:%=$(ROOTOPTDIR)/%)
87
88odirectory.32 :=	LDLIBS += -lsocket
89odirectory.64 :=	LDLIBS64 += -lsocket
90
91clock_gettime.32 :=	LDLIBS += -lproc
92clock_gettime.32 :=	CSTD = $(CSTD_GNU99)
93clock_gettime.64 :=	LDLIBS64 += -lproc
94clock_gettime.64 :=	CSTD = $(CSTD_GNU99)
95
96close_range.32 :=	CSTD = $(CSTD_GNU17)
97close_range.64 :=	CSTD = $(CSTD_GNU17)
98
99fifo-tvnsec.32 :=	CSTD = $(CSTD_GNU99)
100fifo-tvnsec.64 :=	CSTD = $(CSTD_GNU99)
101
102ucontext.32 :=		SMOFF += unreachable
103ucontext.64 :=		SMOFF += unreachable
104
105writev.32 :=		CPPFLAGS += -D_FILE_OFFSET_BITS=64
106writev.32 :=		CSTD = $(CSTD_GNU99)
107writev.64 :=		CSTD = $(CSTD_GNU99)
108
109include $(SRC)/cmd/Makefile.cmd
110
111all     :=      TARGET = all
112install :=      TARGET = install
113clean   :=      TARGET = clean
114clobber :=      TARGET = clobber
115
116.KEEP_STATE:
117
118install: $(SUBDIRS) $(ROOTOPTPROGS)
119
120all: $(SUBDIRS) $(PROGS32) $(PROGS64)
121
122clean: $(SUBDIRS)
123
124$(ROOTOPTPROGS): $(PROGS32) $(PROGS64) $(ROOTOPTDIR)
125
126$(ROOTOPTDIR):
127	$(INS.dir)
128
129$(ROOTOPTDIR)/%: %
130	$(INS.file)
131
132$(ROOTOPTDIR)/%: %.ksh
133	$(INS.rename)
134
135%.64: %.c
136	$(LINK64.c) -o $@ $< $(LDLIBS64)
137	$(POST_PROCESS)
138
139%.32: %.c
140	$(LINK.c) -o $@ $< $(LDLIBS)
141	$(POST_PROCESS)
142
143clobber: $(SUBDIRS)
144	$(RM) $(PROGS32) $(PROGS64)
145
146$(SUBDIRS): FRC
147	@cd $@; pwd; $(MAKE) $(TARGET)
148
149FRC:
150