1 # usmb - mount SMB shares via FUSE and Samba
5 # Copyright (C) 2006-2010 Geoff Johnstone
7 # This program is free software; you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License version 3 as
9 # published by the Free Software Foundation.
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with this program. If not, see <http://www.gnu.org/licenses/>.
21 prefix = ${DESTDIR}@
prefix@
22 exec_prefix = @
exec_prefix@
25 man1dir = $(mandir)/man1
27 CFLAGS
= @CFLAGS@
-I@
srcdir@
-I@builddir@
-Werror
31 CFLAGS
+= @LIBXML2_CFLAGS@ @GLIB_CFLAGS@ @FUSE_CFLAGS@
32 LIBS
+= @LIBXML2_LIBS@ @GLIB_LIBS@ @FUSE_LIBS@
34 SOURCES
= conffile.c options.c password.c usmb.c usmb_dir.c usmb_file.c \
35 utils.c version.c xml.c samba@SAMBA_VERSION@_compat.c
36 OBJECTS
= $(SOURCES
:.c
=.o
)
38 PROGRAM
= @PACKAGE_NAME@
39 MANPAGE
= @PACKAGE_NAME@
.1
42 all: $(PROGRAM
) $(MANPAGE
)
44 $(PROGRAM
): $(OBJECTS
)
45 $(CC
) $(LDFLAGS
) -o
$@
$^
$(LIBS
)
49 $(RM
) $(PROGRAM
) $(OBJECTS
)
50 $(RM
) $(MANPAGE
) $(MANPAGE
).xml
54 $(RM
) -r core usmb-
*.
tar.bz2 usmb-
*.
tar.gz doc
/*.mdzip.bak config.rng.h \
55 autom4te.cache config.h.in~ config.status config.log config.h \
59 $(RM
) configure config.h.in autom4te.cache
62 install-strip
: STRIPFLAGS
= -s
63 install install-strip
: $(PROGRAM
)
65 @INSTALL@
-m
755 $(STRIPFLAGS
) $(PROGRAM
) $(bindir)/
67 @INSTALL@
-m
644 $(MANPAGE
) $(man1dir)/
71 $(RM
) $(bindir)/$(PROGRAM
)
73 $(RM
) $(man1dir)/$(MANPAGE
)
75 @echo Please delete ~
/.usmb.conf manually.
80 # In case package name changed
81 $(MANPAGE
).txt
: usmb
.1.txt
82 ln
-s usmb
.1.txt
$(MANPAGE
).txt
86 PACKAGE
= @PACKAGE_NAME@
88 VERSION
= $(shell grep
'USMB_VERSION[^_]' version.h | sed
's/.*0x//')
91 ARCHIVE
= $(shell git show
$(SNAPSHOT
) '--pretty=format:%h' | head
-n1
)
92 VERSION
= $(shell date
-ud
"$(shell git show $(SNAPSHOT) '--pretty=format:%cD' | head -n1 )" "+%Y%m%d%H%M%S")~
$(ARCHIVE
)
95 tar: STAGING
=/tmp
/usmb-
$(VERSION
)
98 git archive
$(ARCHIVE
) |
tar -C
$(STAGING
) -x
-f
-
99 git log
> $(STAGING
)/Changelog
102 rm -rf autom4te.cache
)
103 (cd
$(STAGING
)/..
&& \
104 tar jcf
$(PWD
)/$(PACKAGE
)-$(VERSION
).
tar.bz2
$(PACKAGE
)-$(VERSION
) && \
105 tar zcf
$(PWD
)/$(PACKAGE
)-$(VERSION
).
tar.gz
$(PACKAGE
)-$(VERSION
))
108 include debian
/Makefile.pkgdeb
110 config.rng.h
: @
srcdir@
/config.rng
111 @SED@
-e
's/"/\\"/g' -e
's/\(.*\)/ "\1" \\/' \
112 -e
'1istatic const char *rng_$(@:.rng.h=) =' $^
> config.rng.h
113 echo
' "";' >> config.rng.h
117 $(CC
) $(CFLAGS
) -c
-o
$@
$<
123 .PHONY
: all debug
dist install install-strip
uninstall clean distclean tar
125 conffile.o
: @
srcdir@
/conffile.c @
srcdir@
/utils.h @
srcdir@
/xml.h \
126 @builddir@
/config.rng.h
127 options.o
: @
srcdir@
/options.c @
srcdir@
/options.h @
srcdir@
/utils.h \
129 password.o
: @
srcdir@
/password.c @
srcdir@
/password.h @
srcdir@
/utils.h
130 usmb.o
: @
srcdir@
/usmb.c @
srcdir@
/conffile.h @
srcdir@
/options.h \
131 @
srcdir@
/usmb.h @
srcdir@
/usmb_dir.h @
srcdir@
/usmb_file.h \
132 @
srcdir@
/utils.h @
srcdir@
/password.h @
srcdir@
/version.h \
133 @
srcdir@
/samba3x-compat.h
134 usmb_dir.o
: @
srcdir@
/samba3x-compat.h @
srcdir@
/usmb_dir.c @
srcdir@
/usmb_dir.h \
135 @
srcdir@
/usmb.h @
srcdir@
/utils.h
136 usmb_file.o
: @
srcdir@
/samba3x-compat.h @
srcdir@
/usmb_file.c \
137 @
srcdir@
/usmb_file.h @
srcdir@
/usmb.h @
srcdir@
/utils.h
138 utils.o
: @
srcdir@
/utils.c @
srcdir@
/utils.h
139 version.o
: @
srcdir@
/version.c @
srcdir@
/version.h
140 xml.o
: @
srcdir@
/xml.c @
srcdir@
/xml.h @
srcdir@
/utils.h