summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Spencer <markster@digium.com>2004-11-19 14:04:57 +0000
committerMark Spencer <markster@digium.com>2004-11-19 14:04:57 +0000
commit0351e3e37c2e119e48947cb63ecaeb0a9e5cce35 (patch)
tree86b6468e44b28f890d151a78f30320a91e6d00e3
parentc05c95b497972eb49dcb63da4c5f9b09ce9f4d3c (diff)
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
-rwxr-xr-xMakefile30
1 files changed, 21 insertions, 9 deletions
diff --git a/Makefile b/Makefile
index f74d153c8..87953865c 100755
--- a/Makefile
+++ b/Makefile
@@ -61,6 +61,9 @@ PWD=$(shell pwd)
######### ppro's, etc, as well as the AMD K6 and K7.
#K6OPT = -DK6OPT
+#Overwite config files on "make samples"
+OVERWRITE=y
+
#Tell gcc to optimize the asterisk's code
OPTIMIZE+=-O6
@@ -447,18 +450,27 @@ samples: all datafiles adsi
mkdir -p $(DESTDIR)$(ASTETCDIR)
for x in configs/*.sample; do \
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 ; \
install -m 644 $$x $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample` ;\
done
- echo "[directories]" > $(DESTDIR)$(ASTETCDIR)/asterisk.conf
- echo "astetcdir => $(ASTETCDIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf
- echo "astmoddir => $(MODULES_DIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf
- echo "astvarlibdir => $(ASTVARLIBDIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf
- echo "astagidir => $(AGI_DIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf
- echo "astspooldir => $(ASTSPOOLDIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf
- echo "astrundir => $(ASTVARRUNDIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf
- echo "astlogdir => $(ASTLOGDIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf
+ if [ "$(OVERWRITE)" = "y" ] || [ ! -f $(DESTDIR)$(ASTETCDIR)/asterisk.conf ]; then \
+ echo "[directories]" > $(DESTDIR)$(ASTETCDIR)/asterisk.conf ; \
+ echo "astetcdir => $(ASTETCDIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf ; \
+ echo "astmoddir => $(MODULES_DIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf ; \
+ echo "astvarlibdir => $(ASTVARLIBDIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf ; \
+ echo "astagidir => $(AGI_DIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf ; \
+ echo "astspooldir => $(ASTSPOOLDIR)" >> $(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 \
if grep -q "^%`basename $$x`%" sounds.txt; then \
install -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds ; \