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