xref: /illumos-gate/usr/src/test/os-tests/tests/Makefile (revision 56726c7e321b6e5ecb2f10215f5386016547e68c)
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		sdevfs \
33		secflags \
34		sigqueue \
35		sockfs \
36		spoof-ras \
37		stackalign \
38		stress \
39		syscall \
40		timer \
41		uccid \
42		$(SUBDIRS_$(MACH))
43
44PROGS = \
45	clock_gettime \
46	eventfd \
47	odirectory \
48	writev
49
50CPPFLAGS += -D_REENTRANT
51PROGS32 = $(PROGS:%=%.32)
52PROGS64 = $(PROGS:%=%.64)
53
54ROOTOPTDIR = $(ROOT)/opt/os-tests/tests
55ROOTOPTPROGS = $(PROGS32:%=$(ROOTOPTDIR)/%) \
56	$(PROGS64:%=$(ROOTOPTDIR)/%) \
57	$(SCRIPTS:%=$(ROOTOPTDIR)/%)
58
59odirectory.32 :=	LDLIBS += -lsocket
60odirectory.64 :=	LDLIBS64 += -lsocket
61
62clock_gettime.32 :=	LDLIBS += -lproc
63clock_gettime.32 :=	CSTD = $(CSTD_GNU99)
64clock_gettime.64 :=	LDLIBS64 += -lproc
65clock_gettime.64 :=	CSTD = $(CSTD_GNU99)
66
67writev.32 :=		CPPFLAGS += -D_FILE_OFFSET_BITS=64
68writev.32 :=		CSTD = $(CSTD_GNU99)
69writev.64 :=		CSTD = $(CSTD_GNU99)
70
71include $(SRC)/cmd/Makefile.cmd
72
73all     :=      TARGET = all
74install :=      TARGET = install
75clean   :=      TARGET = clean
76clobber :=      TARGET = clobber
77
78.KEEP_STATE:
79
80install: $(SUBDIRS) $(ROOTOPTPROGS)
81
82all: $(SUBDIRS) $(PROGS32) $(PROGS64)
83
84clean: $(SUBDIRS)
85
86$(ROOTOPTPROGS): $(PROGS32) $(PROGS64) $(ROOTOPTDIR)
87
88$(ROOTOPTDIR):
89	$(INS.dir)
90
91$(ROOTOPTDIR)/%: %
92	$(INS.file)
93
94$(ROOTOPTDIR)/%: %.ksh
95	$(INS.rename)
96
97%.64: %.c
98	$(LINK64.c) -o $@ $< $(LDLIBS64)
99	$(POST_PROCESS)
100
101%.32: %.c
102	$(LINK.c) -o $@ $< $(LDLIBS)
103	$(POST_PROCESS)
104
105clobber: $(SUBDIRS)
106	$(RM) $(PROGS32) $(PROGS64)
107
108$(SUBDIRS): FRC
109	@cd $@; pwd; $(MAKE) $(TARGET)
110
111FRC:
112