2005-06-20 17:26:08 +00:00
|
|
|
#
|
|
|
|
# Asterisk -- A telephony toolkit for Linux.
|
|
|
|
#
|
|
|
|
# Various utilities
|
|
|
|
#
|
2006-04-24 17:11:45 +00:00
|
|
|
# Copyright (C) 1999-2006, Digium
|
2005-06-20 17:26:08 +00:00
|
|
|
#
|
|
|
|
# Mark Spencer <markster@digium.com>
|
|
|
|
#
|
|
|
|
# This program is free software, distributed under the terms of
|
|
|
|
# the GNU General Public License
|
|
|
|
#
|
|
|
|
|
2007-03-22 14:40:53 +00:00
|
|
|
-include ../menuselect.makeopts
|
|
|
|
|
2006-12-16 21:14:34 +00:00
|
|
|
.PHONY: clean all uninstall
|
2006-06-22 11:27:03 +00:00
|
|
|
|
2009-03-03 18:11:34 +00:00
|
|
|
# to get check_expr, add it to the ALL_UTILS list -- this is a somewhat old checking
|
|
|
|
# program that wants an ael file for input, and will check each $[] expr for
|
|
|
|
# possible (old) problems, like spacing around operators, which dates back to
|
|
|
|
# the 1.2 days. The neat part is that it will actually evaluate the expressions.
|
|
|
|
# Users could use this to quickly check expressions in their .ael file.
|
|
|
|
# to get check_expr2, add it to the ALL_UTILS list -- this is a program that will
|
|
|
|
# read in a file containing expressions (as if they were in $[ ]), one per line.
|
|
|
|
# It will, of course signal any syntax errors. Devs (like murf) should use this whenever
|
|
|
|
# changes are made to ast_expr2.y or ast_expr2.fl (or the corresponding .c files),
|
|
|
|
# as a regression test. Others (mere mortals?) need not bother, but they are
|
|
|
|
# more than welcome to play! The regression test itself is in expr2.testinput.
|
2009-09-10 19:07:24 +00:00
|
|
|
ALL_UTILS:=astman smsq stereorize streamplayer aelparse
|
2006-09-29 22:47:40 +00:00
|
|
|
UTILS:=$(ALL_UTILS)
|
|
|
|
|
|
|
|
include $(ASTTOPDIR)/Makefile.rules
|
2004-06-04 15:44:14 +00:00
|
|
|
|
2006-09-19 14:16:12 +00:00
|
|
|
ifeq ($(OSARCH),SunOS)
|
2006-09-15 17:16:00 +00:00
|
|
|
LIBS+=-lsocket -lnsl
|
2006-09-18 22:35:40 +00:00
|
|
|
UTILS:=$(filter-out muted,$(UTILS))
|
2005-08-30 02:54:02 +00:00
|
|
|
endif
|
|
|
|
|
2006-10-28 16:37:44 +00:00
|
|
|
ifeq ($(OSARCH),OpenBSD)
|
|
|
|
UTILS:=$(filter-out muted,$(UTILS))
|
|
|
|
endif
|
|
|
|
|
2006-04-24 17:11:45 +00:00
|
|
|
ifeq ($(POPT_LIB),)
|
|
|
|
UTILS:=$(filter-out smsq,$(UTILS))
|
2005-08-30 02:54:02 +00:00
|
|
|
endif
|
|
|
|
|
2006-04-24 17:11:45 +00:00
|
|
|
ifeq ($(NEWT_LIB),)
|
|
|
|
UTILS:=$(filter-out astman,$(UTILS))
|
2005-03-17 23:12:15 +00:00
|
|
|
endif
|
2004-12-11 22:36:27 +00:00
|
|
|
|
2006-06-05 20:46:27 +00:00
|
|
|
ifneq ($(filter pbx_ael,$(MENUSELECT_PBX)),)
|
2006-05-08 16:47:49 +00:00
|
|
|
UTILS:=$(filter-out aelparse,$(UTILS))
|
|
|
|
endif
|
|
|
|
|
2006-06-22 14:09:18 +00:00
|
|
|
all: $(UTILS)
|
2002-07-27 14:29:35 +00:00
|
|
|
|
|
|
|
install:
|
2006-04-24 17:11:45 +00:00
|
|
|
for x in $(UTILS); do \
|
2004-12-15 20:29:31 +00:00
|
|
|
if [ "$$x" != "none" ]; then \
|
2005-05-09 14:20:11 +00:00
|
|
|
$(INSTALL) -m 755 $$x $(DESTDIR)$(ASTSBINDIR)/$$x; \
|
2004-12-15 20:29:31 +00:00
|
|
|
fi; \
|
|
|
|
done
|
2002-07-27 14:29:35 +00:00
|
|
|
|
2006-02-01 18:39:41 +00:00
|
|
|
uninstall:
|
2006-09-29 22:47:40 +00:00
|
|
|
for x in $(ALL_UTILS); do rm -f $$x $(DESTDIR)$(ASTSBINDIR)/$$x; done
|
2006-02-01 18:39:41 +00:00
|
|
|
|
2006-12-16 21:14:34 +00:00
|
|
|
clean:
|
2007-10-29 22:12:16 +00:00
|
|
|
rm -f *.o $(ALL_UTILS) check_expr *.s *.i
|
2008-11-26 18:36:24 +00:00
|
|
|
rm -f .*.d
|
2006-09-29 22:47:40 +00:00
|
|
|
rm -f md5.c strcompat.c ast_expr2.c ast_expr2f.c pbx_ael.c
|
|
|
|
rm -f aelparse.c aelbison.c
|
|
|
|
|
|
|
|
md5.c: ../main/md5.c
|
|
|
|
@cp $< $@
|
2006-04-24 17:11:45 +00:00
|
|
|
|
2006-09-29 22:47:40 +00:00
|
|
|
astman: astman.o md5.o
|
2006-10-05 01:42:06 +00:00
|
|
|
astman: LIBS+=$(NEWT_LIB)
|
2009-07-21 13:04:44 +00:00
|
|
|
astman.o: _ASTCFLAGS+=-DNO_MALLOC_DEBUG -DSTANDALONE
|
2003-05-06 00:00:20 +00:00
|
|
|
|
2006-09-29 22:47:40 +00:00
|
|
|
stereorize: stereorize.o frame.o
|
2006-07-15 16:40:05 +00:00
|
|
|
stereorize: LIBS+=-lm
|
2005-01-21 03:56:22 +00:00
|
|
|
|
2006-09-29 22:47:40 +00:00
|
|
|
strcompat.c: ../main/strcompat.c
|
|
|
|
@cp $< $@
|
2006-09-15 17:16:00 +00:00
|
|
|
|
2006-08-21 02:11:39 +00:00
|
|
|
../main/ast_expr2.c:
|
|
|
|
@echo " [BISON] ../main/ast_expr2.y -> $@"
|
|
|
|
@bison -o $@ -d --name-prefix=ast_yy ../main/ast_expr2.y
|
2006-05-08 14:34:32 +00:00
|
|
|
|
2006-08-21 02:11:39 +00:00
|
|
|
../main/ast_expr2f.c:
|
|
|
|
@echo " [FLEX] ../main/ast_expr2.fl -> $@"
|
|
|
|
@flex -o $@ --full ../main/ast_expr2.fl
|
2006-04-29 14:48:32 +00:00
|
|
|
|
2006-09-29 22:47:40 +00:00
|
|
|
ast_expr2.c: ../main/ast_expr2.c
|
|
|
|
@cp $< $@
|
2005-08-29 22:03:37 +00:00
|
|
|
|
2009-07-21 13:04:44 +00:00
|
|
|
ast_expr2.o: _ASTCFLAGS+=-DSTANDALONE_AEL
|
2008-09-27 15:00:48 +00:00
|
|
|
|
2006-09-29 22:47:40 +00:00
|
|
|
ast_expr2f.c: ../main/ast_expr2f.c
|
|
|
|
@cp $< $@
|
2005-08-29 22:03:37 +00:00
|
|
|
|
2009-07-21 13:04:44 +00:00
|
|
|
ast_expr2f.o: _ASTCFLAGS+=-DSTANDALONE_AEL -I../main -Wno-unused
|
2005-06-21 20:16:51 +00:00
|
|
|
|
2007-01-24 18:26:22 +00:00
|
|
|
check_expr: check_expr.o ast_expr2.o ast_expr2f.o
|
2006-05-19 19:46:10 +00:00
|
|
|
|
2009-03-03 18:11:34 +00:00
|
|
|
check_expr2: ast_expr2.c ast_expr2f.o
|
|
|
|
gcc -DSTANDALONE ast_expr2.c ast_expr2f.o -o check_expr2
|
|
|
|
check_expr2 expr2.testinput
|
|
|
|
|
2006-09-29 22:47:40 +00:00
|
|
|
aelbison.c: ../pbx/ael/ael.tab.c
|
|
|
|
@cp $< $@
|
|
|
|
aelbison.o: aelbison.c ../pbx/ael/ael.tab.h ../include/asterisk/ael_structs.h
|
2009-07-21 13:04:44 +00:00
|
|
|
aelbison.o: _ASTCFLAGS+=-I../pbx -DSTANDALONE_AEL
|
2006-05-19 19:46:10 +00:00
|
|
|
|
2006-09-29 22:47:40 +00:00
|
|
|
pbx_ael.c: ../pbx/pbx_ael.c
|
|
|
|
@cp $< $@
|
2009-07-21 13:04:44 +00:00
|
|
|
pbx_ael.o: _ASTCFLAGS+=-DSTANDALONE_AEL
|
2006-05-19 19:46:10 +00:00
|
|
|
|
2006-09-29 22:47:40 +00:00
|
|
|
ael_main.o: ael_main.c ../include/asterisk/ael_structs.h
|
2009-07-21 13:04:44 +00:00
|
|
|
ael_main.o: _ASTCFLAGS+=-DSTANDALONE_AEL
|
2006-09-29 22:47:40 +00:00
|
|
|
|
|
|
|
aelparse.c: ../pbx/ael/ael_lex.c
|
|
|
|
@cp $< $@
|
|
|
|
aelparse.o: aelparse.c ../include/asterisk/ael_structs.h ../pbx/ael/ael.tab.h
|
2009-07-21 13:04:44 +00:00
|
|
|
aelparse.o: _ASTCFLAGS+=-I../pbx -DSTANDALONE_AEL -Wno-unused
|
2006-04-24 17:41:27 +00:00
|
|
|
|
2006-09-29 22:47:40 +00:00
|
|
|
aelparse: aelparse.o aelbison.o pbx_ael.o ael_main.o ast_expr2f.o ast_expr2.o strcompat.o
|
2006-04-24 17:41:27 +00:00
|
|
|
|
2006-09-15 17:16:00 +00:00
|
|
|
smsq: smsq.o strcompat.o
|
2006-08-21 02:11:39 +00:00
|
|
|
smsq: LIBS+=$(POPT_LIB)
|
2004-12-11 22:36:27 +00:00
|
|
|
|
2005-08-22 19:29:29 +00:00
|
|
|
streamplayer: streamplayer.o
|
|
|
|
|
2006-08-21 02:11:39 +00:00
|
|
|
muted: muted.o
|
|
|
|
muted: LIBS+=$(AUDIO_LIBS)
|
|
|
|
|
2006-12-16 21:14:34 +00:00
|
|
|
ifneq ($(wildcard .*.d),)
|
|
|
|
include .*.d
|
2006-09-09 03:27:21 +00:00
|
|
|
endif
|