mirror of
https://github.com/asterisk/asterisk.git
synced 2025-12-12 10:02:27 +00:00
Create "OVERWRITE" option to Makefile to prevent sample from overwriting options
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@4297 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
30
Makefile
30
Makefile
@@ -61,6 +61,9 @@ PWD=$(shell pwd)
|
|||||||
######### ppro's, etc, as well as the AMD K6 and K7.
|
######### ppro's, etc, as well as the AMD K6 and K7.
|
||||||
#K6OPT = -DK6OPT
|
#K6OPT = -DK6OPT
|
||||||
|
|
||||||
|
#Overwite config files on "make samples"
|
||||||
|
OVERWRITE=y
|
||||||
|
|
||||||
#Tell gcc to optimize the asterisk's code
|
#Tell gcc to optimize the asterisk's code
|
||||||
OPTIMIZE+=-O6
|
OPTIMIZE+=-O6
|
||||||
|
|
||||||
@@ -447,18 +450,27 @@ samples: all datafiles adsi
|
|||||||
mkdir -p $(DESTDIR)$(ASTETCDIR)
|
mkdir -p $(DESTDIR)$(ASTETCDIR)
|
||||||
for x in configs/*.sample; do \
|
for x in configs/*.sample; do \
|
||||||
if [ -f $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample` ]; then \
|
if [ -f $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample` ]; then \
|
||||||
mv -f $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample` $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample`.old ; \
|
if [ "$(OVERWRITE)" = "y" ]; then \
|
||||||
|
mv -f $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample` $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample`.old ; \
|
||||||
|
else \
|
||||||
|
echo "Skipping config file $$x"; \
|
||||||
|
continue; \
|
||||||
|
fi ;\
|
||||||
fi ; \
|
fi ; \
|
||||||
install -m 644 $$x $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample` ;\
|
install -m 644 $$x $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample` ;\
|
||||||
done
|
done
|
||||||
echo "[directories]" > $(DESTDIR)$(ASTETCDIR)/asterisk.conf
|
if [ "$(OVERWRITE)" = "y" ] || [ ! -f $(DESTDIR)$(ASTETCDIR)/asterisk.conf ]; then \
|
||||||
echo "astetcdir => $(ASTETCDIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf
|
echo "[directories]" > $(DESTDIR)$(ASTETCDIR)/asterisk.conf ; \
|
||||||
echo "astmoddir => $(MODULES_DIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf
|
echo "astetcdir => $(ASTETCDIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf ; \
|
||||||
echo "astvarlibdir => $(ASTVARLIBDIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf
|
echo "astmoddir => $(MODULES_DIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf ; \
|
||||||
echo "astagidir => $(AGI_DIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf
|
echo "astvarlibdir => $(ASTVARLIBDIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf ; \
|
||||||
echo "astspooldir => $(ASTSPOOLDIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf
|
echo "astagidir => $(AGI_DIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf ; \
|
||||||
echo "astrundir => $(ASTVARRUNDIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf
|
echo "astspooldir => $(ASTSPOOLDIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf ; \
|
||||||
echo "astlogdir => $(ASTLOGDIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf
|
echo "astrundir => $(ASTVARRUNDIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf ; \
|
||||||
|
echo "astlogdir => $(ASTLOGDIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf ; \
|
||||||
|
else \
|
||||||
|
echo "Skipping asterisk.conf creation"; \
|
||||||
|
fi
|
||||||
for x in sounds/demo-*; do \
|
for x in sounds/demo-*; do \
|
||||||
if grep -q "^%`basename $$x`%" sounds.txt; then \
|
if grep -q "^%`basename $$x`%" sounds.txt; then \
|
||||||
install -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds ; \
|
install -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds ; \
|
||||||
|
|||||||
Reference in New Issue
Block a user