ref: 1616c1848447fe55117e59dda743dc62cfd74459
parent: 625542e463a8b100eed2272c0f2e4296485764c6
author: Tor Andersson <tor.andersson@artifex.com>
date: Mon Mar 22 09:51:33 EDT 2021
Some Makefile tweaks. Change default optimization flag to -O2. Use XCFLAGS and XCPPFLAGS to add to the definitions: make XCPPFLAGS=-I/foo/bar XCFLAGS=-mfoo-bar Set CFLAGS on the make command line if you want to override completely: make CFLAGS="-O3 -m32" If you want to override them with the system environment variables: make CFLAGS="$CFLAGS"
--- a/Makefile
+++ b/Makefile
@@ -15,7 +15,7 @@
# Compiler flags for various configurations:
-CFLAGS += -std=c99 -pedantic -Wall -Wextra -Wno-unused-parameter
+CFLAGS := -std=c99 -pedantic -Wall -Wextra -Wno-unused-parameter
ifeq "$(CC)" "clang"
CFLAGS += -Wunreachable-code
@@ -31,7 +31,7 @@
CFLAGS += -pipe -g -fsanitize=address -fno-omit-frame-pointer
LDFLAGS += -fsanitize=address
else ifeq "$(build)" "release"
- CFLAGS += -Os
+ CFLAGS += -O2
LDFLAGS += -Wl,-s
endif
@@ -41,6 +41,7 @@
endif
CFLAGS += $(XCFLAGS)
+CPPFLAGS += $(XCPPFLAGS)
# You shouldn't need to edit anything below here.