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