mirror of
https://github.com/ultravideo/uvg266.git
synced 2024-11-24 02:24:07 +00:00
Enabled link time optimizations. Disabled default rules.
This commit is contained in:
parent
041d970ece
commit
ff456c120a
18
src/Makefile
18
src/Makefile
|
@ -1,5 +1,8 @@
|
||||||
# Simple Makefile for Kvazaar HEVC encoder
|
# Simple Makefile for Kvazaar HEVC encoder
|
||||||
|
|
||||||
|
#Disable default rules
|
||||||
|
.SUFFIXES:
|
||||||
|
|
||||||
ifeq (, $(ARCH))
|
ifeq (, $(ARCH))
|
||||||
ARCH = $(shell uname -m)
|
ARCH = $(shell uname -m)
|
||||||
endif
|
endif
|
||||||
|
@ -63,8 +66,11 @@ WARNINGS = -Wall -Wtype-limits -Wvla
|
||||||
|
|
||||||
INCLUDEDIRS = -I. -I./strategies -I./extras -I..
|
INCLUDEDIRS = -I. -I./strategies -I./extras -I..
|
||||||
|
|
||||||
ifndef CC
|
#Detect if cc is gcc for the link time optimization flag
|
||||||
CC = gcc
|
GCCVERSION = $(shell $(CC) --version | grep GCC)
|
||||||
|
ifneq (, $(GCCVERSION))
|
||||||
|
CFLAGS += -flto
|
||||||
|
LDFLAGS += -flto -O3
|
||||||
endif
|
endif
|
||||||
CFLAGS += -std=gnu99 $(INCLUDEDIRS) $(WARNINGS)
|
CFLAGS += -std=gnu99 $(INCLUDEDIRS) $(WARNINGS)
|
||||||
LDFLAGS += -lm -pthread
|
LDFLAGS += -lm -pthread
|
||||||
|
@ -162,13 +168,13 @@ $(GREATEST):
|
||||||
# Compile files in strategy directories with appropriate flags.
|
# Compile files in strategy directories with appropriate flags.
|
||||||
EXTRA_FLAGS =
|
EXTRA_FLAGS =
|
||||||
ifeq ($(ARCH), ppc64)
|
ifeq ($(ARCH), ppc64)
|
||||||
strategies/altivec/%.o: EXTRA_FLAGS += -maltivec
|
strategies/altivec/%.o: EXTRA_FLAGS += -maltivec -fno-lto
|
||||||
else
|
else
|
||||||
strategies/sse2/%.o: EXTRA_FLAGS += -msse2
|
strategies/sse2/%.o: EXTRA_FLAGS += -msse2 -fno-lto
|
||||||
strategies/sse41/%.o: EXTRA_FLAGS += -msse4.1
|
strategies/sse41/%.o: EXTRA_FLAGS += -msse4.1 -fno-lto
|
||||||
#Needs to be defined on Travis
|
#Needs to be defined on Travis
|
||||||
ifndef KVZ_DISABLE_AVX2
|
ifndef KVZ_DISABLE_AVX2
|
||||||
strategies/avx2/%.o: EXTRA_FLAGS += -mavx2
|
strategies/avx2/%.o: EXTRA_FLAGS += -mavx2 -fno-lto
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue