From 728fa03a6ebf15b24a2cc0be2ffdd037da4df5bf Mon Sep 17 00:00:00 2001
From: Federico Vaga <federico.vaga@cern.ch>
Date: Fri, 25 Jul 2014 11:44:34 +0200
Subject: [PATCH] tools: include specific Makefile

Sometimes (expecially in cross-compilation context) t is necessary to use
different environments. Instead of complicate this makefile, include
an external one with user code.

Create a local file named Makefile.specific, and write here your code.
Bear in mind that Makefile.specific will run before the Makefile.

Signed-off-by: Federico Vaga <federico.vaga@cern.ch>
---
 tools/.gitignore | 1 +
 tools/Makefile   | 8 ++++++--
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/tools/.gitignore b/tools/.gitignore
index 8c88d02..2720028 100644
--- a/tools/.gitignore
+++ b/tools/.gitignore
@@ -9,3 +9,4 @@ wr-dio-pps
 wr-dio-agent
 wr-dio-ruler
 stamp-frame
+Makefile.specific
\ No newline at end of file
diff --git a/tools/Makefile b/tools/Makefile
index 11beab9..97d545d 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -1,6 +1,10 @@
+# If it exists includes Makefile.specific. In this Makefile, you should put
+# specific Makefile code that you want to run before this. For example,
+# build a particular environment.
+-include Makefile.specific
 
-CFLAGS = -ggdb -Wall -fPIC -I../kernel $(EXTRACFLAGS)
-LDFLAGS = -L. -lspec 
+CFLAGS += -ggdb -Wall -fPIC -I../kernel $(EXTRACFLAGS)
+LDFLAGS += -L. -lspec
 
 LIB = libspec.a
 LIBOBJ = speclib.o loader-ll.o
-- 
GitLab