uvg266/src/Makefile

85 lines
1.7 KiB
Makefile
Raw Normal View History

# Simple Makefile for Kvazaar HEVC encoder
ifeq (, $(ARCH))
ARCH = $(shell uname -m)
endif
SYSTEM = $(shell uname -s)
ASMFLAGS =
2014-04-14 07:38:37 +00:00
DFLAGS = -O2 -g -Werror
# ARCH related flags
ifeq ($(ARCH), x86_64)
ASMFLAGS += -DARCH_X86_64=1
DFLAGS += -m64
LDFLAGS += -m64
else
ASMFLAGS += -DARCH_X86_64=0
DFLAGS += -m32
LDFLAGS += -m32
endif
# Windows (cygwin/mingw) specific flags
ifneq ( ,$(findstring Windows, $(OS)))
ifeq ($(ARCH), x86_64)
ASMFLAGS += -f win64
else
ASMFLAGS += -f win32
2014-02-21 12:53:47 +00:00
ASMFLAGS += -DPREFIX
endif
LDFLAGS += -lws2_32
# OS X specific flags
else ifeq ($(SYSTEM),Darwin)
ifeq ($(ARCH), x86_64)
ASMFLAGS += -f macho64
else
ASMFLAGS += -f macho32
endif
ASMFLAGS += -DPREFIX
# Default to Linux/elf specific flags
else
2014-02-21 12:53:47 +00:00
ifeq ($(ARCH), x86_64)
ASMFLAGS += -f elf64
else
ASMFLAGS += -f elf32
endif
endif
CC = gcc
2014-04-04 09:46:45 +00:00
CCFLAGS = $(DFLAGS) -I. -I/usr/local/include -L/usr/local/lib -Wall
LDFLAGS += -lm
LD = gcc
YASM = yasm
ASMOBJS = cpu.o
2014-04-16 07:40:42 +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 scalinglist.o search.o tables.o transform.o extras/getopt.o
PROG = ./kvazaar
PROGS = $(PROG)
DEPS = $(OBJS:.o=.d)
all: $(PROGS)
.PHONY: all clean
$(PROG): $(OBJS) $(ASMOBJS)
$(LD) $^ $(LDFLAGS) -o $@
cpu.o: x86/cpu.asm
$(YASM) $(ASMFLAGS) x86/cpu.asm -o cpu.o
2014-04-15 13:47:17 +00:00
%.o: %.c Makefile
$(CC) $(CCFLAGS) -c $< -o $@
2014-04-15 13:47:17 +00:00
%.d: %.c Makefile
$(CC) $(CCFLAGS) -MF"$@" -MG -MM -MP -MT"$@" -MT"$(<:.c=.o)" "$<"
2014-04-16 06:09:10 +00:00
generate_tables: tables.c global.h
$(CC) $(CCFLAGS) -DMAKE_GENERATE_TABLES=1 $< -o $@
tables_generated.h: generate_tables
./generate_tables > $@
clean:
rm -f $(OBJS) $(PROGS) $(ASMOBJS) $(DEPS)
-include $(DEPS)