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