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