From b5cdf931f2305dbddc4008879f81e1a3cb4c74ed Mon Sep 17 00:00:00 2001 From: Michel Pollet Date: Tue, 14 Oct 2014 18:44:24 +0100 Subject: [PATCH] build: re-accelerated the build Simavr used to build pretty quick, and it's been crawling for a while now, turns out some of the enhancements we added to the SIMAVR path detection were being evaluated a LOT. So went to the makefile and made sure most of the static variables are evaluated once only. Signed-off-by: Michel Pollet --- Makefile.common | 8 ++++---- examples/Makefile.opengl | 2 +- tests/Makefile | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Makefile.common b/Makefile.common index dbafa0b..42c7004 100644 --- a/Makefile.common +++ b/Makefile.common @@ -27,7 +27,7 @@ # along with simavr. If not, see . # simavr directory -SIMAVR ?= ${shell for p in . .. ../.. ../../..;do test -d $$p/simavr/sim && echo $$p/simavr; done} +SIMAVR := ${shell for p in . .. ../.. ../../..;do test -d $$p/simavr/sim && echo $$p/simavr; done} # You can override the build settings with local changes in this file # for example: @@ -37,7 +37,7 @@ SIMAVR ?= ${shell for p in . .. ../.. ../../..;do test -d $$p/simavr/sim && ech -include ${wildcard ${SIMAVR}/../.make.options*} # get the first character of what the compiler says it is, unless it's 'x86_64' doh -ARCH = ${shell $(CC) -dumpmachine | sed -e 's/^x/i/' -e 's/\(.\).*/\1/'} +ARCH := ${shell $(CC) -dumpmachine | sed -e 's/^x/i/' -e 's/\(.\).*/\1/'} CFLAGS += -O2 -Wall CFLAGS += -g @@ -91,8 +91,8 @@ MKDIR ?= mkdir -p INSTALL ?= install SHELL := ${shell which bash} -OBJ = obj-${shell $(CC) -dumpmachine} -LIBDIR = ${shell pwd}/${SIMAVR}/${OBJ} +OBJ := obj-${shell $(CC) -dumpmachine} +LIBDIR := ${shell pwd}/${SIMAVR}/${OBJ} LDFLAGS += -L${LIBDIR} -lsimavr LDFLAGS += -lelf diff --git a/examples/Makefile.opengl b/examples/Makefile.opengl index 158be54..acd89f9 100644 --- a/examples/Makefile.opengl +++ b/examples/Makefile.opengl @@ -1,5 +1,5 @@ -UNAME = ${shell uname} +UNAME := ${shell uname} ifeq (${UNAME}, Darwin) LDFLAGS += -framework GLUT -framework OpenGL diff --git a/tests/Makefile b/tests/Makefile index cff14f3..3232c8b 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -26,8 +26,8 @@ simavr = .. IPATH += ${simavr}/include IPATH += ${simavr}/simavr/sim -tests_src = ${wildcard test_*.c} -tests = ${patsubst %.c, ${OBJ}/%.tst, ${tests_src}} +tests_src := ${wildcard test_*.c} +tests := ${patsubst %.c, ${OBJ}/%.tst, ${tests_src}} all: obj axf tests -- 2.39.5