Skip to content

Commit 8681303

Browse files
NJrslvtuhaihe
authored andcommitted
[gp_stats_collector] Simplify Makefile and add -Wno-unused-but-set-variable
1 parent ff6e14a commit 8681303

1 file changed

Lines changed: 7 additions & 11 deletions

File tree

gpcontrib/gp_stats_collector/Makefile

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,8 @@ C_OBJS = $(patsubst %.c,%.o,$(wildcard src/*.c src/*/*.c))
1010
CPP_OBJS = $(patsubst %.cpp,%.o,$(wildcard src/*.cpp src/*/*.cpp))
1111
OBJS = $(C_OBJS) $(CPP_OBJS) $(PROTO_OBJS)
1212

13-
override CXXFLAGS = -Werror -fPIC -g3 -Wall -Wpointer-arith -Wendif-labels \
14-
-Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv \
15-
-Wno-unused-but-set-variable -Wno-address -Wno-format-truncation \
16-
-Wno-stringop-truncation -g -ggdb -std=c++17 -Iinclude -Isrc/protos -Isrc -DGPBUILD
17-
18-
PG_CXXFLAGS += -Isrc -Iinclude
19-
SHLIB_LINK += -lprotobuf -lpthread -lstdc++
13+
PG_CXXFLAGS += -Werror -Wall -Wno-unused-but-set-variable -std=c++17 -Isrc/protos -Isrc -Iinclude -DGPBUILD
14+
SHLIB_LINK += -lprotobuf -lstdc++
2015
EXTRA_CLEAN = src/protos
2116

2217
ifdef USE_PGXS
@@ -30,10 +25,11 @@ include $(top_builddir)/src/Makefile.global
3025
include $(top_srcdir)/contrib/contrib-global.mk
3126
endif
3227

33-
src/protos/%.pb.cpp src/protos/%.pb.h: protos/%.proto
28+
src/protos/.done: $(wildcard protos/*.proto)
3429
@mkdir -p src/protos
3530
protoc -I /usr/include -I /usr/local/include -I . --cpp_out=src $^
36-
mv src/protos/$*.pb.cc src/protos/$*.pb.cpp
31+
for f in src/protos/*.pb.cc; do mv "$$f" "$${f%.cc}.cpp"; done
32+
touch $@
3733

38-
$(CPP_OBJS): src/protos/gpsc_metrics.pb.h src/protos/gpsc_plan.pb.h src/protos/gpsc_set_service.pb.h
39-
src/protos/gpsc_set_service.pb.o: src/protos/gpsc_metrics.pb.h
34+
src/protos/%.pb.cpp src/protos/%.pb.h: src/protos/.done ;
35+
$(CPP_OBJS): src/protos/.done

0 commit comments

Comments
 (0)