diff --git a/src/dhcp6relay/Makefile b/src/dhcp6relay/Makefile index 4cbeb37fd188..4d2eedd042ec 100644 --- a/src/dhcp6relay/Makefile +++ b/src/dhcp6relay/Makefile @@ -4,8 +4,8 @@ CP := cp MKDIR := mkdir CC := g++ MV := mv -LIBS := -levent -lhiredis -lswsscommon -pthread -lboost_thread -lboost_system -I $(PWD)/../sonic-swss-common/common -CFLAGS = -g -Wall -std=gnu11 +LIBS := -levent -lhiredis -lswsscommon -pthread -lboost_thread -lboost_system +CFLAGS = -g -Wall -std=c++17 -fPIC -I $(PWD)/../sonic-swss-common/common PWD := $(shell pwd) ifneq ($(MAKECMDGOALS),clean) diff --git a/src/dhcp6relay/src/subdir.mk b/src/dhcp6relay/src/subdir.mk index af378319d78f..1c93d490ec63 100644 --- a/src/dhcp6relay/src/subdir.mk +++ b/src/dhcp6relay/src/subdir.mk @@ -18,6 +18,6 @@ C_DEPS += \ src/%.o: src/%.cpp @echo 'Building file: $<' @echo 'Invoking: GCC C++ Compiler' - $(CC) -std=c++17 -D__FILENAME__="$(subst src/,,$<)" $(LIBS) -Wall -c -fmessage-length=0 -fPIC -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<" + $(CC) -D__FILENAME__="$(subst src/,,$<)" $(CFLAGS) -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<" @echo 'Finished building: $<' @echo ' '