xpp: README: hwid attribute of the xpd sysfs node
[dahdi/tools.git] / Makefile.am
1 ACLOCAL_AMFLAGS = -I m4
2
3 LEGACY_MAKE     = \
4          $(MAKE) -f $(srcdir)/Makefile.legacy \
5                 top_srcdir=$(top_srcdir) \
6                 srcdir=$(srcdir)
7
8 CFLAGS  += -g -Wall -O2 $(DAHDI_INCLUDE)
9 if DAHDI_DEVMODE
10 CFLAGS  += \
11         -Werror \
12         -Wunused \
13         -Wundef \
14         $(DAHDI_DECLARATION_AFTER_STATEMENT) \
15         -Wmissing-format-attribute \
16         -Wformat-security \
17         #-Wformat=2
18 endif
19
20 SUBDIRS = xpp doc hotplug
21
22 if PPPD
23 SUBDIRS += ppp
24 endif
25
26 noinst_HEADERS  = \
27         bittest.h       \
28         dahdi_tools_version.h   \
29         fxotune.h       \
30         wavformat.h     \
31         #
32
33 sbin_PROGRAMS   = \
34         dahdi_test \
35         dahdi_maint \
36         dahdi_monitor \
37         dahdi_cfg \
38         dahdi_speed \
39         dahdi_scan \
40         fxotune
41
42 noinst_PROGRAMS = \
43         fxstest \
44         patgen \
45         pattest \
46         patlooptest \
47         dahdi_diag \
48         timertest
49
50 dist_sbin_SCRIPTS       = \
51         dahdi_span_assignments \
52         dahdi_waitfor_span_assignments \
53         dahdi_span_types
54
55 if PBX_HDLC
56 sbin_PROGRAMS   += sethdlc
57 noinst_PROGRAMS += hdlcstress hdlctest hdlcgen hdlcverify
58 endif
59
60 # Libtool versioning for libtonezone:
61 # Bump when interface changes
62 LTZ_CURRENT     = 2
63 # Bump if interface change is backward compatible
64 LTZ_AGE         = 0
65 # Bump if only implementation change
66 LTZ_REVISION    = 0
67
68 lib_LTLIBRARIES         = libtonezone.la
69
70 libtonezone_la_SOURCES  = \
71         zonedata.c \
72         tonezone.c \
73         version.c
74 dahdiinclude_HEADERS    = tonezone.h
75 libtonezone_la_CFLAGS   = $(CFLAGS) -I$(srcdir) -DBUILDING_TONEZONE
76 libtonezone_la_LDFLAGS  = -version-info "$(LTZ_CURRENT):$(LTZ_REVISION):$(LTZ_AGE)"
77 libtonezone_la_LIBADD   = -lm
78
79 if PBX_PCAP
80 noinst_PROGRAMS         += dahdi_pcap
81 dahdi_pcap_LDADD        = -lpcap
82 endif
83
84 patlooptest_LDADD       = libtonezone.la
85 fxstest_LDADD           = libtonezone.la
86 fxotune_LDADD           = -lm
87 dahdi_speed_CFLAGS      = -O2
88
89 dahdi_maint_SOURCES     = dahdi_maint.c version.c
90
91 if PBX_NEWT
92 sbin_PROGRAMS           += dahdi_tool
93 dahdi_tool_CFLAGS       = $(CFLAGS) $(NEWT_INCLUDE)
94 dahdi_tool_LDADD        = $(NEWT_LIB)
95 endif
96
97 dahdi_cfg_LDFLAGS       = -lpthread
98 dahdi_cfg_LDADD         = libtonezone.la
99
100 udevrulesdir    = @udevrulesdir@
101 udevrules_DATA  = dahdi.rules
102
103 all-local:
104         $(LEGACY_MAKE)  all
105
106 clean-local:
107         $(LEGACY_MAKE) clean
108
109 install-exec-hook:
110         $(LEGACY_MAKE) install
111         @echo "Compatibility symlinks (should be removed in the future)"
112         ln -sf libtonezone.so.2.0.0 $(DESTDIR)$(libdir)/libtonezone.so.2.0
113
114 bashcompdir     = $(sysconfdir)/bash_completion.d
115
116 install-data-hook:
117         mkdir -p $(DESTDIR)$(bashcompdir)
118         install -m 644 $(srcdir)/dahdi-bash-completion $(DESTDIR)$(bashcompdir)/dahdi
119
120 # Handle these files specially -- install them only with 'install-config'
121 special_config_files    = \
122         init.conf.sample        \
123         blacklist.sample        \
124         modprobe.conf.sample    \
125         #
126
127 install-config:
128         mkdir -p $(DESTDIR)$(dahdiconfdir)
129         mkdir -p $(DESTDIR)$(sysconfdir)/modprobe.d
130         install -m644 xpp/genconf_parameters $(DESTDIR)$(dahdiconfdir)/genconf_parameters
131         install -m644 init.conf.sample $(DESTDIR)$(dahdiconfdir)/init.conf
132         install -m644 blacklist.sample $(DESTDIR)$(sysconfdir)/modprobe.d/dahdi-blacklist.conf
133         install -m644 modprobe.conf.sample $(DESTDIR)$(sysconfdir)/modprobe.d/dahdi.conf
134         $(LEGACY_MAKE) config
135
136 dahdiconfdir    = @sysconfdir@/dahdi
137 dahdiconf_DATA  = \
138         system.conf.sample      \
139         assigned-spans.conf.sample      \
140         span-types.conf.sample  \
141         modules.sample  \
142         #
143
144 build_scripts   = \
145         build_tools/dahdi_svn_tarball   \
146         build_tools/dahdi_sysfs_copy    \
147         build_tools/dump_sys_state      \
148         build_tools/make_firmware_object.in     \
149         build_tools/make_tree   \
150         build_tools/make_version        \
151         build_tools/test_kernel_git     \
152         build_tools/uninstall-modules   \
153         #
154
155 .version:
156         if ./build_tools/make_version . dahdi/tools > $@.tmp; then \
157                 mv "$@.tmp" "$@"; \
158         fi
159
160 uninstall-hook:
161         $(RM) $(DESTDIR)$(sysconfdir)/dahdi/span-types.conf.sample
162         $(RM) $(DESTDIR)$(sysconfdir)/dahdi/assigned-spans.conf.sample
163         $(RM) $(DESTDIR)$(sysconfdir)/dahdi/system.conf
164         $(RM) $(DESTDIR)$(bashcompdir)/dahdi
165
166 docs:
167         $(LEGACY_MAKE)  $@
168
169 DISTCLEANFILES  = makeopts config.log config.status .*.d
170
171 MAINTAINERCLEANFILES    = \
172                 m4/libtool.m4 \
173                 m4/ltoptions.m4 \
174                 m4/ltsugar.m4 \
175                 m4/ltversion.m4 \
176                 m4/lt~obsolete.m4 \
177                 #
178
179 EXTRA_DIST      = \
180         .version        \
181         LICENSE \
182         LICENSE.LGPL    \
183         UPGRADE.txt     \
184         bootstrap.sh    \
185         Makefile.legacy \
186         dahdi.init      \
187         dahdi.xml       \
188         dahdi_pcap.c    \
189         ifup-hdlc       \
190         dahdi-bash-completion   \
191         $(special_config_files) \
192         $(dahdiconf_DATA)       \
193         $(udevrules_DATA)       \
194         $(build_scripts)        \
195         #
196
197 .PHONY: docs config