xref: /illumos-gate/usr/src/cmd/smbsrv/test-msgbuf/Makefile (revision 7d1ffc32e5e72873791b96934af035e0f051fc14)
1*7d1ffc32SGordon Ross#
2*7d1ffc32SGordon Ross# CDDL HEADER START
3*7d1ffc32SGordon Ross#
4*7d1ffc32SGordon Ross# The contents of this file are subject to the terms of the
5*7d1ffc32SGordon Ross# Common Development and Distribution License (the "License").
6*7d1ffc32SGordon Ross# You may not use this file except in compliance with the License.
7*7d1ffc32SGordon Ross#
8*7d1ffc32SGordon Ross# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9*7d1ffc32SGordon Ross# or http://www.opensolaris.org/os/licensing.
10*7d1ffc32SGordon Ross# See the License for the specific language governing permissions
11*7d1ffc32SGordon Ross# and limitations under the License.
12*7d1ffc32SGordon Ross#
13*7d1ffc32SGordon Ross# When distributing Covered Code, include this CDDL HEADER in each
14*7d1ffc32SGordon Ross# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15*7d1ffc32SGordon Ross# If applicable, add the following below this CDDL HEADER, with the
16*7d1ffc32SGordon Ross# fields enclosed by brackets "[]" replaced with your own identifying
17*7d1ffc32SGordon Ross# information: Portions Copyright [yyyy] [name of copyright owner]
18*7d1ffc32SGordon Ross#
19*7d1ffc32SGordon Ross# CDDL HEADER END
20*7d1ffc32SGordon Ross#
21*7d1ffc32SGordon Ross#
22*7d1ffc32SGordon Ross# Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
23*7d1ffc32SGordon Ross# Copyright 2018 Nexenta Systems, Inc.  All rights reserved.
24*7d1ffc32SGordon Ross#
25*7d1ffc32SGordon Ross
26*7d1ffc32SGordon Ross
27*7d1ffc32SGordon RossPROG=	test-msgbuf
28*7d1ffc32SGordon Ross
29*7d1ffc32SGordon RossOBJS_LOCAL=	test_main.o test_misc.o test_conv.o \
30*7d1ffc32SGordon Ross		test_mbmarshal.o test_msgbuf.o
31*7d1ffc32SGordon RossOBJS_SMBSRV=	smb_mbuf_marshaling.o smb_mbuf_util.o smb_alloc.o
32*7d1ffc32SGordon RossOBJS_SMBCMN=	smb_msgbuf.o smb_string.o smb_utf8.o
33*7d1ffc32SGordon Ross
34*7d1ffc32SGordon RossOBJS=	${OBJS_LOCAL} ${OBJS_SMBSRV}  ${OBJS_SMBCMN}
35*7d1ffc32SGordon Ross
36*7d1ffc32SGordon RossSMBSRV_SRCDIR=../../../uts/common/fs/smbsrv
37*7d1ffc32SGordon RossSMBSRV_CMNDIR=../../../common/smbsrv
38*7d1ffc32SGordon RossSRCS=	${OBJS_LOCAL:.o=.c} \
39*7d1ffc32SGordon Ross	${OBJS_SMBSRV:%.o=${SMBSRV_SRCDIR}/%.c} \
40*7d1ffc32SGordon Ross	${OBJS_SMBCMN:%.o=${SMBSRV_CMNDIR}/%.c}
41*7d1ffc32SGordon Ross
42*7d1ffc32SGordon Rossinclude ../../Makefile.cmd
43*7d1ffc32SGordon Rossinclude ../../Makefile.ctf
44*7d1ffc32SGordon Ross
45*7d1ffc32SGordon Ross# Note: need our sys includes _before_ ENVCPPFLAGS, proto etc.
46*7d1ffc32SGordon RossCPPFLAGS.first += -I.
47*7d1ffc32SGordon RossCPPFLAGS.first += -I../../../lib/libfakekernel/common
48*7d1ffc32SGordon RossCPPFLAGS.first += -I../../../lib/smbsrv/libfksmbsrv/common
49*7d1ffc32SGordon Ross
50*7d1ffc32SGordon RossINCS +=	-I../../../uts/common
51*7d1ffc32SGordon RossINCS +=	-I../../../uts/common/smbsrv
52*7d1ffc32SGordon RossINCS +=	-I../../../common/smbsrv
53*7d1ffc32SGordon Ross
54*7d1ffc32SGordon RossCSTD=		$(CSTD_GNU99)
55*7d1ffc32SGordon RossC99LMODE=	-Xc99=%all
56*7d1ffc32SGordon Ross
57*7d1ffc32SGordon RossCFLAGS += $(CCVERBOSE)
58*7d1ffc32SGordon RossCFLAGS64 += $(CCVERBOSE)
59*7d1ffc32SGordon Ross
60*7d1ffc32SGordon RossCERRWARN	+= -_gcc=-Wno-parentheses
61*7d1ffc32SGordon Ross
62*7d1ffc32SGordon RossCPPFLAGS += -D_REENTRANT
63*7d1ffc32SGordon RossCPPFLAGS += -DTESTJIG
64*7d1ffc32SGordon RossCPPFLAGS += -Dsyslog=smb_syslog
65*7d1ffc32SGordon RossCPPFLAGS += -D_LARGEFILE64_SOURCE=1
66*7d1ffc32SGordon Ross# Always debug here
67*7d1ffc32SGordon RossCPPFLAGS += -DDEBUG
68*7d1ffc32SGordon RossCPPFLAGS += $(INCS)
69*7d1ffc32SGordon Ross
70*7d1ffc32SGordon RossLDFLAGS += $(ZNOLAZYLOAD)
71*7d1ffc32SGordon RossLDFLAGS += '-R$$ORIGIN/..'
72*7d1ffc32SGordon RossLDLIBS += -lfakekernel -lcmdutils
73*7d1ffc32SGordon Ross
74*7d1ffc32SGordon RossLINTFLAGS += -xerroff=E_NAME_DEF_NOT_USED2
75*7d1ffc32SGordon RossLINTFLAGS += -xerroff=E_NAME_USED_NOT_DEF2
76*7d1ffc32SGordon RossLINTFLAGS += -xerroff=E_INCONS_ARG_DECL2
77*7d1ffc32SGordon RossLINTFLAGS += -xerroff=E_INCONS_VAL_TYPE_DECL2
78*7d1ffc32SGordon Ross
79*7d1ffc32SGordon RossROOTSMBDDIR = $(ROOTLIB)/smbsrv
80*7d1ffc32SGordon RossROOTSMBDFILE = $(PROG:%=$(ROOTSMBDDIR)/%)
81*7d1ffc32SGordon Ross
82*7d1ffc32SGordon Ross.KEEP_STATE:
83*7d1ffc32SGordon Ross
84*7d1ffc32SGordon Rossall: $(PROG)
85*7d1ffc32SGordon Ross
86*7d1ffc32SGordon Ross$(PROG): $(OBJS)
87*7d1ffc32SGordon Ross	$(LINK.c) -o $(PROG) $(OBJS) $(LDLIBS)
88*7d1ffc32SGordon Ross	$(POST_PROCESS)
89*7d1ffc32SGordon Ross
90*7d1ffc32SGordon Rossclean:
91*7d1ffc32SGordon Ross	-$(RM) $(OBJS)
92*7d1ffc32SGordon Ross
93*7d1ffc32SGordon Rosslint:	# lint_SRCS
94*7d1ffc32SGordon Ross
95*7d1ffc32SGordon Rossinclude ../../Makefile.targ
96*7d1ffc32SGordon Ross
97*7d1ffc32SGordon Rossinstall: all $(ROOTSMBDFILE)
98*7d1ffc32SGordon Ross
99*7d1ffc32SGordon Rosstest_main.o : test_main.c
100*7d1ffc32SGordon Ross	$(CC) $(CFLAGS) $(CPPFLAGS) -D_KMEMUSER -c test_main.c
101*7d1ffc32SGordon Ross	$(POST_PROCESS_O)
102*7d1ffc32SGordon Ross
103*7d1ffc32SGordon Rosstest_misc.o : test_misc.c
104*7d1ffc32SGordon Ross	$(CC) $(CFLAGS) $(CPPFLAGS) -D_FAKE_KERNEL \
105*7d1ffc32SGordon Ross	  -I../../../uts/common/smbsrv \
106*7d1ffc32SGordon Ross	  -I../../../common/smbsrv -c test_misc.c
107*7d1ffc32SGordon Ross	$(POST_PROCESS_O)
108*7d1ffc32SGordon Ross
109*7d1ffc32SGordon Ross# OBJS_SMBSRV
110*7d1ffc32SGordon Ross%.o: ../../../uts/common/fs/smbsrv/%.c
111*7d1ffc32SGordon Ross	$(CC) $(CFLAGS) $(CPPFLAGS) -D_FAKE_KERNEL \
112*7d1ffc32SGordon Ross	  -I../../../uts/common/smbsrv \
113*7d1ffc32SGordon Ross	  -I../../../common/smbsrv -c $<
114*7d1ffc32SGordon Ross	$(POST_PROCESS_O)
115*7d1ffc32SGordon Ross
116*7d1ffc32SGordon Ross# OBJS_SMBCMN
117*7d1ffc32SGordon Ross%.o: ../../../common/smbsrv/%.c
118*7d1ffc32SGordon Ross	$(CC) $(CFLAGS) $(CPPFLAGS) -D_FAKE_KERNEL \
119*7d1ffc32SGordon Ross	  -I../../../uts/common/smbsrv \
120*7d1ffc32SGordon Ross	  -I../../../common/smbsrv -c $<
121*7d1ffc32SGordon Ross	$(POST_PROCESS_O)
122*7d1ffc32SGordon Ross
123*7d1ffc32SGordon Ross$(ROOTSMBDDIR)/%: %
124*7d1ffc32SGordon Ross	$(INS.file)
125