3f38f83fb616abd6e5d24df7cd9f36c12a4f6e40
[sahlberg/remote-cache.git] / Makefile.in
1 #!gmake
2
3 CC = @CC@
4 prefix = @prefix@
5 exec_prefix = @exec_prefix@
6 datarootdir = @datarootdir@
7 includedir = @includedir@
8 libdir = @libdir@
9 bindir = @bindir@
10 sbindir = @sbindir@
11 mandir = @mandir@
12 localstatedir = @localstatedir@
13 VPATH = @srcdir@:@tdbdir@:@tallocdir@:@libreplacedir@:@poptdir@
14 srcdir = @srcdir@
15 etcdir = @sysconfdir@
16 builddir = @builddir@
17 DESTDIR = /
18 EXTRA_OBJ=@EXTRA_OBJ@
19 XSLTPROC = /usr/bin/xsltproc
20 INSTALLCMD = @INSTALL@
21
22 POPT_LIBS = @POPT_LIBS@
23 POPT_CFLAGS = @POPT_CFLAGS@
24 POPT_OBJ = @POPT_OBJ@
25
26 FUSE_LIBS = @FUSE_LIBS@
27
28 CFLAGS=-g -I$(srcdir)/include -Iinclude -Ilib -Ilib/util -I$(srcdir) \
29        -I@tallocdir@ -I@tdbdir@/include -I@libreplacedir@ \
30         -DVARDIR=\"$(localstatedir)\" -DETCDIR=\"$(etcdir)\" \
31         -DUSE_MMAP=1 @CFLAGS@ $(POPT_CFLAGS) -D_FILE_OFFSET_BITS=64
32
33 LIB_FLAGS=@LDFLAGS@ -Llib @LIBS@ $(POPT_LIBS) -lfuse -pthread -lrt -ldl
34
35 UTIL_OBJ = lib/util/util_time.o lib/util/util.o lib/util/strlist.o
36
37 CLIENT_OBJ = $(POPT_OBJ) $(UTIL_OBJ) @TALLOC_OBJ@ @TDB_OBJ@ @EVENTS_OBJ@ \
38         migrate/remote-cache.o \
39         migrate/remote-cached.o \
40         lib/util/debug.o \
41         @LIBREPLACEOBJ@ $(EXTRA_OBJ) 
42
43 BINS = bin/remote-cache
44
45 DIRS = lib bin
46
47 .SUFFIXES: .c .o .h
48
49 all: showflags dirs doc $(CLIENT_OBJ) $(BINS)
50
51 showflags:
52         @echo 'remote-cache will be compiled with flags:'
53         @echo '  CFLAGS = $(CFLAGS)'
54         @echo '  LIBS = $(LIBS)'
55
56 .c.o:
57         @echo Compiling $*.c
58         @mkdir -p `dirname $@`
59         @$(CC) $(CFLAGS) -c $< -o $@
60
61 dirs:
62         @mkdir -p $(DIRS)
63
64 bin/remote-cache: migrate/remote-cache.o migrate/remote-cached.o
65         @echo Linking $@
66         @$(CC) $(CFLAGS) -o $@ $(CLIENT_OBJ) $(LIB_FLAGS) $(FUSE_LIBS)
67
68 doc/remote-cache.8.html: doc/remote-cache.8.xml
69         -test -z "$(XSLTPROC)" || $(XSLTPROC) -o $@ http://docbook.sourceforge.net/release/xsl/current/html/docbook.xsl $<
70
71 doc/remote-cache.8: doc/remote-cache.8.xml
72         -test -z "$(XSLTPROC)" || $(XSLTPROC) -o $@ http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $<
73
74 doc/remote-cache-clean.8.html: doc/remote-cache-clean.8.xml
75         -test -z "$(XSLTPROC)" || $(XSLTPROC) -o $@ http://docbook.sourceforge.net/release/xsl/current/html/docbook.xsl $<
76
77 doc/remote-cache-clean.8: doc/remote-cache-clean.8.xml
78         -test -z "$(XSLTPROC)" || $(XSLTPROC) -o $@ http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $<
79
80 doc: doc/remote-cache.8 doc/remote-cache.8.html \
81         doc/remote-cache-clean.8 doc/remote-cache-clean.8.html
82
83 install: $(BINS)
84         ${INSTALLCMD} -m 755 bin/remote-cache $(DESTDIR)$(bindir)
85         ${INSTALLCMD} -m 755 migrate/remote-cache-clean.py $(DESTDIR)$(sbindir)/remote-cache-clean
86         if [ -f doc/remote-cache.8 ];then ${INSTALLCMD} -d $(DESTDIR)$(mandir)/man8; fi
87         if [ -f doc/remote-cache.8 ];then ${INSTALLCMD} -m 644 doc/remote-cache.8 $(DESTDIR)$(mandir)/man8; fi
88         if [ -f doc/remote-cache-clean.8 ];then ${INSTALLCMD} -d $(DESTDIR)$(mandir)/man8; fi
89         if [ -f doc/remote-cache-clean.8 ];then ${INSTALLCMD} -m 644 doc/remote-cache-clean.8 $(DESTDIR)$(mandir)/man8; fi
90
91 clean:
92         rm -f *.o */*.o */*/*.o */*~
93         rm -f $(BINS)
94
95 distclean: clean
96         rm -f *~ */*~
97         rm -rf bin
98         rm -f config.log config.status config.cache config.h
99         rm -f Makefile
100
101 realdistclean: distclean
102         rm -f configure config.h.in