smbinfo: add a utility to display smb specific information about objects
[cifs-utils.git] / Makefile.am
1 AM_CFLAGS = -Wall -Wextra -D_FORTIFY_SOURCE=2 $(PIE_CFLAGS) $(RELRO_CFLAGS)
2 ACLOCAL_AMFLAGS = -I aclocal
3
4 root_sbindir = $(ROOTSBINDIR)
5 root_sbin_PROGRAMS = mount.cifs
6 mount_cifs_SOURCES = mount.cifs.c mtab.c resolve_host.c util.c
7 mount_cifs_LDADD = $(LIBCAP) $(CAPNG_LDADD) $(RT_LDADD)
8 include_HEADERS = cifsidmap.h
9 rst_man_pages = mount.cifs.8
10
11 #
12 # Generate man pages troff source from POD format
13 #
14
15 man_MANS=
16
17 SUFFIXES = .rst .1 .8
18
19 RST2MAN = $(have_rst2man) --syntax-highlight=none $< $@
20
21 .rst.1:
22         $(RST2MAN)
23 .rst.8:
24         $(RST2MAN)
25
26 CLEANFILES =
27 bin_PROGRAMS =
28 sbin_PROGRAMS =
29
30 if CONFIG_CIFSUPCALL
31 sbin_PROGRAMS += cifs.upcall
32 cifs_upcall_SOURCES = cifs.upcall.c data_blob.c asn1.c spnego.c
33 cifs_upcall_LDADD = -ltalloc -lkeyutils $(KRB5_LDADD) $(CAPNG_LDADD)
34 rst_man_pages += cifs.upcall.8
35 #
36 # Fix the pathnames in manpages. To prevent @label@ being replaced by m4, we
37 # need to obfuscate the LHS of the regex (hence the trivial one character set).
38 #
39 cifs.upcall.rst: cifs.upcall.rst.in
40         $(SED) 's,[@]sbindir@,$(sbindir),' $(srcdir)/$@.in > $@-t && mv $@-t $@
41 endif
42
43 if CONFIG_CIFSCREDS
44 bin_PROGRAMS += cifscreds
45 cifscreds_SOURCES = cifscreds.c cifskey.c resolve_host.c util.c
46 cifscreds_LDADD = -lkeyutils
47
48 rst_man_pages += cifscreds.1
49
50 endif
51
52 if CONFIG_CIFSIDMAP
53 sbin_PROGRAMS += cifs.idmap
54 cifs_idmap_SOURCES = cifs.idmap.c idmap_plugin.c
55 cifs_idmap_LDADD = -lkeyutils -ldl
56 rst_man_pages += cifs.idmap.8
57 CLEANFILES += cifs.idmap.rst
58 cifs.idmap.rst: cifs.idmap.rst.in
59         $(SED) -e 's,[@]sbindir@,$(sbindir),' -e 's,[@]pluginpath@,$(pluginpath),' $(srcdir)/$@.in > $@-t && mv $@-t $@
60 endif
61
62 if CONFIG_CIFSACL
63 bin_PROGRAMS += getcifsacl
64 getcifsacl_SOURCES = getcifsacl.c idmap_plugin.c
65 getcifsacl_LDADD = -ldl
66
67 rst_man_pages += getcifsacl.1
68 CLEANFILES += getcifsacl.rst
69 getcifsacl.rst: getcifsacl.rst.in
70         $(SED) 's,[@]pluginpath@,$(pluginpath),' $(srcdir)/$@.in > $@-t && mv $@-t $@
71
72 bin_PROGRAMS += setcifsacl
73 setcifsacl_SOURCES = setcifsacl.c idmap_plugin.c
74 setcifsacl_LDADD = -ldl
75
76 rst_man_pages += setcifsacl.1
77 CLEANFILES += setcifsacl.rst
78 setcifsacl.rst: setcifsacl.rst.in
79         $(SED) 's,[@]pluginpath@,$(pluginpath),' $(srcdir)/$@.in > $@-t && mv $@-t $@
80 endif
81
82 if CONFIG_SMBINFO
83 bin_PROGRAMS += smbinfo
84 smbinfo_SOURCES = smbinfo.c
85 rst_man_pages += smbinfo.1
86 endif
87
88 if CONFIG_PLUGIN
89 plugindir = $(pkglibdir)
90 plugin_PROGRAMS = idmapwb.so
91 idmapwb.so: idmapwb.c
92         $(CC) $(DEFS) $(CFLAGS) $(AM_CFLAGS) $(WBCLIENT_CFLAGS) $(LDFLAGS) -shared -fpic -o $@ $+ $(WBCLIENT_LIBS)
93
94 rst_man_pages += idmapwb.8
95 CLEANFILES += idmapwb.rst
96 idmapwb.rst: idmapwb.rst.in
97         $(SED) 's,[@]pluginpath@,$(pluginpath),' $(srcdir)/$@.in > $@-t && mv $@-t $@
98 endif
99
100 if CONFIG_PAM
101 pam_PROGRAMS = pam_cifscreds.so
102 rst_man_pages += pam_cifscreds.8
103 pam_cifscreds.so: pam_cifscreds.c cifskey.c resolve_host.c util.c
104         $(CC) $(DEFS) $(CFLAGS) $(AM_CFLAGS) $(LDFLAGS) -shared -fpic -o $@ $+ -lpam -lkeyutils
105
106 endif
107
108 if CONFIG_MAN
109 man_MANS += $(rst_man_pages)
110 CLEANFILES += $(rst_man_pages)
111 endif
112
113 SUBDIRS = contrib