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