From 7407f16149c2e459d15735e257fcf5d767c36313 Mon Sep 17 00:00:00 2001 From: Jonathan Moore Liles Date: Fri, 16 May 2008 16:38:07 -0500 Subject: [PATCH] Use old options as defaults when reconfiguring. --- Makefile | 11 ++++++----- configure | 19 ++++++++++++++++--- 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index 14cd289..292e6c0 100644 --- a/Makefile +++ b/Makefile @@ -7,8 +7,6 @@ # Do not edit this file; run `make config` instead. # -include scripts/colors - VERSION := 0.5.0 all: makedepend FL Timeline Mixer @@ -19,13 +17,15 @@ make.conf: configure -include make.conf ifeq (($MAINTAINER_MODE),yes) - CXXFLAGS := -ggdb -Wextra -Wno-missing-field-initializers -O0 -fno-rtti -fno-exceptions + CXXFLAGS := -pipe -ggdb -Wextra -Wno-missing-field-initializers -O0 -fno-rtti -fno-exceptions else - CXXFLAGS := -O3 -fno-rtti -fno-exceptions -DNDEBUG + CXXFLAGS := -pipe -O3 -fno-rtti -fno-exceptions -DNDEBUG endif CXXFLAGS += $(LASH_CFLAGS) -DINSTALL_PREFIX=\"$(prefix)\" -DVERSION=\"$(VERSION)\" +include scripts/colors + .C.o: @ echo -n "Compiling: "; echo $(BOLD)$(YELLOW)$<$(SGR0); true @ $(CXX) $(CXXFLAGS) $(INCLUDES) -c $< -o $@ @@ -58,7 +58,8 @@ makedepend: $(SRCS) clean: FL_clean Timeline_clean Mixer_clean config: - @ rm -f make.conf +# @ rm -f make.conf + @ ./configure @ $(MAKE) -s -include makedepend diff --git a/configure b/configure index 5211f49..881776f 100755 --- a/configure +++ b/configure @@ -36,11 +36,24 @@ failed () echo "-- Configuration:" +# get the old values +if [ -f make.conf ] +then + OIFS="$IFS" + IFS='' + eval "`sed -n '/^## options/{ : i; /^## libs/{ q }; p; n; b i }' make.conf`" + IFS="$OIFS" +fi + echo "# This is a generated file. Any changes may be lost!" > make.conf -ask "Install prefix?" prefix /usr/local -ask "Use LASH?" USE_LASH yes -ask "Build for debugging?" MAINTAINER_MODE no +echo "## options" >> make.conf + +ask "Install prefix?" prefix ${prefix:-/usr/local} +ask "Use LASH?" USE_LASH ${USE_LASH:-yes} +ask "Build for debugging?" MAINTAINER_MODE ${MAINTAINER_MODE:-no} + +echo "## libs/flags" >> make.conf # tests