25 lines
623 B
Makefile
25 lines
623 B
Makefile
# compiler, tools
|
|
CC = clang
|
|
PKG_CONFIG ?= pkg-config
|
|
|
|
# flags
|
|
CFLAGS ?= -march=native -O2 -pipe
|
|
CFLAGS += -std=c99 -pedantic -Wall -Wextra -Werror -Wno-unused-variable -Wno-unused-parameter -Wno-unused-function
|
|
ifeq ($(shell $(CC) -v 2>&1 | grep 'gcc version' &>/dev/null && echo 1),1)
|
|
CFLAGS += -Wno-unused-but-set-variable
|
|
endif
|
|
LDFLAGS ?= -Wl,-O1 -Wl,--as-needed -Wl,--hash-style=gnu
|
|
|
|
ifndef NODEBUG
|
|
CFLAGS += -O0 -g3
|
|
endif
|
|
|
|
# install variables
|
|
INSTALL = install
|
|
INSTALL_BIN = install -m755
|
|
INSTALL_DIR = install -d
|
|
PREFIX = /usr/local
|
|
LIBDIR = lib64
|
|
INSTALL_BINDIR = $(PREFIX)/bin
|
|
INSTALL_LIBDIR = $(PREFIX)/$(LIBDIR)
|