2014-01-27 12:33:19 +00:00
|
|
|
# Simple Makefile for Kvazaar HEVC encoder
|
|
|
|
|
2014-02-03 12:27:19 +00:00
|
|
|
ifeq (, $(ARCH))
|
2014-02-03 13:53:21 +00:00
|
|
|
ARCH = $(shell uname -m)
|
2014-02-03 12:27:19 +00:00
|
|
|
endif
|
2014-01-30 15:56:52 +00:00
|
|
|
SYSTEM = $(shell uname -s)
|
|
|
|
ASMFLAGS =
|
2014-02-03 12:27:19 +00:00
|
|
|
DFLAGS = -O2 -g
|
2014-01-27 12:33:19 +00:00
|
|
|
|
2014-01-30 15:56:52 +00:00
|
|
|
# ARCH related flags
|
|
|
|
ifeq ($(ARCH), x86_64)
|
|
|
|
ASMFLAGS += -DARCH_X86_64=1
|
2014-02-03 12:27:19 +00:00
|
|
|
DFLAGS += -m64
|
2014-02-03 13:53:21 +00:00
|
|
|
LDFLAGS += -m64
|
2014-01-27 12:33:19 +00:00
|
|
|
else
|
2014-01-30 15:56:52 +00:00
|
|
|
ASMFLAGS += -DARCH_X86_64=0
|
2014-02-03 12:27:19 +00:00
|
|
|
DFLAGS += -m32
|
2014-02-03 13:53:21 +00:00
|
|
|
LDFLAGS += -m32
|
2014-01-27 12:33:19 +00:00
|
|
|
endif
|
|
|
|
|
2014-02-03 12:27:19 +00:00
|
|
|
# Windows (cygwin/mingw) specific flags
|
|
|
|
ifneq ( ,$(findstring Windows, $(OS)))
|
|
|
|
ifeq ($(ARCH), x86_64)
|
|
|
|
ASMFLAGS += -f win64
|
2014-01-30 15:56:52 +00:00
|
|
|
else
|
2014-02-03 12:27:19 +00:00
|
|
|
ASMFLAGS += -f win32
|
2014-02-21 12:53:47 +00:00
|
|
|
ASMFLAGS += -DPREFIX
|
2014-01-30 15:56:52 +00:00
|
|
|
endif
|
2014-02-03 12:27:19 +00:00
|
|
|
LDFLAGS += -lws2_32
|
2014-01-30 15:56:52 +00:00
|
|
|
# OS X specific flags
|
2014-02-03 12:27:19 +00:00
|
|
|
else ifeq ($(SYSTEM),Darwin)
|
2014-01-30 15:56:52 +00:00
|
|
|
ifeq ($(ARCH), x86_64)
|
2014-02-03 12:27:19 +00:00
|
|
|
ASMFLAGS += -f macho64
|
2014-01-30 15:56:52 +00:00
|
|
|
else
|
2014-02-03 12:27:19 +00:00
|
|
|
ASMFLAGS += -f macho32
|
2014-01-30 15:56:52 +00:00
|
|
|
endif
|
|
|
|
ASMFLAGS += -DPREFIX
|
2014-02-03 12:27:19 +00:00
|
|
|
# Default to Linux/elf specific flags
|
|
|
|
else
|
2014-02-21 12:53:47 +00:00
|
|
|
ifeq ($(ARCH), x86_64)
|
2014-02-03 12:27:19 +00:00
|
|
|
ASMFLAGS += -f elf64
|
|
|
|
else
|
|
|
|
ASMFLAGS += -f elf32
|
|
|
|
endif
|
2014-01-27 12:33:19 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
CC = gcc
|
2014-02-21 12:53:47 +00:00
|
|
|
CCFLAGS = $(DFLAGS) -I. -I/usr/local/include -L/usr/local/lib -Wdeclaration-after-statement -Wall -Wdisabled-optimization -Wpointer-arith -Wredundant-decls -Wcast-qual -Wwrite-strings -Wtype-limits -Wundef -Wmissing-prototypes -Wstrict-prototypes -Wno-parentheses -Wno-switch -Wno-format-zero-length -Wno-pointer-sign -O3 -fno-math-errno -fno-signed-zeros -fno-tree-vectorize -Werror=implicit-function-declaration -Werror=missing-prototypes -Werror=return-type -Werror=declaration-after-statement -Werror=vla -Wno-maybe-uninitialized
|
2014-02-03 12:27:19 +00:00
|
|
|
LDFLAGS += -lm
|
2014-01-27 12:33:19 +00:00
|
|
|
LD = gcc
|
|
|
|
YASM = yasm
|
2014-01-30 15:56:52 +00:00
|
|
|
ASMOBJS = cpu.o
|
2014-02-10 14:45:08 +00:00
|
|
|
OBJS = interface_main.o encmain.o bitstream.o cabac.o config.o context.o encoder.o filter.o inter.o intra.o nal.o picture.o rdo.o sao.o search.o transform.o extras/getopt.o
|
2014-01-27 12:33:19 +00:00
|
|
|
PROG = ./kvazaar
|
|
|
|
PROGS = $(PROG)
|
|
|
|
|
2014-02-03 12:27:19 +00:00
|
|
|
all: $(PROGS)
|
|
|
|
.PHONY: all clean
|
2014-01-30 15:56:52 +00:00
|
|
|
|
2014-01-27 12:33:19 +00:00
|
|
|
$(PROG): $(OBJS) $(ASMOBJS)
|
2014-01-29 15:34:31 +00:00
|
|
|
$(LD) $^ $(LDFLAGS) -o $@
|
2014-01-27 12:33:19 +00:00
|
|
|
|
2014-01-30 15:56:52 +00:00
|
|
|
cpu.o: x86/cpu.asm
|
|
|
|
$(YASM) $(ASMFLAGS) x86/cpu.asm -o cpu.o
|
2014-01-27 12:33:19 +00:00
|
|
|
|
|
|
|
%.o: %.c
|
|
|
|
$(CC) $(CCFLAGS) -c $< -o $@
|
|
|
|
|
2014-02-03 12:27:19 +00:00
|
|
|
clean:
|
|
|
|
rm -f $(OBJS) $(PROGS) $(ASMOBJS)
|