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