mount.cifs: on 2nd try mount.cifs must also uppercase "orig_dev"
[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
9 man_MANS = mount.cifs.8
10 include_HEADERS = cifsidmap.h
11
12 bin_PROGRAMS =
13 sbin_PROGRAMS =
14 clean-local: clean-local-upcall clean-local-idmap clean-local-cifsacl
15
16 if CONFIG_CIFSUPCALL
17 sbin_PROGRAMS += cifs.upcall
18 cifs_upcall_SOURCES = cifs.upcall.c data_blob.c asn1.c spnego.c
19 cifs_upcall_LDADD = -ltalloc -lkeyutils $(KRB5_LDADD)
20 man_MANS += cifs.upcall.8
21
22 #
23 # Fix the pathnames in manpages. To prevent @label@ being replaced by m4, we
24 # need to obfuscate the LHS of the regex (hence the trivial one character set).
25 #
26 cifs.upcall.8: cifs.upcall.8.in
27         $(SED) 's,[@]sbindir@,$(sbindir),' $(srcdir)/$@.in > $@-t && mv $@-t $@
28 endif
29
30 clean-local-upcall:
31 if CONFIG_CIFSUPCALL
32         rm -f cifs.upcall.8 cifs.upcall.8-t
33 endif
34
35 if CONFIG_CIFSCREDS
36 bin_PROGRAMS += cifscreds
37 cifscreds_SOURCES = cifscreds.c cifskey.c resolve_host.c util.c
38 cifscreds_LDADD = -lkeyutils
39 man_MANS += cifscreds.1
40 endif
41
42 if CONFIG_CIFSIDMAP
43 sbin_PROGRAMS += cifs.idmap
44 cifs_idmap_SOURCES = cifs.idmap.c idmap_plugin.c
45 cifs_idmap_LDADD = -lkeyutils -ldl
46 man_MANS += cifs.idmap.8
47
48 cifs.idmap.8: cifs.idmap.8.in
49         $(SED) -e 's,[@]sbindir@,$(sbindir),' -e 's,[@]pluginpath@,$(pluginpath),' $(srcdir)/$@.in > $@-t && mv $@-t $@
50 endif
51
52 clean-local-idmap:
53 if CONFIG_CIFSIDMAP
54         rm -f cifs.idmap.8 cifs.idmap.8-t
55 endif
56
57 if CONFIG_CIFSACL
58 bin_PROGRAMS += getcifsacl
59 getcifsacl_SOURCES = getcifsacl.c idmap_plugin.c
60 getcifsacl_LDADD = -ldl
61 man_MANS += getcifsacl.1
62
63 getcifsacl.1: getcifsacl.1.in
64         $(SED) 's,[@]pluginpath@,$(pluginpath),' $(srcdir)/$@.in > $@-t && mv $@-t $@
65
66 bin_PROGRAMS += setcifsacl
67 setcifsacl_SOURCES = setcifsacl.c idmap_plugin.c
68 setcifsacl_LDADD = -ldl
69 man_MANS += setcifsacl.1
70
71 setcifsacl.1: setcifsacl.1.in
72         $(SED) 's,[@]pluginpath@,$(pluginpath),' $(srcdir)/$@.in > $@-t && mv $@-t $@
73 endif
74
75 clean-local-cifsacl:
76 if CONFIG_CIFSACL
77         rm -f getcifsacl.1 getcifsacl.1-t
78         rm -f setcifsacl.1 setcifsacl.1-t
79 endif
80
81 if CONFIG_PLUGIN
82 plugindir = $(pkglibdir)
83 plugin_PROGRAMS = idmapwb.so
84 man_MANS += idmapwb.8
85
86 idmapwb.so: idmapwb.c
87         $(CC) $(CFLAGS) $(AM_CFLAGS) $(WBCLIENT_CFLAGS) $(LDFLAGS) -shared -fpic -o $@ $+ $(WBCLIENT_LIBS)
88
89 idmapwb.8: idmapwb.8.in
90         $(SED) 's,[@]pluginpath@,$(pluginpath),' $(srcdir)/$@.in > $@-t && mv $@-t $@
91
92 endif
93
94 if CONFIG_PAM
95 pam_PROGRAMS = pam_cifscreds.so
96
97 pam_cifscreds.so: pam_cifscreds.c cifskey.c resolve_host.c util.c
98         $(CC) $(CFLAGS) $(AM_CFLAGS) $(LDFLAGS) -shared -fpic -o $@ $+ -lpam -lkeyutils
99 man_MANS += pam_cifscreds.8
100 endif
101
102 SUBDIRS = contrib