1#
2# Samba Makefile
3#
4# $ Copyright Open Broadcom Corporation 2010 $
5#
6# $Id: Makefile,v 1.6 2010-07-17 02:57:34 kenlo Exp $
7#
8
9export SAMBA_TOP := $(shell pwd)
10
11SAMBA_SRC=source
12
13CFLAGS += -DLINUX
14
15DIRS := ${SAMBA_SRC}
16
17.PHONY: all
18all: samba
19
20.PHONY: configure
21configure:
22	[ -f $(SAMBA_SRC)/Makefile ] || \
23	(cd $(SAMBA_SRC); \
24	 export SMB_BUILD_CC_NEGATIVE_ENUM_VALUES=yes ; \
25	 export libreplace_cv_READDIR_GETDIRENTRIES=no ; \
26	 export libreplace_cv_READDIR_GETDENTS=no ; \
27	 export linux_getgrouplist_ok=no ; \
28	 export samba_cv_REPLACE_READDIR=no ; \
29	 export samba_cv_HAVE_WRFILE_KEYTAB=yes ; \
30	 export samba_cv_HAVE_KERNEL_OPLOCKS_LINUX=yes ; \
31	 export samba_cv_HAVE_IFACE_IFCONF=yes ; \
32	 export samba_cv_USE_SETRESUID=yes ; \
33	 CC=$(CC) ./configure \
34	    --target=arm-brcm-linux-uclibcgnueabi \
35	    --host=arm-brcm-linux-uclibcgnueabi \
36	    --build=`/bin/arch`-linux \
37	    --enable-shared \
38	    --disable-static \
39	    --disable-cups \
40	    --disable-iprint \
41	    --disable-pie \
42	    --disable-fam \
43	    --localstatedir=/tmp/samba/lib/ \
44	    --with-configdir=/usr/local/samba/lib/ \
45	    --with-privatedir=/usr/local/samba/private \
46	    --with-lockdir=/usr/local/samba/var/locks \
47	    --with-piddir=/usr/local/samba/var/locks \
48	    --without-ldap \
49	    --without-sys-quotas \
50	    --without-cifsmount \
51	    --prefix=/usr/local/samba; \
52	)
53
54.PHONY: samba
55samba: configure headers
56	+$(MAKE) -C $(SAMBA_SRC)
57
58.PHONY: headers
59headers: configure
60	+$(MAKE) -C $(SAMBA_SRC) headers
61
62.PHONY: install
63install: all
64	install -d $(TARGETDIR)/usr/local/
65	install -d $(TARGETDIR)/usr/local/samba
66	install -d $(TARGETDIR)/usr/local/samba/lib
67	install -d $(TARGETDIR)/tmp/samba/
68	install -d $(TARGETDIR)/tmp/samba/private
69	install -d $(TARGETDIR)/etc
70	install -m 755 $(SAMBA_SRC)/../data/group $(TARGETDIR)/etc
71	install -m 755 $(SAMBA_SRC)/../data/lmhosts $(TARGETDIR)/usr/local/samba/lib
72	install -m 755 $(SAMBA_SRC)/bin/smb_pass  $(TARGETDIR)/usr/local/samba/
73	install -m 755 $(SAMBA_SRC)/bin/nmbd  $(TARGETDIR)/usr/local/samba/
74	install -m 755 $(SAMBA_SRC)/bin/smbd  $(TARGETDIR)/usr/local/samba/
75	install -m 755 $(SAMBA_SRC)/bin/libbigballofmud.so $(TARGETDIR)/usr/lib/libbigballofmud.so.0
76	$(STRIP) $(TARGETDIR)/usr/local/samba/smbd
77	$(STRIP) $(TARGETDIR)/usr/local/samba/nmbd
78	$(STRIP) $(TARGETDIR)/usr/local/samba/smb_pass
79	cd $(TARGETDIR)/usr/local/samba && unlink  private || pwd
80	cd $(TARGETDIR)/usr/local/samba && unlink  var || pwd
81	cd $(TARGETDIR)/usr/local/samba && unlink  lock || pwd
82	cd $(TARGETDIR)/usr/local/samba && ln -sf ../../../tmp/samba/private private
83	cd $(TARGETDIR)/usr/local/samba && ln -sf ../../../var var
84	cd $(TARGETDIR)/usr/local/samba && ln -sf ../../../var/lock lock
85	cd $(TARGETDIR)/usr/local/samba/lib && ln -sf ../../../tmp/samba/private/smb.conf smb.conf
86	cd $(TARGETDIR)/etc && unlink passwd || pwd
87	cd $(TARGETDIR)/etc && ln -sf ../tmp/samba/private/passwd passwd
88
89install-%:
90	+$(MAKE) -C $(patsubst install-%,%,$@) install
91
92.PHONY: clean
93clean: $(addprefix clean-,${DIRS})
94
95.PHONY: $(addprefix clean-,${DIRS})
96$(addprefix clean-,${DIRS}):
97	+$(MAKE) -C $(patsubst clean-%,%,$@) clean
98