Makefile: rework OpenWRT 900-force_copy_olsrd_conf_file.patch
authorFerry Huberts <ferry.huberts@pelagic.nl>
Tue, 3 Jul 2012 10:36:00 +0000 (12:36 +0200)
committerFerry Huberts <ferry.huberts@pelagic.nl>
Tue, 3 Jul 2012 10:38:18 +0000 (12:38 +0200)
Instead of always overwriting the olsrd.conf on install,
the user must specify 'make INSTALLOVERWRITE=Y install'

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Makefile

index b4b1661..3e330bc 100644 (file)
--- a/Makefile
+++ b/Makefile
 VERS =         0.6.3
 
 TOPDIR = .
+INSTALLOVERWRITE ?=
 include Makefile.inc
 
 # pass generated variables to save time
 MAKECMD = $(MAKE) OS="$(OS)" WARNINGS="$(WARNINGS)"
 
 LIBS +=                $(OS_LIB_DYNLOAD)
-
 ifeq ($(OS), win32)
 LDFLAGS +=     -Wl,--out-implib=libolsrd.a
 LDFLAGS +=     -Wl,--export-all-symbols
@@ -128,7 +128,11 @@ install_olsrd:     install_bin
                @echo can be found at files/olsrd.conf.default.lq
                @echo ==========================================================
                mkdir -p $(ETCDIR)
+ifeq ($(INSTALLOVERWRITE),)
                -cp -i files/olsrd.conf.default.lq $(CFGFILE)
+else
+               -cp -f files/olsrd.conf.default.lq $(CFGFILE)
+endif
                @echo -------------------------------------------
                @echo Edit $(CFGFILE) before running olsrd!!
                @echo -------------------------------------------