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 -I$(COMMONDIR) -I$(SRC)/common/crypto/ 44 45all: $(PROGS) 46 47$(PROG)_kcf: $(OBJS_KCF) 48 $(LINK.c) $(OBJS_KCF) -o $@ $(LDLIBS) 49 $(POST_PROCESS) 50 51$(PROG)_pkcs: $(OBJS_PKCS) 52 $(LINK.c) $(OBJS_PKCS) -o $@ $(LDLIBS) $(PKCSLIBS) 53 $(POST_PROCESS) 54 55 56$(COMMONDIR)/%.o: 57 58%.o: %.c 59 $(COMPILE.c) -o $@ $< 60 61install: all $(CMDS) 62 63lint: $(CRYPTO:%=lint_%) 64 65lint_pkcs: 66 $(LINT.c) $(OBJS_PKCS:%.o=%.c) $(LDLIBS) $(PKCSLIBS) 67 68lint_kcf: 69 $(LINT.c) $(OBJS_KCF:%.o=%.c) $(LDLIBS) 70clobber: clean 71 -$(RM) $(PROGS) 72 73clean: 74 -$(RM) $(OBJS_LOCAL) 75 76$(CMDS): $(TESTDIR) $(PROGS) 77 78$(TESTDIR): 79 $(INS.dir) 80 81$(TESTROOT)/%/aes/$(PROG): $(PROG)_% 82 $(INS.rename) 83