Major manpage overhaul.
[usmb.git] / Makefile.in
blob2cb4954cc30b53533566abe09497fae7d0982c91
1 # usmb - mount SMB shares via FUSE and Samba
3 # @configure_input@
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/>.
19 CC = @CC@
21 prefix = ${DESTDIR}@prefix@
22 exec_prefix = @exec_prefix@
23 bindir = @bindir@
24 mandir = @mandir@
25 man1dir = $(mandir)/man1
27 CFLAGS = @CFLAGS@ -I@srcdir@ -I@builddir@ -Werror
28 LDFLAGS = @LDFLAGS@
29 LIBS = @LIBS@
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)
48 clean:
49 $(RM) $(PROGRAM) $(OBJECTS)
50 $(RM) $(MANPAGE) $(MANPAGE).xml
53 distclean: clean
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 \
56 Makefile
58 allclean: distclean
59 $(RM) configure config.h.in autom4te.cache
62 install-strip: STRIPFLAGS = -s
63 install install-strip: $(PROGRAM)
64 @MKDIR_P@ $(bindir)
65 @INSTALL@ -m 755 $(STRIPFLAGS) $(PROGRAM) $(bindir)/
66 @MKDIR_P@ $(man1dir)
67 @INSTALL@ -m 644 $(MANPAGE) $(man1dir)/
70 uninstall:
71 $(RM) $(bindir)/$(PROGRAM)
72 rmdir -p $(bindir)
73 $(RM) $(man1dir)/$(MANPAGE)
74 rmdir -p $(man1dir)
75 @echo Please delete ~/.usmb.conf manually.
77 %.1: %.1.txt
78 a2x -f manpage $<
80 # In case package name changed
81 $(MANPAGE).txt: usmb.1.txt
82 ln -s usmb.1.txt $(MANPAGE).txt
84 dist: tar
86 PACKAGE = @PACKAGE_NAME@
87 ifeq ($(SNAPSHOT),)
88 VERSION = $(shell grep 'USMB_VERSION[^_]' version.h | sed 's/.*0x//')
89 ARCHIVE = $(VERSION)
90 else
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)
93 endif
95 tar: STAGING=/tmp/usmb-$(VERSION)
96 tar:
97 mkdir $(STAGING)
98 git archive $(ARCHIVE) | tar -C $(STAGING) -x -f -
99 git log > $(STAGING)/Changelog
100 (cd $(STAGING) && \
101 autoreconf && \
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))
106 rm -rf $(STAGING)
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
116 %.o: @srcdir@/%.c
117 $(CC) $(CFLAGS) -c -o $@ $<
119 %: %.in
120 ./config.status
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 \
128 @srcdir@/version.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