From a6ee894bcea2c0f196be82009b531ce5df776c1a Mon Sep 17 00:00:00 2001 From: nebula-bots <88429921+nebula-bots@users.noreply.github.com> Date: Fri, 10 Mar 2023 09:44:07 +0800 Subject: [PATCH] feat: optimized udf build (#2479) * fix udf build The indent character was wrong, now it's fixed and tested. * ignore .o files * feat: enable make with udf name as argument example: make UDF=standard_deviation Co-authored-by: Wey Gu --- udf/.gitignore | 1 + udf/Makefile | 15 +++++++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) create mode 100644 udf/.gitignore diff --git a/udf/.gitignore b/udf/.gitignore new file mode 100644 index 00000000000..5761abcfdf0 --- /dev/null +++ b/udf/.gitignore @@ -0,0 +1 @@ +*.o diff --git a/udf/Makefile b/udf/Makefile index 28e4babda87..f7ce8dd4726 100644 --- a/udf/Makefile +++ b/udf/Makefile @@ -16,10 +16,17 @@ endif CXX := g++ CXX_FLAGS := -c -I ../src/ -I $(3PP_PATH)/include/ -fPIC +UDF ?= standard_deviation + all: standard_deviation.cpp - $(CXX) $(CXX_FLAGS) standard_deviation.cpp -o standard_deviation.o - $(CXX) -shared -o standard_deviation.so standard_deviation.o + $(CXX) $(CXX_FLAGS) $(UDF).cpp -o $(UDF).o + $(CXX) -shared -o $(UDF).so $(UDF).o clean: - rm ./*.o - rm ./*.so + rm ./*.o + rm ./*.so + +.PHONY: help +help: + @echo "Usage: make UDF=" + @echo "Example: make UDF=standard_deviation"