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 by Delphix. All rights reserved. 14# Copyright 2015 Nexenta Systems, Inc. All rights reserved. 15# Copyright (c) 2018, Joyent, Inc. 16# 17 18include $(SRC)/cmd/Makefile.cmd 19include $(SRC)/test/Makefile.com 20include $(SRC)/cmd/Makefile.ctf 21 22CRYPTO = pkcs kcf 23PROGS_32 = $(CRYPTO:%=$(BASEPROG)_32_%) 24PROGS_64 = $(CRYPTO:%=$(BASEPROG)_64_%) 25PROGS = $(PROGS_32) $(PROGS_64) 26PROGS_pkcs = $(BASEPROG:%=%_32_pkcs) $(BASEPROG:%=%_64_pkcs) 27PROGS_kcf = $(BASEPROG:%=%_32_kcf) $(BASEPROG:%=%_64_kcf) 28 29ROOTOPTPKG = $(ROOT)/opt/crypto-tests 30TESTROOT = $(ROOTOPTPKG)/tests/aes 31TESTDIR_pkcs = $(TESTROOT)/pkcs 32TESTDIR_kcf = $(TESTROOT)/kcf 33 34COMMONDIR = ../../../common 35$(PROGS_32) := OBJS += $(COMMONDIR)/testfuncs.32.o 36$(PROGS_64) := OBJS += $(COMMONDIR)/testfuncs.64.o 37$(PROGS_32) := OBJS += $(BASEPROG:%=%.32.o) 38$(PROGS_64) := OBJS += $(BASEPROG:%=%.64.o) 39$(BASEPROG)_32_pkcs := OBJS += $(COMMONDIR)/cryptotest_pkcs.32.o 40$(BASEPROG)_64_pkcs := OBJS += $(COMMONDIR)/cryptotest_pkcs.64.o 41$(BASEPROG)_32_kcf := OBJS += $(COMMONDIR)/cryptotest_kcf.32.o 42$(BASEPROG)_64_kcf := OBJS += $(COMMONDIR)/cryptotest_kcf.64.o 43 44$(PROGS_pkcs) := LDLIBS += -lpkcs11 -lcryptoutil 45 46CSTD = $(CSTD_GNU99) 47 48CMDS_pkcs = $(PROGS_pkcs:%_pkcs=$(TESTDIR_pkcs)/%) 49CMDS_kcf = $(PROGS_kcf:%_kcf=$(TESTDIR_kcf)/%) 50CMDS = $(CMDS_pkcs) $(CMDS_kcf) 51 52$(CMDS) := FILEMODE = 0555 53 54CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 55CPPFLAGS += -I$(COMMONDIR) -I$(SRC)/common/crypto/ 56 57all: $(PROGS) 58 59%_32_pkcs: %.32.o 60 $(LINK.c) $(OBJS) -o $@ $(LDLIBS) 61 $(POST_PROCESS) 62 63%_64_pkcs: %.64.o 64 $(LINK64.c) $(OBJS) -o $@ $(LDLIBS) 65 $(POST_PROCESS) 66 67%_32_kcf: %.32.o 68 $(LINK.c) $(OBJS) -o $@ $(LDLIBS) 69 $(POST_PROCESS) 70 71%_64_kcf: %.64.o 72 $(LINK64.c) $(OBJS) -o $@ $(LDLIBS) 73 $(POST_PROCESS) 74 75%.32.o: %.c 76 $(COMPILE.c) -o $@ $< 77 $(POST_PROCESS_O) 78 79%.64.o: %.c 80 $(COMPILE64.c) -o $@ $< 81 $(POST_PROCESS_O) 82 83 echo $(CMDS_kcf) 84 85install: all $(CMDS) 86 87clobber: clean 88 -$(RM) $(PROGS) 89 90clean: 91 -$(RM) *.o 92 93$(CMDS): $(TESTDIR_pkcs) $(TESTDIR_kcf) $(PROGS) 94 95$(TESTDIR_pkcs) $(TESTDIR_kcf): 96 $(INS.dir) 97 98$(TESTDIR_pkcs)/%_32: %_32_pkcs 99 $(INS.rename) 100 101$(TESTDIR_pkcs)/%_64: %_64_pkcs 102 $(INS.rename) 103 104$(TESTDIR_kcf)/%_32: %_32_kcf 105 $(INS.rename) 106 107$(TESTDIR_kcf)/%_64: %_64_kcf 108 $(INS.rename) 109