aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authormarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2004-11-19 14:04:57 +0000
committermarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2004-11-19 14:04:57 +0000
commita1f6a04d2fe4813bf8068846e5f7933fa12ce634 (patch)
tree86b6468e44b28f890d151a78f30320a91e6d00e3 /Makefile
parentb83e5b082524f4f9dd8a5f93fe0858cbcf5d95ab (diff)
Create "OVERWRITE" option to Makefile to prevent sample from overwriting options
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@4297 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'Makefile')
-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 ; \