From 373122de2f3e3a6e937e527044ae3b62ba939c96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Sun, 30 Oct 2016 00:13:42 +0300 Subject: Use := instead of = for list of files This will make sure we don't look twice. Also make a single call to find the common file formats rather than many calls. --- core/erlc.mk | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'core/erlc.mk') diff --git a/core/erlc.mk b/core/erlc.mk index 5bb4078..bf6d605 100644 --- a/core/erlc.mk +++ b/core/erlc.mk @@ -91,8 +91,10 @@ app-build: ebin/$(PROJECT).app # Source files. -ERL_FILES = $(sort $(call core_find,src/,*.erl)) -CORE_FILES = $(sort $(call core_find,src/,*.core)) +ALL_SRC_FILES := $(sort $(call core_find,src/,*)) + +ERL_FILES := $(filter %.erl,$(ALL_SRC_FILES)) +CORE_FILES := $(filter %.core,$(ALL_SRC_FILES)) # ASN.1 files. @@ -125,11 +127,11 @@ endif # Leex and Yecc files. -XRL_FILES = $(sort $(call core_find,src/,*.xrl)) +XRL_FILES := $(filter %.xrl,$(ALL_SRC_FILES)) XRL_ERL_FILES = $(addprefix src/,$(patsubst %.xrl,%.erl,$(notdir $(XRL_FILES)))) ERL_FILES += $(XRL_ERL_FILES) -YRL_FILES = $(sort $(call core_find,src/,*.yrl)) +YRL_FILES := $(filter %.yrl,$(ALL_SRC_FILES)) YRL_ERL_FILES = $(addprefix src/,$(patsubst %.yrl,%.erl,$(notdir $(YRL_FILES)))) ERL_FILES += $(YRL_ERL_FILES) -- cgit v1.2.3