From 116827efdf9ba534e4c16bdebfbfc594b9bb255f Mon Sep 17 00:00:00 2001 From: sekrit-twc Date: Wed, 8 Nov 2017 14:13:05 -0800 Subject: [PATCH] Add Makefile. --- .gitignore | 5 +++++ Makefile | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 Makefile diff --git a/.gitignore b/.gitignore index 414f7f3..bb9b985 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,8 @@ +*.a +*.o +*.so +benchmarkapp + *.opendb *.db .vs diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..71aa48b --- /dev/null +++ b/Makefile @@ -0,0 +1,46 @@ +MY_CFLAGS := -O2 -fPIC $(CFLAGS) +MY_CXXFLAGS := -std=c++11 -O2 -fPIC $(CXXFLAGS) +MY_CPPFLAGS := -Itimecube -Ivsxx $(CPPFLAGS) +MY_LDFLAGS := $(LDFLAGS) +MY_LIBS := $(LIBS) + +timecube_HDRS = \ + timecube/cube.h \ + timecube/lut.h \ + timecube/lut_x86.h + +timecube_OBJS = \ + timecube/cube.o \ + timecube/lut.o \ + timecube/lut_avx2.o \ + timecube/lut_sse41.o \ + timecube/lut_x86.o + +vsxx_HDRS = \ + vsxx/VapourSynth.h \ + vsxx/VapourSynth++.hpp \ + vsxx/VSHelper.h \ + vsxx/VSScript.h \ + vsxx/vsxx_pluginmain.h + +ifeq ($(X86), 1) + timecube/lut_avx2.o: EXTRA_CXXFLAGS := -mf16c -mavx2 -mfma + timecube/lut_sse41.o: EXTRA_CXXFLAGS := -msse4.1 + MY_CPPFLAGS := -DCUBE_X86 $(MY_CPPFLAGS) +endif + +all: vscube.so + +benchmark/benchmark: benchmark/main.o $(timecube_OBJS) + $(CXX) $(MY_LDFLAGS) $^ $(MY_LIBS) -o $@ + +vscube.so: vscube/vscube.o vsxx/vsxx_pluginmain.o $(timecube_OBJS) + $(CXX) -shared $(MY_LDFLAGS) $^ $(MY_LIBS) -o $@ + +clean: + rm -f *.a *.o *.so benchmark/benchmark benchmark/*.o timecube/*.o vscube/*.o vsxx/*.o + +%.o: %.cpp $(timecube_HDRS) $(vsxx_HDRS) + $(CXX) -c $(EXTRA_CXXFLAGS) $(MY_CXXFLAGS) $(MY_CPPFLAGS) $< -o $@ + +.PHONY: clean