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