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# 16 17include $(SRC)/test/Makefile.com 18 19CRYPTO = pkcs kcf 20PROGS = $(CRYPTO:%=$(PROG)_%) 21ROOTOPTPKG = $(ROOT)/opt/crypto-tests 22TESTROOT = $(ROOTOPTPKG)/tests/#$(SUFFIX)/aes 23TESTDIR = $(CRYPTO:%=$(TESTROOT)/%/aes) 24 25COMMONDIR = ../../../common 26OBJS_COMMON = testfuncs.o 27OBJS_COMDIR = $(OBJS_COMMON:%=$(COMMONDIR)/%) 28OBJS_LOCAL = $(PROG:%=%.o) 29OBJS = $(OBJS_LOCAL) $(OBJS_COMDIR) 30OBJS_PKCS = $(OBJS_LOCAL) $(OBJS_COMDIR) $(COMMONDIR)/cryptotest_pkcs.o 31OBJS_KCF = $(OBJS_LOCAL) $(OBJS_COMDIR) $(COMMONDIR)/cryptotest_kcf.o 32SRCS = $(OBJS:%.o=%.c) 33PKCSLIBS = -lpkcs11 -lcryptoutil 34 35CSTD = $(CSTD_GNU99) 36 37CMDS = $(TESTDIR:%=%/$(PROG)) 38$(CMDS) := FILEMODE = 0555 39 40LINTFLAGS += -xerroff=E_NAME_USED_NOT_DEF2 41LINTFLAGS += -xerroff=E_NAME_DEF_NOT_USED2 42 43CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 44CPPFLAGS += -I$(COMMONDIR) -I$(SRC)/common/crypto/ 45 46all: $(PROGS) 47 48$(PROG)_kcf: $(OBJS_KCF) 49 $(LINK.c) $(OBJS_KCF) -o $@ $(LDLIBS) 50 $(POST_PROCESS) 51 52$(PROG)_pkcs: $(OBJS_PKCS) 53 $(LINK.c) $(OBJS_PKCS) -o $@ $(LDLIBS) $(PKCSLIBS) 54 $(POST_PROCESS) 55 56 57$(COMMONDIR)/%.o: 58 59%.o: %.c 60 $(COMPILE.c) -o $@ $< 61 62install: all $(CMDS) 63 64lint: $(CRYPTO:%=lint_%) 65 66lint_pkcs: 67 $(LINT.c) $(OBJS_PKCS:%.o=%.c) $(LDLIBS) $(PKCSLIBS) 68 69lint_kcf: 70 $(LINT.c) $(OBJS_KCF:%.o=%.c) $(LDLIBS) 71clobber: clean 72 -$(RM) $(PROGS) 73 74clean: 75 -$(RM) $(OBJS_LOCAL) 76 77$(CMDS): $(TESTDIR) $(PROGS) 78 79$(TESTDIR): 80 $(INS.dir) 81 82$(TESTROOT)/%/aes/$(PROG): $(PROG)_% 83 $(INS.rename) 84