Files
asterisk/utils/Makefile
T

161 lines
3.9 KiB
Makefile
Raw Normal View History

#
# Asterisk -- A telephony toolkit for Linux.
#
# Various utilities
#
# Copyright (C) 1999-2006, Digium
#
# Mark Spencer <markster@digium.com>
#
# This program is free software, distributed under the terms of
# the GNU General Public License
#
2007-03-22 14:48:09 +00:00
-include ../menuselect.makeopts
2006-12-16 21:24:52 +00:00
.PHONY: clean all uninstall
2007-01-24 18:39:49 +00:00
# to get check_expr, add it to the ALL_UTILS list
ALL_UTILS:=astman smsq stereorize streamplayer aelparse muted check_expr conf2ael hashtest2
2006-09-29 22:48:43 +00:00
UTILS:=$(ALL_UTILS)
include $(ASTTOPDIR)/Makefile.rules
2004-06-04 15:44:14 +00:00
ifeq ($(OSARCH),SunOS)
LIBS+=-lsocket -lnsl
2006-09-18 22:35:40 +00:00
UTILS:=$(filter-out muted,$(UTILS))
endif
2006-10-28 16:39:40 +00:00
ifeq ($(OSARCH),OpenBSD)
UTILS:=$(filter-out muted,$(UTILS))
endif
ifeq ($(POPT_LIB),)
UTILS:=$(filter-out smsq,$(UTILS))
endif
ifeq ($(NEWT_LIB),)
UTILS:=$(filter-out astman,$(UTILS))
2005-03-17 23:12:15 +00:00
endif
ifneq ($(filter pbx_ael,$(MENUSELECT_PBX)),)
UTILS:=$(filter-out aelparse,$(UTILS))
UTILS:=$(filter-out conf2ael,$(UTILS))
endif
2006-06-22 14:09:18 +00:00
all: $(UTILS)
2002-07-27 14:29:35 +00:00
install:
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
uninstall:
2006-09-29 22:48:43 +00:00
for x in $(ALL_UTILS); do rm -f $$x $(DESTDIR)$(ASTSBINDIR)/$$x; done
2006-12-16 21:24:52 +00:00
clean:
2006-09-29 22:48:43 +00:00
rm -f *.o $(ALL_UTILS) check_expr
2006-12-16 21:24:52 +00:00
rm -f .*.o.d .*.oo.d
rm -f md5.c strcompat.c ast_expr2.c ast_expr2f.c pbx_ael.c pval.c
rm -f aelparse.c aelbison.c conf2ael
rm -f utils.c sha1.c astobj2.c hashtest2
2006-09-29 22:48:43 +00:00
md5.c: ../main/md5.c
@cp $< $@
2006-09-29 22:48:43 +00:00
astman: astman.o md5.o
2006-10-05 01:43:02 +00:00
astman: LIBS+=$(NEWT_LIB)
2003-05-06 00:00:20 +00:00
2006-09-29 22:48:43 +00:00
stereorize: stereorize.o frame.o
stereorize: LIBS+=-lm
2006-09-29 22:48:43 +00:00
strcompat.c: ../main/strcompat.c
@cp $< $@
../main/ast_expr2.c:
@echo " [BISON] ../main/ast_expr2.y -> $@"
@bison -o $@ -d --name-prefix=ast_yy ../main/ast_expr2.y
../main/ast_expr2f.c:
@echo " [FLEX] ../main/ast_expr2.fl -> $@"
@flex -o $@ --full ../main/ast_expr2.fl
pval.c: ../res/ael/pval.c
@cp $< $@
2006-09-29 22:48:43 +00:00
ast_expr2.c: ../main/ast_expr2.c
@cp $< $@
2006-09-29 22:48:43 +00:00
ast_expr2f.c: ../main/ast_expr2f.c
@cp $< $@
2006-09-29 22:48:43 +00:00
ast_expr2f.o: ASTCFLAGS+=-DSTANDALONE_AEL -I../main
pval.o : ASTCFLAGS+=-DSTANDALONE
check_expr: check_expr.o ast_expr2.o ast_expr2f.o strcompat.o clicompat.o ../main/threadstorage.o
aelbison.c: ../res/ael/ael.tab.c
2006-09-29 22:48:43 +00:00
@cp $< $@
aelbison.o: aelbison.c ../res/ael/ael.tab.h ../include/asterisk/ael_structs.h
aelbison.o: ASTCFLAGS+=-I../res/ael -DYYENABLE_NLS=0
2006-09-29 22:48:43 +00:00
pbx_ael.c: ../pbx/pbx_ael.c
@cp $< $@
pbx_ael.o: ASTCFLAGS+=-DSTANDALONE_AEL
2006-09-29 22:48:43 +00:00
ael_main.o: ael_main.c ../include/asterisk/ael_structs.h
aelparse.c: ../res/ael/ael_lex.c
2006-09-29 22:48:43 +00:00
@cp $< $@
aelparse.o: aelparse.c ../include/asterisk/ael_structs.h ../res/ael/ael.tab.h
aelparse.o: ASTCFLAGS+=-I../res -DSTANDALONE_AEL
aelparse: aelparse.o aelbison.o pbx_ael.o ael_main.o ast_expr2f.o ast_expr2.o strcompat.o pval.o extconf.o
astobj2.c : ../main/astobj2.c ../include/asterisk/astobj2.h
cp ../main/astobj2.c .
utils.c : ../main/utils.c
cp ../main/utils.c .
sha1.c : ../main/sha1.c
cp ../main/sha1.c .
sha1.o : sha1.c
utils.o : utils.c
astobj2.o : astobj2.c
hashtest2.o : hashtest2.c
2007-09-11 17:16:16 +00:00
$(CC) -g -O0 -c hashtest2.c $(PTHREAD_CFLAGS) -I/usr/include -I../include
hashtest2 : hashtest2.o md5.o utils.o astobj2.o sha1.o strcompat.o ../main/threadstorage.o clicompat.o
$(CC) -g -O0 -o hashtest2 hashtest2.o astobj2.o utils.o md5.o sha1.o strcompat.o ../main/threadstorage.o clicompat.o $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) $(LIBS)
extconf.o : extconf.c
2007-08-20 00:38:20 +00:00
conf2ael: conf2ael.o ast_expr2f.o ast_expr2.o aelbison.o aelparse.o pbx_ael.o pval.o extconf.o strcompat.o
testexpr2s: ../main/ast_expr2f.c ../main/ast_expr2.c ../main/ast_expr2.h
$(CC) -g -c -I../include -DSTANDALONE_AEL ../main/ast_expr2f.c -o ast_expr2f.o
$(CC) -g -c -I../include -DSTANDALONE_AEL ../main/ast_expr2.c -o ast_expr2.o
2006-05-24 18:18:14 +00:00
$(CC) -g -o testexpr2s ast_expr2f.o ast_expr2.o
rm ast_expr2.o ast_expr2f.o
./testexpr2s expr2.testinput
smsq: smsq.o strcompat.o
smsq: LIBS+=$(POPT_LIB)
streamplayer: streamplayer.o
muted: muted.o
muted: LIBS+=$(AUDIO_LIBS)
2006-12-16 21:24:52 +00:00
ifneq ($(wildcard .*.d),)
include .*.d
endif