configure.ac: add libusb/libusbx support (for xpp)
[dahdi/tools.git] / xpp / Makefile.am
1
2 all-local: $(perl_checks)
3
4 SUBDIRS         =
5
6 man_MANS        =
7
8
9 # FIXME: try to improve code, so we can use $(PEDANTIC)
10 #PEDANTIC       = -ansi -pedantic -std=c99
11 GLOBAL_CFLAGS   = -I$(srcdir) -I$(srcdir)/xtalk $(PEDANTIC)
12
13 if DAHDI_DEVMODE
14 GLOBAL_CFLAGS   += \
15         -Werror \
16         -Wunused \
17         -Wundef \
18         -Wmissing-format-attribute \
19         -Wformat-security \
20         -Wformat=2
21 endif
22
23 if PERL
24 SUBDIRS         += perl_modules
25
26 %.8: %
27         @if file "$^" | cut -d: -f2 | grep -q perl; then \
28                 if pod2man --section 8 $^ > $@; then \
29                         echo "  GEN      $@"; \
30                 else \
31                         rm -f "$@"; \
32                 fi \
33         fi
34
35 %.check: %
36         @echo "  CHECK    $^"; \
37         if ! perl -I./perl_modules -c $^ 2>/dev/null; then \
38                 perl -I./perl_modules -c $^; \
39         fi
40         @touch $@
41
42 perl_scripts    =       \
43                 dahdi_registration      \
44                 xpp_sync        \
45                 lsdahdi         \
46                 xpp_blink       \
47                 dahdi_genconf   \
48                 dahdi_hardware  \
49                 twinstar        \
50                 #
51
52 perl_checks     = $(perl_scripts:%=%.check)
53 perl_mans       = $(perl_scripts:%=%.8)
54
55 endif
56
57 dist_dahditools_SCRIPTS = xpp_fxloader astribank_hook waitfor_xpds
58 udevrulesdir    = @udevrulesdir@
59 udevrules_DATA  = xpp.rules
60
61 dist_sbin_SCRIPTS       = $(perl_scripts)
62 man_MANS                += $(perl_mans)
63 CLEANFILES              = $(perl_checks) $(perl_mans)
64
65 if      PBX_USB
66
67 SUBDIRS         += oct612x
68
69 if      LIBUSBX
70 USB_CFLAGS              = $(LIBUSBX_CFLAGS)
71 USB_LIBS                = $(LIBUSBX_LIBS)
72 USB_NAME                = libusbx
73 else
74 if      LIBUSB
75 USB_CFLAGS              = $(LIBUSB_CFLAGS)
76 USB_LIBS                = $(LIBUSB_LIBS)
77 USB_NAME                = libusb
78 endif
79 endif
80
81 noinst_LTLIBRARIES      = libastribank.la libecholoader.la libhexfile.la
82
83 libastribank_la_SOURCES = \
84                 astribank_usb.c \
85                 astribank_usb.h \
86                 mpptalk.c       \
87                 mpptalk.h       \
88                 mpp.h   \
89                 mpptalk_defs.h  \
90                 xtalk/debug.c   \
91                 xtalk/debug.h   \
92                 xtalk/xlist.c   \
93                 xtalk/xlist.h   \
94                 xtalk/xtalk.c   \
95                 xtalk/xtalk.h   \
96                 xtalk/xtalk_defs.h      \
97                 xtalk/xusb.c    \
98                 xtalk/xusb.h    \
99                 #
100
101 libastribank_la_CFLAGS          = $(GLOBAL_CFLAGS)
102
103 if USE_OCTASIC
104 libecholoader_la_SOURCES        = \
105                 parse_span_specs.c \
106                 parse_span_specs.h      \
107                 echo_loader.c   \
108                 echo_loader.h   \
109                 #
110
111 libecholoader_la_CFLAGS         = $(GLOBAL_CFLAGS) $(OCTASIC_CFLAGS)
112 endif
113
114 libhexfile_la_SOURCES   = \
115                 hexfile.c       \
116                 hexfile.h       \
117                 #
118
119 sbin_PROGRAMS   = \
120                 astribank_tool \
121                 astribank_hexload \
122                 astribank_allow \
123                 astribank_is_starting
124
125 check_PROGRAMS          = test_parse
126 test_parse_LDADD        = libhexfile.la
127
128 astribank_tool_SOURCES          = astribank_tool.c
129 astribank_tool_CFLAGS           = $(GLOBAL_CFLAGS)
130 astribank_tool_LDFLAGS          = $(USB_LIBS)
131 astribank_tool_LDADD            = libastribank.la
132
133 astribank_hexload_SOURCES       = \
134                         astribank_hexload.c     \
135                         pic_loader.c    \
136                         pic_loader.h    \
137                         #
138
139 astribank_hexload_CFLAGS        = $(GLOBAL_CFLAGS) $(OCTASIC_CFLAGS)
140 astribank_hexload_LDFLAGS       = $(USB_LIBS)
141 astribank_hexload_LDADD         = \
142                 libhexfile.la   \
143                 libastribank.la \
144                 libecholoader.la        \
145                 oct612x/liboctasic.la   \
146                 #
147
148 astribank_allow_SOURCES         = \
149                         astribank_allow.c       \
150                         astribank_license.c     \
151                         astribank_license.h     \
152                         #
153
154 astribank_allow_CFLAGS          = $(GLOBAL_CFLAGS)
155 astribank_allow_LDFLAGS         = $(USB_LIBS)
156 astribank_allow_LDADD           = libastribank.la
157
158 man_pages       = \
159                 astribank_tool.8 \
160                 astribank_hexload.8 \
161                 astribank_allow.8 \
162                 astribank_is_starting.8
163
164 man_MANS        += $(man_pages)
165 endif
166
167 EXTRA_DIST      = \
168         $(man_pages)    \
169         $(udevrules_DATA)       \
170         README.Astribank        \
171         astribank_upgrade       \
172         dahdi.cgi       \
173         dahdi_drivers   \
174         genconf_parameters      \
175         twinstar_hook   \
176         twinstar_setup  \
177         xpp_modprobe    \
178         xpp_timing      \
179         #
180