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