From ab7bf723c141783178f33ba5f0fd9da4baf44d05 Mon Sep 17 00:00:00 2001 From: Kolan Sh Date: Sat, 9 Jul 2011 21:07:06 +0400 Subject: [PATCH] =?UTF-8?q?=D0=A2=D0=B5=D0=BF=D0=B5=D1=80=D1=8C=20=D1=83?= =?UTF-8?q?=D1=87=D0=B8=D1=82=D1=8B=D0=B2=D0=B0=D1=8E=D1=82=D1=81=D1=8F=20?= =?UTF-8?q?CFLAGS=20=D0=B8=20LDFLAGS=20=D0=BF=D1=80=D0=B8=20=D0=BE=D0=BF?= =?UTF-8?q?=D1=80=D0=B5=D0=B4=D0=B5=D0=BB=D0=B5=D0=BD=D0=B8=D0=B8=20=D0=BD?= =?UTF-8?q?=D0=B5=D0=BE=D0=B1=D1=85=D0=BE=D0=B4=D0=B8=D0=BC=D0=BE=D1=81?= =?UTF-8?q?=D1=82=D0=B8=20=D0=B0=D0=B2=D1=82=D0=BE=D0=BC=D0=B0=D1=82=D0=B8?= =?UTF-8?q?=D1=87=D0=B5=D1=81=D0=BA=D0=BE=D0=B3=D0=BE=20=D0=B2=D1=8B=D0=BF?= =?UTF-8?q?=D0=BE=D0=BB=D0=BD=D0=B5=D0=BD=D0=B8=D1=8F=20make=20clean?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bash/smake/etc/smake/build.smk | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/bash/smake/etc/smake/build.smk b/bash/smake/etc/smake/build.smk index 63a5b6a..3ae65ad 100644 --- a/bash/smake/etc/smake/build.smk +++ b/bash/smake/etc/smake/build.smk @@ -24,7 +24,7 @@ endif CFLAGS += -Wall LDFLAGS += -Wall $(LIBRARIES) -all: change_build_mode $(TARGET) +all: change_make_options $(TARGET) ifneq ($(mode),debug) ifneq ($(mode),profile) @@ -43,12 +43,16 @@ endif @echo "LDFLAGS=$(LDFLAGS)" @echo ".........................." -OLD_BUILD_MODE=$(shell cat build_mode.out 2>/dev/null) -change_build_mode: -ifneq ($(mode), $(OLD_BUILD_MODE)) +OLD_BUILD_MODE=$(shell grep ^MODE make_options.out 2>/dev/null | sed 's~^MODE=~~') +OLD_BUILD_CFLAGS=$(shell grep ^CFLAGS make_options.out 2>/dev/null | sed 's~^CFLAGS=~~') +OLD_BUILD_LDFLAGS=$(shell grep ^LDFLAGS make_options.out 2>/dev/null | sed 's~^LDFLAGS=~~') +change_make_options: +ifneq ($(mode)|$(CFLAGS)|$(LDFLAGS), $(OLD_BUILD_MODE)|$(OLD_BUILD_CFLAGS)|$(OLD_BUILD_LDFLAGS)) @echo CLEANING... @make clean &>/dev/null - @echo $(mode) > build_mode.out + @echo MODE=$(mode) > make_options.out + @echo CFLAGS=$(CFLAGS) >> make_options.out + @echo LDFLAGS=$(LDFLAGS) >> make_options.out endif %.o : @@ -57,4 +61,4 @@ endif clean: $(RM) *.o *.out callgrind.out.* *.gcno $(TARGET) -.PHONY: all change_build_mode clean +.PHONY: all change_make_options clean