1d583b39bSJohn Wren Kennedy#
2d583b39bSJohn Wren Kennedy# This file and its contents are supplied under the terms of the
3d583b39bSJohn Wren Kennedy# Common Development and Distribution License ("CDDL"), version 1.0.
4d583b39bSJohn Wren Kennedy# You may only use this file in accordance with the terms of version
5d583b39bSJohn Wren Kennedy# 1.0 of the CDDL.
6d583b39bSJohn Wren Kennedy#
7d583b39bSJohn Wren Kennedy# A full copy of the text of the CDDL should have accompanied this
8d583b39bSJohn Wren Kennedy# source.  A copy of the CDDL is also available via the Internet at
9d583b39bSJohn Wren Kennedy# http://www.illumos.org/license/CDDL.
10d583b39bSJohn Wren Kennedy#
11d583b39bSJohn Wren Kennedy
12d583b39bSJohn Wren Kennedy#
13fe4627efSSebastien Roy# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
1481c3d085SJerry Jelinek# Copyright 2020 Joyent, Inc.
15915894efSMatt Barden# Copyright 2021 Tintri by DDN, Inc. All rights reserved.
16d7159b37SAndy Fiddaman# Copyright 2021 OmniOS Community Edition (OmniOSce) Association.
17d583b39bSJohn Wren Kennedy#
18d583b39bSJohn Wren Kennedy
19eb00b1c8SRobert MustacchiSUBDIRS_i386 = i386 imc
20a0955b86SJohn Levon
21508a0e8cSRob JohnstonSUBDIRS =       \
228e458de0SRobert Mustacchi		cores \
23508a0e8cSRob Johnston		ddi_ufm \
24*a28480feSAndy Fiddaman		definit \
25508a0e8cSRob Johnston		file-locking \
263ce53722SRobert Mustacchi		ksensor \
27c5591576SRob Johnston		libtopo \
28508a0e8cSRob Johnston		pf_key \
29508a0e8cSRob Johnston		poll \
30508a0e8cSRob Johnston		sdevfs \
31508a0e8cSRob Johnston		secflags \
32508a0e8cSRob Johnston		sigqueue \
33508a0e8cSRob Johnston		sockfs \
34508a0e8cSRob Johnston		spoof-ras \
35915894efSMatt Barden		stackalign \
36508a0e8cSRob Johnston		stress \
37edd58064SJerry Jelinek		syscall \
38440a8a36SPatrick Mooney		timer \
39a61ed2ceSHans Rosenfeld		uccid \
40508a0e8cSRob Johnston		$(SUBDIRS_$(MACH))
41d583b39bSJohn Wren Kennedy
4269c811abSRobert MustacchiPROGS = \
43dea9f5e6SRobert Mustacchi	clock_gettime \
44d7159b37SAndy Fiddaman	eventfd \
4581c3d085SJerry Jelinek	odirectory \
4681c3d085SJerry Jelinek	writev
4769c811abSRobert Mustacchi
4869c811abSRobert MustacchiCPPFLAGS += -D_REENTRANT
4969c811abSRobert MustacchiPROGS32 = $(PROGS:%=%.32)
5069c811abSRobert MustacchiPROGS64 = $(PROGS:%=%.64)
5169c811abSRobert Mustacchi
5269c811abSRobert MustacchiROOTOPTDIR = $(ROOT)/opt/os-tests/tests
5369c811abSRobert MustacchiROOTOPTPROGS = $(PROGS32:%=$(ROOTOPTDIR)/%) \
5469c811abSRobert Mustacchi	$(PROGS64:%=$(ROOTOPTDIR)/%) \
5569c811abSRobert Mustacchi	$(SCRIPTS:%=$(ROOTOPTDIR)/%)
5669c811abSRobert Mustacchi
5769c811abSRobert Mustacchiodirectory.32 :=	LDLIBS += -lsocket
5869c811abSRobert Mustacchiodirectory.64 :=	LDLIBS64 += -lsocket
5969c811abSRobert Mustacchi
60dea9f5e6SRobert Mustacchiclock_gettime.32 :=	LDLIBS += -lproc
61dea9f5e6SRobert Mustacchiclock_gettime.32 :=	CSTD = $(CSTD_GNU99)
62dea9f5e6SRobert Mustacchiclock_gettime.64 :=	LDLIBS64 += -lproc
63dea9f5e6SRobert Mustacchiclock_gettime.64 :=	CSTD = $(CSTD_GNU99)
64dea9f5e6SRobert Mustacchi
6581c3d085SJerry Jelinekwritev.32 :=		CPPFLAGS += -D_FILE_OFFSET_BITS=64
6681c3d085SJerry Jelinekwritev.32 :=		CSTD = $(CSTD_GNU99)
6781c3d085SJerry Jelinekwritev.64 :=		CSTD = $(CSTD_GNU99)
6881c3d085SJerry Jelinek
6969c811abSRobert Mustacchiinclude $(SRC)/cmd/Makefile.cmd
7069c811abSRobert Mustacchi
7169c811abSRobert Mustacchiall     :=      TARGET = all
7269c811abSRobert Mustacchiinstall :=      TARGET = install
7369c811abSRobert Mustacchiclean   :=      TARGET = clean
7469c811abSRobert Mustacchiclobber :=      TARGET = clobber
7569c811abSRobert Mustacchi
7669c811abSRobert Mustacchi.KEEP_STATE:
7769c811abSRobert Mustacchi
7869c811abSRobert Mustacchiinstall: $(SUBDIRS) $(ROOTOPTPROGS)
7969c811abSRobert Mustacchi
8069c811abSRobert Mustacchiall: $(SUBDIRS) $(PROGS32) $(PROGS64)
8169c811abSRobert Mustacchi
8269c811abSRobert Mustacchiclean: $(SUBDIRS)
8369c811abSRobert Mustacchi
8469c811abSRobert Mustacchi$(ROOTOPTPROGS): $(PROGS32) $(PROGS64) $(ROOTOPTDIR)
8569c811abSRobert Mustacchi
8669c811abSRobert Mustacchi$(ROOTOPTDIR):
8769c811abSRobert Mustacchi	$(INS.dir)
8869c811abSRobert Mustacchi
8969c811abSRobert Mustacchi$(ROOTOPTDIR)/%: %
9069c811abSRobert Mustacchi	$(INS.file)
9169c811abSRobert Mustacchi
9269c811abSRobert Mustacchi$(ROOTOPTDIR)/%: %.ksh
9369c811abSRobert Mustacchi	$(INS.rename)
9469c811abSRobert Mustacchi
9569c811abSRobert Mustacchi%.64: %.c
9669c811abSRobert Mustacchi	$(LINK64.c) -o $@ $< $(LDLIBS64)
9769c811abSRobert Mustacchi	$(POST_PROCESS)
9869c811abSRobert Mustacchi
9969c811abSRobert Mustacchi%.32: %.c
10069c811abSRobert Mustacchi	$(LINK.c) -o $@ $< $(LDLIBS)
10169c811abSRobert Mustacchi	$(POST_PROCESS)
10269c811abSRobert Mustacchi
10369c811abSRobert Mustacchiclobber: $(SUBDIRS)
10469c811abSRobert Mustacchi	$(RM) $(PROGS32) $(PROGS64)
10569c811abSRobert Mustacchi
10669c811abSRobert Mustacchi$(SUBDIRS): FRC
10769c811abSRobert Mustacchi	@cd $@; pwd; $(MAKE) $(TARGET)
10869c811abSRobert Mustacchi
10969c811abSRobert MustacchiFRC: