Improve makefile for clang support
This commit is contained in:
parent
c522e025cf
commit
58f95bf36a
43
Makefile
43
Makefile
@ -1,28 +1,39 @@
|
|||||||
PREFIX=$(HOME)/.local
|
PREFIX=$(HOME)/.local
|
||||||
VERSION=0.0.1
|
VERSION=0.0.1
|
||||||
CC=cc
|
CC=cc
|
||||||
CCONFIG=-std=c2x -Werror -D_XOPEN_SOURCE=700 -D_POSIX_C_SOURCE=200809L -fPIC -I/usr/local/include \
|
CCONFIG=-std=c2x -D_XOPEN_SOURCE=700 -D_POSIX_C_SOURCE=200809L -fPIC -I/usr/local/include \
|
||||||
-fno-signed-zeros -fno-finite-math-only -fno-signaling-nans -fno-trapping-math \
|
-fno-signed-zeros -fno-finite-math-only -fno-trapping-math \
|
||||||
-fsanitize=signed-integer-overflow -fno-sanitize-recover -fvisibility=hidden -fdollars-in-identifiers \
|
-fvisibility=hidden -fdollars-in-identifiers \
|
||||||
-DGC_THREADS
|
-DGC_THREADS
|
||||||
LTO=-flto=auto -fno-fat-lto-objects -Wl,-flto
|
LTO=
|
||||||
LDFLAGS=-L/usr/local/lib
|
LDFLAGS=-L/usr/local/lib
|
||||||
# MAKEFLAGS := --jobs=$(shell nproc) --output-sync=target
|
|
||||||
CWARN=-Wall -Wextra -Wno-format -Wshadow \
|
CWARN=-Wall -Wextra -Wno-format -Wshadow \
|
||||||
-Wno-pedantic \
|
-Wno-pedantic \
|
||||||
-Wno-pointer-arith \
|
-Wno-pointer-arith \
|
||||||
-Wsign-conversion -Wtype-limits -Wunused-result -Wnull-dereference \
|
-Wtype-limits -Wunused-result -Wnull-dereference \
|
||||||
-Walloc-zero -Walloca -Wcast-align -Wcast-align=strict \
|
-Walloca -Wcast-align -Wcast-align=strict \
|
||||||
-Wdangling-else -Wdate-time -Wdisabled-optimization -Wdouble-promotion -Wduplicated-branches \
|
-Wdangling-else -Wdate-time -Wdisabled-optimization -Wdouble-promotion \
|
||||||
-Wduplicated-cond -Wexpansion-to-defined -Wno-float-equal \
|
-Wexpansion-to-defined -Wno-float-equal \
|
||||||
-Wframe-address -Winline -Winvalid-pch -Wjump-misses-init \
|
-Wframe-address -Winline -Winvalid-pch \
|
||||||
-Wlogical-op -Wmissing-format-attribute -Wmissing-include-dirs -Wmissing-noreturn \
|
-Wmissing-format-attribute -Wmissing-include-dirs -Wmissing-noreturn \
|
||||||
-Wnull-dereference -Woverlength-strings -Wpacked -Wpacked-not-aligned \
|
-Wnull-dereference -Woverlength-strings -Wpacked \
|
||||||
-Wredundant-decls -Wshadow -Wshadow=compatible-local -Wshadow=global -Wshadow=local \
|
-Wredundant-decls -Wshadow \
|
||||||
-Wsign-conversion -Wno-stack-protector -Wsuggest-attribute=const -Wsuggest-attribute=noreturn -Wsuggest-attribute=pure -Wswitch-default \
|
-Wno-stack-protector -Wswitch-default \
|
||||||
-Wsync-nand -Wtrampolines -Wundef -Wunused -Wunused-but-set-variable \
|
-Wundef -Wunused -Wunused-but-set-variable \
|
||||||
-Wunused-const-variable -Wunused-local-typedefs -Wunused-macros -Wvariadic-macros -Wvector-operation-performance \
|
-Wunused-const-variable -Wunused-local-typedefs -Wunused-macros -Wvariadic-macros \
|
||||||
-Wwrite-strings
|
-Wwrite-strings
|
||||||
|
|
||||||
|
ifeq ($(shell $(CC) -v 2>&1 | grep -c "gcc version"), 1)
|
||||||
|
LTO += -flto=auto -fno-fat-lto-objects -Wl,-flto
|
||||||
|
CWARN += -Werror -Wsign-conversion -Walloc-zero -Wduplicated-branches -Wduplicated-cond -Wjump-misses-init \
|
||||||
|
-Wlogical-op -Wpacked-not-aligned -Wshadow=compatible-local -Wshadow=global -Wshadow=local \
|
||||||
|
-Wsuggest-attribute=const -Wsuggest-attribute=noreturn -Wsuggest-attribute=pure \
|
||||||
|
-Wsync-nand -Wtrampolines -Wvector-operation-performance
|
||||||
|
CCONFIG += -fsanitize=signed-integer-overflow -fno-sanitize-recover -fno-signaling-nans
|
||||||
|
else
|
||||||
|
CWARN += -Wno-missing-field-initializers
|
||||||
|
endif
|
||||||
|
|
||||||
OSFLAGS != case $$(uname -s) in *BSD|Darwin) echo '-D_BSD_SOURCE';; Linux) echo '-D_GNU_SOURCE';; *) echo '-D_DEFAULT_SOURCE';; esac
|
OSFLAGS != case $$(uname -s) in *BSD|Darwin) echo '-D_BSD_SOURCE';; Linux) echo '-D_GNU_SOURCE';; *) echo '-D_DEFAULT_SOURCE';; esac
|
||||||
EXTRA=
|
EXTRA=
|
||||||
G=-ggdb
|
G=-ggdb
|
||||||
|
Loading…
Reference in New Issue
Block a user