Merge pull request #28 from ZeroChaos-/patch-1

allow override of cc and cflags/ldflags
This commit is contained in:
Serge Vakulenko 2019-09-18 22:12:28 -07:00 committed by GitHub
commit df2d411402
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,4 +1,4 @@
CC = gcc CC ?= gcc
VERSION = $(shell git describe --tags --abbrev=0) VERSION = $(shell git describe --tags --abbrev=0)
GITCOUNT = $(shell git rev-list HEAD --count) GITCOUNT = $(shell git rev-list HEAD --count)
@ -6,10 +6,11 @@ UNAME = $(shell uname)
OBJS = main.o util.o radio.o dfu-libusb.o uv380.o md380.o rd5r.o \ OBJS = main.o util.o radio.o dfu-libusb.o uv380.o md380.o rd5r.o \
gd77.o hid.o serial.o d868uv.o dm1801.o gd77.o hid.o serial.o d868uv.o dm1801.o
LDFLAGS = -g CFLAGS ?= -g -O -Wall -Werror
LIBS = $(shell pkg-config --libs --static libusb-1.0) CFLAGS += -DVERSION='"$(VERSION).$(GITCOUNT)"' \
CFLAGS = -g -O -Wall -Werror -DVERSION='"$(VERSION).$(GITCOUNT)"' \
$(shell pkg-config --cflags libusb-1.0) $(shell pkg-config --cflags libusb-1.0)
LDFLAGS ?= -g
LIBS = $(shell pkg-config --libs --static libusb-1.0)
# #
# Make sure pkg-config is installed. # Make sure pkg-config is installed.