Reported by Trent Creekmore
[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/include $(PEDANTIC) -Wall
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 -iw 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 dracutconfdir = @prefix@/lib/dracut/dracut.conf.d
66 dracutconf_DATA = 50-dahdi.conf
67
68 if      PBX_USB
69
70 SUBDIRS         += oct612x xtalk
71
72 if      LIBUSBX
73 USB_CFLAGS              = $(LIBUSBX_CFLAGS)
74 USB_LIBS                = $(LIBUSBX_LIBS)
75 USB_NAME                = libusbx
76 else
77 if      LIBUSB
78 USB_CFLAGS              = $(LIBUSB_CFLAGS)
79 USB_LIBS                = $(LIBUSB_LIBS)
80 USB_NAME                = libusb
81 endif
82 endif
83
84 noinst_LTLIBRARIES      = libastribank.la libecholoader.la libhexfile.la
85
86 libastribank_la_SOURCES = \
87                 astribank.c     \
88                 astribank.h     \
89                 mpptalk.c       \
90                 mpptalk.h       \
91                 astribank_license.c     \
92                 astribank_license.h     \
93                 #
94
95 libastribank_la_CFLAGS          = $(GLOBAL_CFLAGS)
96 libastribank_la_LIBADD          = xtalk/libxtalk.la
97
98 if USE_OCTASIC
99 libecholoader_la_SOURCES        = \
100                 parse_span_specs.c \
101                 parse_span_specs.h      \
102                 echo_loader.c   \
103                 echo_loader.h   \
104                 #
105
106 libecholoader_la_CFLAGS         = $(GLOBAL_CFLAGS) $(OCTASIC_CFLAGS)
107 endif
108
109 libhexfile_la_SOURCES   = \
110                 hexfile.c       \
111                 hexfile.h       \
112                 #
113
114 sbin_PROGRAMS   = \
115                 astribank_tool \
116                 astribank_hexload \
117                 astribank_allow \
118                 astribank_is_starting
119
120 check_PROGRAMS          = test_parse
121 test_parse_LDADD        = libhexfile.la
122
123 astribank_tool_SOURCES          = astribank_tool.c
124 astribank_tool_CFLAGS           = $(GLOBAL_CFLAGS)
125 astribank_tool_LDFLAGS          = $(USB_LIBS)
126 astribank_tool_LDADD            = libastribank.la
127
128 astribank_hexload_SOURCES       = \
129                         astribank_hexload.c     \
130                         pic_loader.c    \
131                         pic_loader.h    \
132                         #
133
134 astribank_hexload_CFLAGS        = $(GLOBAL_CFLAGS) $(OCTASIC_CFLAGS)
135 astribank_hexload_LDFLAGS       = $(USB_LIBS)
136 astribank_hexload_LDADD         = \
137                 libhexfile.la   \
138                 libastribank.la \
139                 libecholoader.la        \
140                 oct612x/liboctasic.la   \
141                 #
142
143 astribank_allow_CFLAGS          = $(GLOBAL_CFLAGS)
144 astribank_allow_LDFLAGS         = $(USB_LIBS)
145 astribank_allow_LDADD           = libastribank.la
146
147 man_pages       = \
148                 astribank_tool.8 \
149                 astribank_hexload.8 \
150                 astribank_allow.8 \
151                 astribank_is_starting.8
152
153 man_MANS        += $(man_pages)
154
155 endif
156
157 EXTRA_DIST      = \
158         $(man_pages)    \
159         $(udevrules_DATA)       \
160         README.Astribank        \
161         astribank_upgrade       \
162         dahdi.cgi       \
163         dahdi_drivers   \
164         genconf_parameters      \
165         twinstar_hook   \
166         twinstar_setup  \
167         xpp_modprobe    \
168         xpp_timing      \
169         #
170