Fix compilation of the library.
[samba-gtk.git] / Makefile
1 include Makefile.settings
2
3 BINS = gepdump gregedit gwcrontab gwsam gwsvcctl
4 CFLAGS = $(GTK_CFLAGS) $(TALLOC_CFLAGS) $(DCERPC_CFLAGS) $(GENSEC_CFLAGS) -I.
5 LIBS = $(GTK_LIBS) $(TALLOC_LIBS) $(DCERPC_LIBS) $(GENSEC_LIBS) 
6
7 LIB = libsamba-gtk.so.0.0.1
8 MANPAGES = man/gepdump.1 man/gwcrontab.1 man/gwsvcctl.1 man/gregedit.1
9
10 all: $(BINS) $(LIB)
11
12 install:: $(BINS) $(LIB)
13         $(INSTALL) -d $(bindir) $(libdir) $(man1dir)
14         $(INSTALL) -m 0755 $(BINS) $(bindir)
15         $(INSTALL) -m 0755 $(LIBDIR) $(libdir)
16
17 install-doc::
18         $(INSTALL) -m 0644 $(MANPAGES) $(man1dir)
19
20 configure: 
21         autoconf -f
22
23 Makefile.settings: configure
24         ./configure
25
26 $(LIB): $(patsubst %.c, %.o, $(wildcard common/*.c))
27         $(CC) -shared -o $@ $^ $(LIBS)
28         ln -s $(LIB) libsamba-gtk.so 
29
30 %.o: %.c
31         $(CC) $(CFLAGS) -o $@ -c $<
32
33 $(BINS): %: tools/%.o $(LIB)
34         $(CC) -o $@ $< -lsamba-gtk -L. $(LIBS)
35
36 install::
37
38 clean::
39         rm -f $(BINS) $(LIB) *.so */*.o
40
41 distclean:: clean
42         rm -rf autom4te.cache
43         rm -f config.log config.cache config.status
44         rm -f Makefile.settings
45
46 dist:: configure distclean
47
48 doc:: $(MANPAGES)
49
50 DOCBOOK_MANPAGE_URL = http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl
51
52 .SUFFIXES: .1 .1.xml
53
54 .1.xml.1:
55         $(XSLTPROC) -o $@ $(DOCBOOK_MANPAGE_URL) $<
56