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 Ross 56*7d1ffc32SGordon RossCFLAGS += $(CCVERBOSE) 57*7d1ffc32SGordon RossCFLAGS64 += $(CCVERBOSE) 58*7d1ffc32SGordon Ross 59*7d1ffc32SGordon RossCERRWARN += -_gcc=-Wno-parentheses 60*7d1ffc32SGordon Ross 61*7d1ffc32SGordon RossCPPFLAGS += -D_REENTRANT 62*7d1ffc32SGordon RossCPPFLAGS += -DTESTJIG 63*7d1ffc32SGordon RossCPPFLAGS += -Dsyslog=smb_syslog 64*7d1ffc32SGordon RossCPPFLAGS += -D_LARGEFILE64_SOURCE=1 65*7d1ffc32SGordon Ross# Always debug here 66*7d1ffc32SGordon RossCPPFLAGS += -DDEBUG 67*7d1ffc32SGordon RossCPPFLAGS += $(INCS) 68*7d1ffc32SGordon Ross 69*7d1ffc32SGordon RossLDFLAGS += $(ZNOLAZYLOAD) 70*7d1ffc32SGordon RossLDFLAGS += '-R$$ORIGIN/..' 71*7d1ffc32SGordon RossLDLIBS += -lfakekernel -lcmdutils 72*7d1ffc32SGordon Ross 73*7d1ffc32SGordon RossROOTSMBDDIR = $(ROOTLIB)/smbsrv 74*7d1ffc32SGordon RossROOTSMBDFILE = $(PROG:%=$(ROOTSMBDDIR)/%) 75*7d1ffc32SGordon Ross 76*7d1ffc32SGordon Ross.KEEP_STATE: 77*7d1ffc32SGordon Ross 78*7d1ffc32SGordon Rossall: $(PROG) 79*7d1ffc32SGordon Ross 80*7d1ffc32SGordon Ross$(PROG): $(OBJS) 81*7d1ffc32SGordon Ross $(LINK.c) -o $(PROG) $(OBJS) $(LDLIBS) 82*7d1ffc32SGordon Ross $(POST_PROCESS) 83*7d1ffc32SGordon Ross 84*7d1ffc32SGordon Rossclean: 85*7d1ffc32SGordon Ross -$(RM) $(OBJS) 86*7d1ffc32SGordon Ross 87*7d1ffc32SGordon Rossinclude ../../Makefile.targ 88*7d1ffc32SGordon Ross 89*7d1ffc32SGordon Rossinstall: all $(ROOTSMBDFILE) 90*7d1ffc32SGordon Ross 91*7d1ffc32SGordon Rosstest_main.o : test_main.c 92*7d1ffc32SGordon Ross $(CC) $(CFLAGS) $(CPPFLAGS) -D_KMEMUSER -c test_main.c 93*7d1ffc32SGordon Ross $(POST_PROCESS_O) 94*7d1ffc32SGordon Ross 95*7d1ffc32SGordon Rosstest_misc.o : test_misc.c 96*7d1ffc32SGordon Ross $(CC) $(CFLAGS) $(CPPFLAGS) -D_FAKE_KERNEL \ 97*7d1ffc32SGordon Ross -I../../../uts/common/smbsrv \ 98*7d1ffc32SGordon Ross -I../../../common/smbsrv -c test_misc.c 99*7d1ffc32SGordon Ross $(POST_PROCESS_O) 100*7d1ffc32SGordon Ross 101*7d1ffc32SGordon Ross# OBJS_SMBSRV 102*7d1ffc32SGordon Ross%.o: ../../../uts/common/fs/smbsrv/%.c 103*7d1ffc32SGordon Ross $(CC) $(CFLAGS) $(CPPFLAGS) -D_FAKE_KERNEL \ 104*7d1ffc32SGordon Ross -I../../../uts/common/smbsrv \ 105*7d1ffc32SGordon Ross -I../../../common/smbsrv -c $< 106*7d1ffc32SGordon Ross $(POST_PROCESS_O) 107*7d1ffc32SGordon Ross 108*7d1ffc32SGordon Ross# OBJS_SMBCMN 109*7d1ffc32SGordon Ross%.o: ../../../common/smbsrv/%.c 110*7d1ffc32SGordon Ross $(CC) $(CFLAGS) $(CPPFLAGS) -D_FAKE_KERNEL \ 111*7d1ffc32SGordon Ross -I../../../uts/common/smbsrv \ 112*7d1ffc32SGordon Ross -I../../../common/smbsrv -c $< 113*7d1ffc32SGordon Ross $(POST_PROCESS_O) 114*7d1ffc32SGordon Ross 115*7d1ffc32SGordon Ross$(ROOTSMBDDIR)/%: % 116*7d1ffc32SGordon Ross $(INS.file) 117