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
CFLAGS = -g -O2
CFLAGS ?= -g -O2
objects = mmc.o mmc_cmds.o
CHECKFLAGS= -Wall -Werror -Wuninitialized -Wundef
CHECKFLAGS = -Wall -Werror -Wuninitialized -Wundef
DEPFLAGS = -Wp,-MMD,$(@D)/.$(@F).d,-MT,$@
override CFLAGS := $(CHECKFLAGS) $(AM_CFLAGS) $(CFLAGS)
INSTALL = install
prefix ?= /usr/local
bindir = $(prefix)/bin
......@@ -26,7 +28,7 @@ all: $(progs) manpages
ifdef C
$(check) $<
endif
$(CC) $(CHECKFLAGS) $(AM_CFLAGS) $(DEPFLAGS) $(CFLAGS) -c $<
$(CC) $(CPPFLAGS) $(CFLAGS) $(DEPFLAGS) -c $<
mmc: $(objects)
$(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