Show More
Commit Description:
Tweak calculations....
Commit Description:
Tweak calculations.
Prevent a negative number of visitors and separate visitors from donors.
References:
File last commit:
Show/Diff file:
Action:
FNA/lib/Theorafile/Makefile
130 lines | 3.4 KiB | text/x-makefile | MakefileLexer
130 lines | 3.4 KiB | text/x-makefile | MakefileLexer
r0 | # Makefile for Theorafile | |||
# Written by Ethan "flibitijibibo" Lee | ||||
# Detect cross targets | ||||
r690 | TRIPLET=$(shell $(CC) -dumpmachine) | |||
r0 | WINDOWS_TARGET=0 | |||
APPLE_TARGET=0 | ||||
ifeq ($(OS), Windows_NT) # cygwin/msys2 | ||||
WINDOWS_TARGET=1 | ||||
endif | ||||
r690 | ifneq (,$(findstring w64-mingw32,$(TRIPLET))) | |||
WINDOWS_TARGET=1 | ||||
endif | ||||
ifneq (,$(findstring w64-windows,$(TRIPLET))) | ||||
r0 | WINDOWS_TARGET=1 | |||
endif | ||||
r690 | ifneq (,$(findstring apple-darwin,$(TRIPLET))) | |||
r0 | APPLE_TARGET=1 | |||
endif | ||||
r690 | ifneq (,$(findstring x86_64,$(TRIPLET))) | |||
DEFINES += -DOC_X86_ASM -DOC_X86_64_ASM | ||||
TFSRC_ARCH_OPT = $(TFSRC_ARCH_X86) | ||||
endif | ||||
ifneq (,$(findstring i686,$(TRIPLET))) | ||||
DEFINES += -DOC_X86_ASM | ||||
TFSRC_ARCH_OPT = $(TFSRC_ARCH_X86) | ||||
endif | ||||
# this requires the compiler to support the ARM Neon, Media, and EDSP extensions | ||||
ifneq (,$(findstring armv7,$(TRIPLET))) | ||||
DEFINES += -DOC_ARM_ASM -DOC_ARM_ASM_EDSP -DOC_ARM_ASM_MEDIA -DOC_ARM_ASM_NEON | ||||
TFSRC_ARCH_OPT = $(TFSRC_ARCH_AARCH32) | ||||
r0 | endif | |||
# Compiler | ||||
ifeq ($(WINDOWS_TARGET),1) | ||||
TARGET = dll | ||||
LDFLAGS += -static-libgcc | ||||
else ifeq ($(APPLE_TARGET),1) | ||||
CC += -mmacosx-version-min=10.9 | ||||
TARGET = dylib | ||||
CFLAGS += -fpic -fPIC | ||||
LDFLAGS += -install_name @rpath/libtheorafile.dylib | ||||
else | ||||
TARGET = so | ||||
CFLAGS += -fpic -fPIC | ||||
endif | ||||
r690 | LIB = libtheorafile.$(TARGET) | |||
r0 | ||||
r690 | CFLAGS += -O3 | |||
r0 | ||||
SRCDIR = $(dir $(MAKEFILE_LIST)) | ||||
vpath %.c $(SRCDIR) | ||||
# Includes | ||||
INCLUDES = -I$(SRCDIR) -I$(SRCDIR)/lib -I$(SRCDIR)/lib/ogg -I$(SRCDIR)/lib/vorbis -I$(SRCDIR)/lib/theora | ||||
# Source | ||||
r690 | TFSRC = $(TFSRC_ARCH_GENERIC) $(TFSRC_ARCH_OPT) | |||
TFSRC_ARCH_GENERIC = \ | ||||
r0 | theorafile.c \ | |||
lib/ogg/bitwise.c \ | ||||
lib/ogg/framing.c \ | ||||
lib/vorbis/analysis.c \ | ||||
lib/vorbis/bitrate.c \ | ||||
lib/vorbis/block.c \ | ||||
lib/vorbis/codebook.c \ | ||||
lib/vorbis/envelope.c \ | ||||
lib/vorbis/floor0.c \ | ||||
lib/vorbis/floor1.c \ | ||||
lib/vorbis/vinfo.c \ | ||||
lib/vorbis/lookup.c \ | ||||
lib/vorbis/lpc.c \ | ||||
lib/vorbis/lsp.c \ | ||||
lib/vorbis/mapping0.c \ | ||||
lib/vorbis/mdct.c \ | ||||
lib/vorbis/psy.c \ | ||||
lib/vorbis/registry.c \ | ||||
lib/vorbis/res0.c \ | ||||
lib/vorbis/sharedbook.c \ | ||||
lib/vorbis/smallft.c \ | ||||
lib/vorbis/synthesis.c \ | ||||
lib/vorbis/window.c \ | ||||
lib/theora/apiwrapper.c \ | ||||
lib/theora/bitpack.c \ | ||||
lib/theora/decapiwrapper.c \ | ||||
lib/theora/decinfo.c \ | ||||
lib/theora/decode.c \ | ||||
lib/theora/dequant.c \ | ||||
lib/theora/fragment.c \ | ||||
lib/theora/huffdec.c \ | ||||
lib/theora/idct.c \ | ||||
lib/theora/tinfo.c \ | ||||
lib/theora/internal.c \ | ||||
lib/theora/quant.c \ | ||||
r690 | lib/theora/state.c | |||
TFSRC_ARCH_X86 = \ | ||||
r0 | lib/theora/x86/mmxfrag.c \ | |||
lib/theora/x86/mmxidct.c \ | ||||
lib/theora/x86/mmxstate.c \ | ||||
r690 | lib/theora/x86/sse2idct.c \ | |||
lib/theora/x86/x86cpu.c \ | ||||
r0 | lib/theora/x86/x86state.c | |||
r690 | AARCH32_ASSEMBLY_NAMES = bits frag idct loop | |||
AARCH32_ASSEMBLY_GNU_SOURCES = $(foreach name,$(AARCH32_ASSEMBLY_NAMES) opts,lib/theora/arm/arm$(name)-gnu.S) | ||||
AARCH32_ASSEMBLY_OBJS = $(foreach name,$(AARCH32_ASSEMBLY_NAMES),lib/theora/arm/arm$(name).o) | ||||
TFSRC_ARCH_AARCH32 = \ | ||||
lib/theora/arm/armstate.c \ | ||||
lib/theora/arm/armcpu.c \ | ||||
$(AARCH32_ASSEMBLY_OBJS) | ||||
r0 | ||||
# Targets | ||||
r690 | .PHONY: lib all clean test | |||
lib: $(LIB) | ||||
all: $(LIB) theorafile-test | ||||
r0 | clean: | |||
r690 | rm -f $(LIB) theorafile-test $(AARCH32_ASSEMBLY_OBJS) $(AARCH32_ASSEMBLY_GNU_SOURCES) | |||
test: theorafile-test | ||||
$(LIB): $(TFSRC) | ||||
$(CC) $(CFLAGS) -shared -o $@ $^ $(INCLUDES) $(DEFINES) -lm $(LDFLAGS) | ||||
theorafile-test: $(TFSRC) | ||||
$(CC) $(CFLAGS) -g -o $@ sdl2test/sdl2test.c $(TFSRC) $(INCLUDES) $(DEFINES) `sdl2-config --cflags --libs` -lm | ||||
lib/theora/arm/armfrag.o: lib/theora/arm/armopts-gnu.S | ||||
.INTERMEDIATE: lib/theora/arm/armopts-gnu.S | ||||
.SUFFIXES: | ||||
%-gnu.S: %.s | ||||
lib/theora/arm/arm2gnu.pl < $< > $@ | ||||
%.o: %-gnu.S | ||||
$(CC) -c -o $@ -Ilib/theora/arm $< | ||||