[OpenBIOS] [PATCH 1/1] [FCODE-utils] Allow overriding more Makefile vars

Peter Lemenkov lemenkov at gmail.com
Sat Jan 16 18:48:29 CET 2016


As a package maintainer I'd like to override some more Makefile
variables. Namely:

* DESTDIR
* strip command invokation (ability to suppress it by passing /bin/true
  instead of /bin/strip)
* pass custom gcc flags

This patch allows this. It does not break any existing workflows where
it's not required to change these variables.

Signed-off-by: Peter Lemenkov <lemenkov at gmail.com>
---
 detok/Makefile      | 6 +++---
 romheaders/Makefile | 6 +++---
 toke/Makefile       | 6 +++---
 3 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/detok/Makefile b/detok/Makefile
index 3ba6c30..0e422fb 100644
--- a/detok/Makefile
+++ b/detok/Makefile
@@ -24,13 +24,13 @@
 
 PROGRAM = detok
 
-DESTDIR = /usr/local
+DESTDIR ?= /usr/local
 CC      ?= gcc
-STRIP	= strip
+STRIP	?= strip
 INCLUDES = -I../shared
 
 # Normal Flags:
-CFLAGS  = -O2 -Wall #-Wextra
+CFLAGS  ?= -O2 -Wall #-Wextra
 LDFLAGS = 
 
 # Coverage:
diff --git a/romheaders/Makefile b/romheaders/Makefile
index a216e7b..1831036 100644
--- a/romheaders/Makefile
+++ b/romheaders/Makefile
@@ -24,10 +24,10 @@
 
 PROGRAM = romheaders
 
-DESTDIR  = /usr/local
+DESTDIR  ?= /usr/local
 CC	 ?= gcc
-STRIP    = strip
-CFLAGS   = -O2 -Wall -Wextra
+STRIP    ?= strip
+CFLAGS   ?= -O2 -Wall -Wextra
 INCLUDES = -I../shared
 
 SOURCES = romheaders.c ../shared/classcodes.c
diff --git a/toke/Makefile b/toke/Makefile
index aa75acd..8e31abd 100644
--- a/toke/Makefile
+++ b/toke/Makefile
@@ -24,13 +24,13 @@
 
 PROGRAM = toke
 
-DESTDIR = /usr/local
+DESTDIR ?= /usr/local
 CC      ?= gcc
-STRIP	= strip
+STRIP	?= strip
 INCLUDES = -I../shared
 
 # Normal flags
-CFLAGS  = -O2 -Wall #-Wextra 
+CFLAGS  ?= -O2 -Wall #-Wextra 
 LDFLAGS =
 
 # Coverage:
-- 
2.5.0




More information about the OpenBIOS mailing list