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