config.mk (1589B)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 | # # Makefile configuration # PROGRAM_VERSION = 0.0.1 PROGRAM_NAME = sr71 # Build mode/configuration MODE ?= debug # Set to 0 to disable logging. LOG_ENABLED ?= 1 # Base compiler flags CFLAGS += -DPROGRAM_NAME=\"$(PROGRAM_NAME)\" \ -DPROGRAM_VERSION_STR=\"$(PROGRAM_VERSION)\" \ -DLOG_ENABLED=$(LOG_ENABLED) -std=c11 \ -Wall \ -Werror-implicit-function-declaration \ -Wshadow \ -Winvalid-pch \ -Wstrict-aliasing \ -Wpacked \ -Wfloat-equal \ -Wstring-compare \ -Wconversion \ -Wstrict-prototypes \ -Wmissing-prototypes \ -Wmissing-field-initializers \ -Wredundant-decls \ -Wnested-externs \ -Wvla \ -Wno-sign-conversion \ -Wunsuffixed-float-constants \ -Wduplicated-cond \ -Wduplicated-branches \ -Wpacked-not-aligned \ -Wrestrict \ -Wjump-misses-init # Compiler flags for build modes ifeq ($(MODE), debug) CFLAGS += -Og -g -DDEBUG -fstrict-aliasing PROGRAM_TARGET = $(PROGRAM_NAME)-debug else ifeq ($(MODE), release) CFLAGS += -O2 -DNDEBUG PROGRAM_TARGET = $(PROGRAM_NAME) endif # Linux-specific (we support no other OS at the moment. Perhaps FreeBSD, etc. # in future) ifeq ($(shell uname), Linux) CC = gcc AR = ar RM = rm -f RMDIRS = rm -rf MKDIR = mkdir -p CFLAGS += -DPLATFORM_LINUX -D_GNU_SOURCE LDFLAGS += -lm -lpthread else #$(error Unsupported OS) endif # Arguments for Valgrind VALGRIND_ARGS = --leak-check=full \ --show-leak-kinds=all \ --track-origins=yes \ --fair-sched=no # Valgrind log file VALGRIND_LOG = valgrind-out.txt |