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