+CPPFLAGS += -DBINDIR='"$(bindir)"'
+CPPFLAGS += -DCOPYRIGHT_YEAR='"$(COPYRIGHT_YEAR)"'
+CPPFLAGS += -DBUILD_DATE='"$(build_date)"'
+CPPFLAGS += -DUNAME_RS='"$(uname_rs)"'
+CPPFLAGS += -DCC_VERSION='"$(cc_version)"'
+CPPFLAGS += -I/usr/local/include
+CPPFLAGS += -I$(cmdline_dir)
+CPPFLAGS += -I$(cmdlist_dir)
+
+CFLAGS += -Os
+CFLAGS += -Wuninitialized
+CFLAGS += -Wchar-subscripts
+CFLAGS += -Werror-implicit-function-declaration
+CFLAGS += -Wmissing-noreturn
+CFLAGS += -Wbad-function-cast
+CFLAGS += -fno-strict-aliasing
+
+STRICT_CFLAGS = $(CFLAGS)
+STRICT_CFLAGS += -g -Wundef -W
+STRICT_CFLAGS += -Wredundant-decls
+STRICT_CFLAGS += -Wno-sign-compare -Wno-unknown-pragmas
+STRICT_CFLAGS += -Wformat -Wformat-security
+STRICT_CFLAGS += -Wmissing-format-attribute
+STRICT_CFLAGS += -Wdeclaration-after-statement
+
+ifeq ($(uname_s),Linux)
+ # these cause warnings on *BSD
+ CPPFLAGS += -Wunused-macros
+ STRICT_CFLAGS += -fdata-sections -ffunction-sections
+ STRICT_CFLAGS += -Wstrict-prototypes
+ STRICT_CFLAGS += -Wshadow
+ STRICT_CFLAGS += -Wunused -Wall
+ LDFLAGS += -Wl,--gc-sections
+endif
+
+cc-option = $(shell \
+ $(CC) $(1) -Werror -c -x c /dev/null -o /dev/null > /dev/null 2>&1 \
+ && echo "$(1)" \
+)
+
+STRICT_CFLAGS += $(call cc-option, -Wformat-signedness)
+
+# To put more focus on warnings, be less verbose as default
+# Use 'make V=1' to see the full commands
+ifeq ("$(origin V)", "command line")
+ Q :=
+else
+ Q := @
+endif
+
+$(cmdlist_dir)/%.command_list.h: %.cmd %.c | $(cmdlist_dir)