fe58cfd789a144448e60a48462122c27992a1dbb
[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 noinst_LTLIBRARIES      = libastribank.la libecholoader.la libhexfile.la
70
71 libastribank_la_SOURCES = \
72                 astribank_usb.c \
73                 astribank_usb.h \
74                 mpptalk.c       \
75                 mpptalk.h       \
76                 mpp.h   \
77                 mpptalk_defs.h  \
78                 xtalk/debug.c   \
79                 xtalk/debug.h   \
80                 xtalk/xlist.c   \
81                 xtalk/xlist.h   \
82                 xtalk/xtalk.c   \
83                 xtalk/xtalk.h   \
84                 xtalk/xtalk_defs.h      \
85                 xtalk/xusb.c    \
86                 xtalk/xusb.h    \
87                 #
88
89 libastribank_la_CFLAGS          = $(GLOBAL_CFLAGS)
90
91 if USE_OCTASIC
92 libecholoader_la_SOURCES        = \
93                 parse_span_specs.c \
94                 parse_span_specs.h      \
95                 echo_loader.c   \
96                 echo_loader.h   \
97                 #
98
99 libecholoader_la_CFLAGS         = $(GLOBAL_CFLAGS) $(OCTASIC_CFLAGS)
100 endif
101
102 libhexfile_la_SOURCES   = \
103                 hexfile.c       \
104                 hexfile.h       \
105                 #
106
107 sbin_PROGRAMS   = \
108                 astribank_tool \
109                 astribank_hexload \
110                 astribank_allow \
111                 astribank_is_starting
112
113 check_PROGRAMS          = test_parse
114 test_parse_LDADD        = libhexfile.la
115
116 astribank_tool_SOURCES          = astribank_tool.c
117 astribank_tool_CFLAGS           = $(GLOBAL_CFLAGS)
118 astribank_tool_LDFLAGS          = $(USB_LIB)
119 astribank_tool_LDADD            = libastribank.la
120
121 astribank_hexload_SOURCES       = \
122                         astribank_hexload.c     \
123                         pic_loader.c    \
124                         pic_loader.h    \
125                         #
126
127 astribank_hexload_CFLAGS        = $(GLOBAL_CFLAGS) $(OCTASIC_CFLAGS)
128 astribank_hexload_LDFLAGS       = $(USB_LIB)
129 astribank_hexload_LDADD         = \
130                 libhexfile.la   \
131                 libastribank.la \
132                 libecholoader.la        \
133                 oct612x/liboctasic.la   \
134                 #
135
136 astribank_allow_SOURCES         = \
137                         astribank_allow.c       \
138                         astribank_license.c     \
139                         astribank_license.h     \
140                         #
141
142 astribank_allow_CFLAGS          = $(GLOBAL_CFLAGS)
143 astribank_allow_LDFLAGS         = $(USB_LIB)
144 astribank_allow_LDADD           = libastribank.la
145
146 man_pages       = \
147                 astribank_tool.8 \
148                 astribank_hexload.8 \
149                 astribank_allow.8 \
150                 astribank_is_starting.8
151
152 man_MANS        += $(man_pages)
153 endif
154
155 EXTRA_DIST      = \
156         $(man_pages)    \
157         $(udevrules_DATA)       \
158         README.Astribank        \
159         astribank_upgrade       \
160         dahdi.cgi       \
161         dahdi_drivers   \
162         genconf_parameters      \
163         twinstar_hook   \
164         twinstar_setup  \
165         xpp_modprobe    \
166         xpp_timing      \
167         #
168