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