xpp: migrate everything to libxtalk
[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
78 if PBX_PCAP
79 noinst_PROGRAMS         += dahdi_pcap
80 dahdi_pcap_LDADD        = -lpcap
81 endif
82
83 patlooptest_LDADD       = libtonezone.la -lm
84 fxstest_LDADD           = libtonezone.la -lm
85 fxotune_LDADD           = -lm
86 dahdi_speed_CFLAGS      = -O2
87
88 dahdi_maint_SOURCES     = dahdi_maint.c version.c
89
90 if PBX_NEWT
91 sbin_PROGRAMS           += dahdi_tool
92 dahdi_tool_CFLAGS       = $(CFLAGS) $(NEWT_INCLUDE)
93 dahdi_tool_LDADD        = $(NEWT_LIB)
94 endif
95
96 dahdi_cfg_LDFLAGS       = -lm -lpthread
97 dahdi_cfg_LDADD         = libtonezone.la
98
99 udevrulesdir    = @udevrulesdir@
100 udevrules_DATA  = dahdi.rules
101
102 all-local:
103         $(LEGACY_MAKE)  all
104
105 clean-local:
106         $(LEGACY_MAKE) clean
107
108 install-exec-hook:
109         $(LEGACY_MAKE) install
110         @echo "Compatibility symlinks (should be removed in the future)"
111         ln -sf libtonezone.so.2.0.0 $(DESTDIR)$(libdir)/libtonezone.so.2.0
112
113 bashcompdir     = $(sysconfdir)/bash_completion.d
114
115 install-data-hook:
116         mkdir -p $(DESTDIR)$(bashcompdir)
117         install -m 644 $(srcdir)/dahdi-bash-completion $(DESTDIR)$(bashcompdir)/dahdi
118
119 # Handle these files specially -- install them only with 'install-config'
120 special_config_files    = \
121         init.conf.sample        \
122         blacklist.sample        \
123         modprobe.conf.sample    \
124         #
125
126 install-config:
127         mkdir -p $(DESTDIR)$(dahdiconfdir)
128         mkdir -p $(DESTDIR)$(sysconfdir)/modprobe.d
129         install -m644 xpp/genconf_parameters $(DESTDIR)$(dahdiconfdir)/genconf_parameters
130         install -m644 init.conf.sample $(DESTDIR)$(dahdiconfdir)/init.conf
131         install -m644 blacklist.sample $(DESTDIR)$(sysconfdir)/modprobe.d/dahdi-blacklist.conf
132         install -m644 modprobe.conf.sample $(DESTDIR)$(sysconfdir)/modprobe.d/dahdi.conf
133         $(LEGACY_MAKE) config
134
135 dahdiconfdir    = @sysconfdir@/dahdi
136 dahdiconf_DATA  = \
137         system.conf.sample      \
138         assigned-spans.conf.sample      \
139         span-types.conf.sample  \
140         modules.sample  \
141         #
142
143 build_scripts   = \
144         build_tools/dahdi_svn_tarball   \
145         build_tools/dahdi_sysfs_copy    \
146         build_tools/dump_sys_state      \
147         build_tools/make_firmware_object.in     \
148         build_tools/make_tree   \
149         build_tools/make_version        \
150         build_tools/test_kernel_git     \
151         build_tools/uninstall-modules   \
152         #
153
154 .version:
155         if ./build_tools/make_version . dahdi/tools > $@.tmp; then \
156                 mv "$@.tmp" "$@"; \
157         fi
158
159 uninstall-hook:
160         $(RM) $(DESTDIR)$(sysconfdir)/dahdi/span-types.conf.sample
161         $(RM) $(DESTDIR)$(sysconfdir)/dahdi/assigned-spans.conf.sample
162         $(RM) $(DESTDIR)$(sysconfdir)/dahdi/system.conf
163         $(RM) $(DESTDIR)$(bashcompdir)/dahdi
164
165 docs:
166         $(LEGACY_MAKE)  $@
167
168 DISTCLEANFILES  = makeopts config.log config.status .*.d
169
170 MAINTAINERCLEANFILES    = \
171                 m4/libtool.m4 \
172                 m4/ltoptions.m4 \
173                 m4/ltsugar.m4 \
174                 m4/ltversion.m4 \
175                 m4/lt~obsolete.m4 \
176                 #
177
178 EXTRA_DIST      = \
179         .version        \
180         LICENSE \
181         LICENSE.LGPL    \
182         UPGRADE.txt     \
183         bootstrap.sh    \
184         Makefile.legacy \
185         dahdi.init      \
186         dahdi.xml       \
187         dahdi_pcap.c    \
188         ifup-hdlc       \
189         dahdi-bash-completion   \
190         $(special_config_files) \
191         $(dahdiconf_DATA)       \
192         $(udevrules_DATA)       \
193         $(build_scripts)        \
194         #
195
196 .PHONY: docs config