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 2019, Joyent, Inc. 14# Copyright 2024 Oxide Computer Company 15# 16 17include $(SRC)/Makefile.master 18 19ROOTOPTPKG = $(ROOT)/opt/os-tests 20TESTDIR = $(ROOTOPTPKG)/tests/uccid 21 22PROGS = \ 23 atrparse \ 24 excl-basic \ 25 excl-badread \ 26 excl-close \ 27 excl-loop \ 28 excl-nonblock \ 29 excl-reset \ 30 modify \ 31 notxn-poll \ 32 status \ 33 pollin \ 34 pollout \ 35 txn-pollerr \ 36 yk \ 37 yk-poll \ 38 yk-readonly 39 40COMMON_OBJS = \ 41 atr.o \ 42 hexdump.o \ 43 ilstr.o 44 45atrparse := EXTRA_OBJS = $(COMMON_OBJS) 46 47include $(SRC)/cmd/Makefile.cmd 48include $(SRC)/test/Makefile.com 49 50CMDS = $(PROGS:%=$(TESTDIR)/%) 51$(CMDS) := FILEMODE = 0555 52 53CPPFLAGS += -D_REENTRANT -I$(SRC)/common/ccid/ 54 55hexdump.o := CSTD = $(CSTD_GNU99) 56 57all: $(PROGS) 58 59install: all $(CMDS) 60 61clobber: clean 62 -$(RM) $(PROGS) 63 64clean: 65 -$(RM) *.o 66 67$(PROGS): $(COMMON_OBJS) 68 69$(CMDS): $(TESTDIR) $(PROGS) 70 71$(TESTDIR): 72 $(INS.dir) 73 74$(TESTDIR)/%: % 75 $(INS.file) 76 77%.o: $(SRC)/common/ccid/%.c 78 $(COMPILE.c) -o $@ -c $< 79 $(POST_PROCESS_O) 80 81%.o: $(SRC)/common/ilstr/%.c 82 $(COMPILE.c) -o $@ -c $< 83 $(POST_PROCESS_O) 84 85%.o: $(SRC)/common/hexdump/%.c 86 $(COMPILE.c) -o $@ -c $< 87 $(POST_PROCESS_O) 88 89%.o: %.c 90 $(COMPILE.c) -o $@ -c $< 91 $(POST_PROCESS_O) 92 93%: %.o 94 $(LINK.c) -o $@ $< $(EXTRA_OBJS) $(LDLIBS) 95 $(POST_PROCESS) 96