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