Skip to content

Commit

Permalink
feat: optimized udf build (vesoft-inc#2479)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>
  • Loading branch information
nebula-bots and wey-gu authored Mar 10, 2023
1 parent 2efbd58 commit a6ee894
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
1 change: 1 addition & 0 deletions udf/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.o
15 changes: 11 additions & 4 deletions udf/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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=<udf_name>"
@echo "Example: make UDF=standard_deviation"

0 comments on commit a6ee894

Please sign in to comment.