1#
2# CDDL HEADER START
3#
4# The contents of this file are subject to the terms of the
5# Common Development and Distribution License (the "License").
6# You may not use this file except in compliance with the License.
7#
8# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9# or http://www.opensolaris.org/os/licensing.
10# See the License for the specific language governing permissions
11# and limitations under the License.
12#
13# When distributing Covered Code, include this CDDL HEADER in each
14# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15# If applicable, add the following below this CDDL HEADER, with the
16# fields enclosed by brackets "[]" replaced with your own identifying
17# information: Portions Copyright [yyyy] [name of copyright owner]
18#
19# CDDL HEADER END
20#
21#
22# Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
23# Copyright 2018-2021 Tintri by DDN, Inc. All rights reserved.
24#
25
26
27PROG=	test-encrypt test-decrypt
28
29LIBFAKEKERN=../../../lib/libfakekernel/common
30LIBFKSMBSRV=../../../lib/smbsrv/libfksmbsrv/common
31SMBSRV_SRCDIR=../../../uts/common/fs/smbsrv
32SMBSRV_CMNDIR=../../../common/smbsrv
33
34include ../../Makefile.cmd
35include ../../Makefile.ctf
36
37ZGUIDANCE=
38
39# Note: need our sys includes _before_ ENVCPPFLAGS, proto etc.
40# The real cmn_err.h has conflicts w stdio printf (fix?)
41CPPFLAGS.first += -I.
42CPPFLAGS.first += -I$(LIBFAKEKERN)
43
44INCS +=	-I../../../uts/common
45INCS +=	-I../../../uts/common/smbsrv
46INCS +=	-I../../../common/smbsrv
47
48CSTD=		$(CSTD_GNU99)
49C99LMODE=	-Xc99=%all
50
51CFLAGS += $(CCVERBOSE)
52CFLAGS64 += $(CCVERBOSE)
53
54CERRWARN	+= -_gcc=-Wno-parentheses
55
56CPPFLAGS += -D_REENTRANT
57CPPFLAGS += -DTESTJIG
58CPPFLAGS += -Dsyslog=smb_syslog
59CPPFLAGS += -D_LARGEFILE64_SOURCE=1
60CPPFLAGS += -D_FAKE_KERNEL
61
62# Always debug here
63CPPFLAGS += -DDEBUG
64CPPFLAGS += $(INCS)
65
66LDFLAGS += $(ZNOLAZYLOAD)
67LDLIBS += -lfakekernel
68LDLIBS += -lpkcs11
69
70ROOTSMBDDIR = $(ROOTLIB)/smbsrv
71ROOTSMBDFILE = $(PROG:%=$(ROOTSMBDDIR)/%)
72
73OBJS=
74
75.KEEP_STATE:
76
77all: $(PROG)
78
79install: all $(ROOTSMBDFILE)
80
81clean:
82	-$(RM) *.o
83
84lint:
85
86TEOBJS= test_encrypt.o utils.o fksmb_encrypt_pkcs.o
87test-encrypt := OBJS = $(TEOBJS)
88test-encrypt : $(TEOBJS)
89	$(LINK.c) -o $@ $(OBJS) $(LDLIBS)
90	$(POST_PROCESS)
91
92
93TDOBJS= test_decrypt.o utils.o fksmb_encrypt_pkcs.o
94test-decrypt := OBJS = $(TDOBJS)
95test-decrypt : $(TDOBJS)
96	$(LINK.c) -o $@ $(OBJS) $(LDLIBS)
97	$(POST_PROCESS)
98
99include ../../Makefile.targ
100
101# LIBFKSMBSRV
102%.o: $(LIBFKSMBSRV)/%.c
103	$(CC) $(CFLAGS) $(CPPFLAGS) \
104	  -I../../../uts/common/smbsrv \
105	  -I../../../common/smbsrv -c $<
106	$(POST_PROCESS_O)
107
108$(ROOTSMBDDIR)/%: %
109	$(INS.file)
110
111.KEEP_STATE:
112