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