Commit 61177553 authored by Ben Gardiner's avatar Ben Gardiner Committed by Chris Ball
Browse files

allow environment and command-line supplied make vars



Most useful when cross-compiling.
Signed-off-by: default avatarBen Gardiner <bengardiner@nanometrics.ca>
Signed-off-by: default avatarChris Ball <cjb@laptop.org>
parent 64f63a3d
CC = gcc CC ?= gcc
AM_CFLAGS = -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2 AM_CFLAGS = -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2
CFLAGS = -g -O2 CFLAGS ?= -g -O2
objects = mmc.o mmc_cmds.o objects = mmc.o mmc_cmds.o
CHECKFLAGS= -Wall -Werror -Wuninitialized -Wundef CHECKFLAGS = -Wall -Werror -Wuninitialized -Wundef
DEPFLAGS = -Wp,-MMD,$(@D)/.$(@F).d,-MT,$@ DEPFLAGS = -Wp,-MMD,$(@D)/.$(@F).d,-MT,$@
override CFLAGS := $(CHECKFLAGS) $(AM_CFLAGS) $(CFLAGS)
INSTALL = install INSTALL = install
prefix ?= /usr/local prefix ?= /usr/local
bindir = $(prefix)/bin bindir = $(prefix)/bin
...@@ -26,7 +28,7 @@ all: $(progs) manpages ...@@ -26,7 +28,7 @@ all: $(progs) manpages
ifdef C ifdef C
$(check) $< $(check) $<
endif endif
$(CC) $(CHECKFLAGS) $(AM_CFLAGS) $(DEPFLAGS) $(CFLAGS) -c $< $(CC) $(CPPFLAGS) $(CFLAGS) $(DEPFLAGS) -c $<
mmc: $(objects) mmc: $(objects)
$(CC) $(CFLAGS) -o $@ $(objects) $(LDFLAGS) $(LIBS) $(CC) $(CFLAGS) -o $@ $(objects) $(LDFLAGS) $(LIBS)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment