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