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