xref: /dragonfly/contrib/smbfs/Makefile (revision 86d7f5d3)
1*86d7f5d3SJohn Marino#	$Id: Makefile,v 1.12 2001/04/16 04:34:26 bp Exp $
2*86d7f5d3SJohn Marino#
3*86d7f5d3SJohn Marino#	Valid targets:
4*86d7f5d3SJohn Marino#	install		installs binaries and man pages
5*86d7f5d3SJohn Marino#	deinstall	undo install (except man pages)
6*86d7f5d3SJohn Marino#	install-src	copy .h files in /usr/local/include
7*86d7f5d3SJohn Marino#	install-lib	copy lib files in /usr/lib
8*86d7f5d3SJohn Marino#	deinstall-lib,
9*86d7f5d3SJohn Marino#	deinstall-src	undo corresponding install-* target
10*86d7f5d3SJohn Marino#	clean		cleanup source tree
11*86d7f5d3SJohn Marino
12*86d7f5d3SJohn Marino.if ${MACHINE_ARCH} != "i386"
13*86d7f5d3SJohn Marino.	error "only IA32 machines supported"
14*86d7f5d3SJohn Marino.endif
15*86d7f5d3SJohn Marino
16*86d7f5d3SJohn MarinoCONFIG_INT?=	config.int
17*86d7f5d3SJohn MarinoCONFIG_MK?=	config.mk
18*86d7f5d3SJohn Marino
19*86d7f5d3SJohn MarinoCFGDEPEND=
20*86d7f5d3SJohn Marino
21*86d7f5d3SJohn Marino.ifmake !configure && !clean
22*86d7f5d3SJohn Marino.  if !exists(${CONFIG_INT})
23*86d7f5d3SJohn Marino.	error "Run 'make configure' before build"
24*86d7f5d3SJohn Marino.  else
25*86d7f5d3SJohn Marino.	include "${CONFIG_INT}"
26*86d7f5d3SJohn Marino.  endif
27*86d7f5d3SJohn Marino.else
28*86d7f5d3SJohn Marino.  if exists(${CONFIG_MK})
29*86d7f5d3SJohn MarinoCFGDEPEND=	${CONFIG_MK}
30*86d7f5d3SJohn Marino
31*86d7f5d3SJohn Marino${CONFIG_MK}:	config.mk.in
32*86d7f5d3SJohn Marino	@echo Your ${CONFIG_MK} file is older than the config.mk.in file
33*86d7f5d3SJohn Marino	@echo Please check for possible changes
34*86d7f5d3SJohn Marino	@false
35*86d7f5d3SJohn Marino
36*86d7f5d3SJohn Marino.	include "${CONFIG_MK}"
37*86d7f5d3SJohn Marino.  endif
38*86d7f5d3SJohn Marino.endif
39*86d7f5d3SJohn Marino
40*86d7f5d3SJohn MarinoBUILDKLD?=yes
41*86d7f5d3SJohn MarinoPREFIX?=/usr/local
42*86d7f5d3SJohn MarinoSYSDIR?=/usr/src/sys
43*86d7f5d3SJohn Marino
44*86d7f5d3SJohn Marinoconfigure::
45*86d7f5d3SJohn Marino.if ${CFGDEPEND} == ${CONFIG_MK}
46*86d7f5d3SJohn Marino	@echo Using ${CFGDEPEND} file...
47*86d7f5d3SJohn Marino.endif
48*86d7f5d3SJohn Marino	echo PREFIX= ${PREFIX} > ${CONFIG_INT}
49*86d7f5d3SJohn Marino	echo SYSDIR=${SYSDIR} >> ${CONFIG_INT}
50*86d7f5d3SJohn Marino	echo KMODDIR=${KMODDIR} >> ${CONFIG_INT}
51*86d7f5d3SJohn Marino	echo SINGLEKLD=yes >> ${CONFIG_INT}
52*86d7f5d3SJohn Marino.if !defined(WITHOUT_CRYPT)
53*86d7f5d3SJohn Marino	echo ENCRYPTED_PASSWD=yes >> ${CONFIG_INT}
54*86d7f5d3SJohn Marino.endif
55*86d7f5d3SJohn Marino.if defined(SMP_SUPPORT) || defined(SMP)
56*86d7f5d3SJohn Marino	echo SMP=yes >> ${CONFIG_INT}
57*86d7f5d3SJohn Marino.endif
58*86d7f5d3SJohn Marino
59*86d7f5d3SJohn MarinoSUBDIR=
60*86d7f5d3SJohn Marino
61*86d7f5d3SJohn Marino.if defined(COMPLETEBUILD) || (${BUILDKLD} == yes && !exists(${SYSDIR}/netsmb/smb.h))
62*86d7f5d3SJohn MarinoSUBDIR+= kernel/modules
63*86d7f5d3SJohn Marino.endif
64*86d7f5d3SJohn Marino
65*86d7f5d3SJohn MarinoSUBDIR+= lib
66*86d7f5d3SJohn Marino
67*86d7f5d3SJohn MarinoSUBDIR+= mount_smbfs smbutil
68*86d7f5d3SJohn Marino
69*86d7f5d3SJohn Marinoinstall-src install-lib deinstall-lib deinstall-src:
70*86d7f5d3SJohn Marino	cd kernel && make ${.TARGET}
71*86d7f5d3SJohn Marino	cd lib && make ${.TARGET}
72*86d7f5d3SJohn Marino
73*86d7f5d3SJohn Marino
74*86d7f5d3SJohn Marinomakedev:
75*86d7f5d3SJohn Marino	@-( if [ `mount -t devfs | wc -l` = 0 ]; then \
76*86d7f5d3SJohn Marino		cd /dev && && rm -f nsmb* && mknod nsmb0 c 144 0; \
77*86d7f5d3SJohn Marino	    else \
78*86d7f5d3SJohn Marino		echo This operation is not required with devfs; \
79*86d7f5d3SJohn Marino	    fi; \
80*86d7f5d3SJohn Marino	)
81*86d7f5d3SJohn Marino
82*86d7f5d3SJohn Marinocleandepend deinstall: _SUBDIRUSE
83*86d7f5d3SJohn Marino
84*86d7f5d3SJohn Marinoclean: _SUBDIRUSE
85*86d7f5d3SJohn Marino	rm -f ${CONFIG_INT}
86*86d7f5d3SJohn Marino
87*86d7f5d3SJohn Marino.include <bsd.subdir.mk>
88