From f5c2292e06a25f9e85511e1377b4f8df6ee84db3 Mon Sep 17 00:00:00 2001 From: Marko Viitanen Date: Mon, 27 Jan 2014 14:33:19 +0200 Subject: [PATCH] Added simple Makefile and header files needed to compile on linux --- src/Makefile | 47 +++++++++++++++++++++++++++++++++++++++++++++++ src/global.h | 2 ++ 2 files changed, 49 insertions(+) create mode 100644 src/Makefile diff --git a/src/Makefile b/src/Makefile new file mode 100644 index 00000000..eb4489a8 --- /dev/null +++ b/src/Makefile @@ -0,0 +1,47 @@ +# Simple Makefile for Kvazaar HEVC encoder + + +BITS = $(shell getconf LONG_BIT) + +# Detect 32/64bit system +ifeq ($(BITS), 64) + ASMOBJS = test64.o +else + ASMOBJS = test.o +endif + + +DFLAGS = +ifeq ($(SYSTEM),Darwin) +DFLAGS += -D__APPLE__ +endif +ifeq ($(SYSTEM),FreeBSD) +DFLAGS += -D__FREEBSD__ +endif +ifeq ($(SYSTEM),SunOS) +DFLAGS += -D__SOLARIS__ +endif + +CC = gcc +CCFLAGS = $(DFLAGS) -I. -I/usr/local/include -L/usr/local/lib +LDFLAGS = -lm +LD = gcc +YASM = yasm +ASMOBJS = test64.o +OBJS = interface_main.o encmain.o bitstream.o cabac.o config.o context.o debug.o encoder.o filter.o inter.o intra.o nal.o picture.o sao.o search.o transform.o +PROG = ./kvazaar +PROGS = $(PROG) + +$(PROG): $(OBJS) $(ASMOBJS) + $(LD) $(LDFLAGS) $^ -o $@ + +test.o: x86/test.asm + $(YASM) -f elf x86/test.asm -o test.o + +test64.o: x64/test64.asm + $(YASM) -f elf64 x64/test64.asm -o test.o + +%.o: %.c + $(CC) $(CCFLAGS) -c $< -o $@ + +all: $(PROGS) diff --git a/src/global.h b/src/global.h index d62a80c7..0d174daa 100644 --- a/src/global.h +++ b/src/global.h @@ -32,6 +32,8 @@ #include "../include/stdint.h" #else #include + #include + #include #endif #if _MSC_VER && _M_AMD64