From ee229ee79e95f440e72b753c599f36e8305b7904 Mon Sep 17 00:00:00 2001 From: Zero_Chaos Date: Tue, 19 Feb 2019 10:46:38 -0500 Subject: [PATCH] allow override of cc and cflags/ldflags Most distro build systems expect to be able to override these things. this should keep your defaults while allowing override. --- Makefile | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 66db092..be8a605 100644 --- a/Makefile +++ b/Makefile @@ -1,10 +1,11 @@ -CC = gcc +CC ?= gcc VERSION = $(shell git describe --tags --abbrev=0) GITCOUNT = $(shell git rev-list HEAD --count) UNAME = $(shell uname) -CFLAGS = -g -O -Wall -Werror -DVERSION='"$(VERSION).$(GITCOUNT)"' -LDFLAGS = -g +CFLAGS ?= -g -O -Wall -Werror +CFLAGS += -DVERSION='"$(VERSION).$(GITCOUNT)"' +LDFLAGS ?= -g OBJS = main.o util.o radio.o dfu-libusb.o uv380.o md380.o rd5r.o gd77.o hid.o serial.o d868uv.o LIBS = -lusb-1.0