Makefile.am 2.99 KB
Newer Older
1

2
all-local: $(perl_checks)
3 4 5

SUBDIRS		=

6 7
man_MANS	=

8

9 10
# FIXME: try to improve code, so we can use $(PEDANTIC)
#PEDANTIC	= -ansi -pedantic -std=c99
11
GLOBAL_CFLAGS	= -I$(srcdir) -I$(srcdir)/xtalk/include $(PEDANTIC) -Wall
12

13 14 15 16 17 18 19 20 21 22
if DAHDI_DEVMODE
GLOBAL_CFLAGS	+= \
	-Werror \
	-Wunused \
	-Wundef \
	-Wmissing-format-attribute \
	-Wformat-security \
	-Wformat=2
endif

23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
if PERL
SUBDIRS		+= perl_modules

%.8: %
	@if file "$^" | cut -d: -f2 | grep -q perl; then \
		if pod2man --section 8 $^ > $@; then \
			echo "  GEN      $@"; \
		else \
			rm -f "$@"; \
		fi \
	fi

%.check: %
	@echo "  CHECK    $^"; \
	if ! perl -I./perl_modules -c $^ 2>/dev/null; then \
		perl -I./perl_modules -c $^; \
	fi
	@touch $@

perl_scripts	=	\
		dahdi_registration	\
		xpp_sync	\
		lsdahdi		\
		xpp_blink	\
		dahdi_genconf	\
		dahdi_hardware	\
		twinstar	\
		#

perl_checks	= $(perl_scripts:%=%.check)
perl_mans	= $(perl_scripts:%=%.8)

endif

57
dist_dahditools_SCRIPTS	= xpp_fxloader astribank_hook waitfor_xpds
58 59 60
udevrulesdir	= @udevrulesdir@
udevrules_DATA	= xpp.rules

61
dist_sbin_SCRIPTS	= $(perl_scripts)
62
man_MANS		+= $(perl_mans)
63 64
CLEANFILES		= $(perl_checks) $(perl_mans)

65 66
if	PBX_USB

67
SUBDIRS		+= oct612x xtalk
68

69 70 71 72 73 74 75 76 77 78 79 80
if	LIBUSBX
USB_CFLAGS		= $(LIBUSBX_CFLAGS)
USB_LIBS		= $(LIBUSBX_LIBS)
USB_NAME		= libusbx
else
if	LIBUSB
USB_CFLAGS		= $(LIBUSB_CFLAGS)
USB_LIBS		= $(LIBUSB_LIBS)
USB_NAME		= libusb
endif
endif

81 82
noinst_LTLIBRARIES	= libastribank.la libecholoader.la libhexfile.la

83
libastribank_la_SOURCES	= \
84 85
		astribank.c	\
		astribank.h	\
86 87
		mpptalk.c	\
		mpptalk.h	\
88 89
		astribank_license.c	\
		astribank_license.h	\
90 91
		#

92
libastribank_la_CFLAGS		= $(GLOBAL_CFLAGS)
93
libastribank_la_LIBADD		= xtalk/libxtalk.la
94 95 96 97

if USE_OCTASIC
libecholoader_la_SOURCES	= \
		parse_span_specs.c \
98 99 100 101 102
		parse_span_specs.h	\
		echo_loader.c	\
		echo_loader.h	\
		#

103 104 105
libecholoader_la_CFLAGS		= $(GLOBAL_CFLAGS) $(OCTASIC_CFLAGS)
endif

106 107 108 109 110
libhexfile_la_SOURCES	= \
		hexfile.c	\
		hexfile.h	\
		#

111 112 113 114 115 116
sbin_PROGRAMS	= \
		astribank_tool \
		astribank_hexload \
		astribank_allow \
		astribank_is_starting

117 118
check_PROGRAMS		= test_parse
test_parse_LDADD	= libhexfile.la
119 120 121

astribank_tool_SOURCES		= astribank_tool.c
astribank_tool_CFLAGS		= $(GLOBAL_CFLAGS)
122
astribank_tool_LDFLAGS		= $(USB_LIBS)
123 124
astribank_tool_LDADD		= libastribank.la

125 126 127 128 129 130
astribank_hexload_SOURCES	= \
			astribank_hexload.c	\
			pic_loader.c	\
			pic_loader.h	\
			#

131
astribank_hexload_CFLAGS	= $(GLOBAL_CFLAGS) $(OCTASIC_CFLAGS)
132
astribank_hexload_LDFLAGS	= $(USB_LIBS)
133 134 135 136 137 138 139
astribank_hexload_LDADD		= \
		libhexfile.la	\
		libastribank.la	\
		libecholoader.la	\
		oct612x/liboctasic.la	\
		#

140
astribank_allow_CFLAGS		= $(GLOBAL_CFLAGS)
141
astribank_allow_LDFLAGS		= $(USB_LIBS)
142 143
astribank_allow_LDADD		= libastribank.la

144 145 146 147 148 149 150 151
man_pages	= \
		astribank_tool.8 \
		astribank_hexload.8 \
		astribank_allow.8 \
		astribank_is_starting.8

man_MANS	+= $(man_pages)

152
endif
153 154 155 156 157 158 159 160 161 162 163 164 165 166 167

EXTRA_DIST	= \
	$(man_pages)	\
	$(udevrules_DATA)	\
	README.Astribank	\
	astribank_upgrade	\
	dahdi.cgi	\
	dahdi_drivers	\
	genconf_parameters	\
	twinstar_hook	\
	twinstar_setup	\
	xpp_modprobe	\
	xpp_timing	\
	#