zuul-preview/Makefile
Monty Taylor 0a58af807b Bump to c++17 and switch boost::optional to std::optional
We have access to c++17, so use it. As a result, replace
boost::optional with std::optional.

Change-Id: Iba59bfd516264e817f2da14ded47d4d63a37e399
2020-07-15 12:03:25 -05:00

33 lines
1.0 KiB
Makefile

BUILDTYPE ?= Release
PREFIX := /usr/local
LDFLAGS := -lssl -lcrypto -lboost_system -lcpprest -pthread
WARNING_FLAGS := -pedantic -Werror -Wall -Wextra -Weffc++ -Wundef -Wshadow -Wstrict-aliasing -Wswitch-enum -Wformat=2 -Wattributes -Woverloaded-virtual -Wnon-virtual-dtor -Wctor-dtor-privacy -Wold-style-cast -Wconversion -Wframe-larger-than=32768 -Wredundant-decls
COMMON_FLAGS := -g -pthread -std=gnu++17 -fdiagnostics-show-option -fdiagnostics-generate-patch
RELEASE_FLAGS := -O2 -DNDEBUG
DEBUG_FLAGS := -O0 -DDEBUG -fno-inline-functions -fno-omit-frame-pointer
ifeq ($(BUILDTYPE),Release)
CXXFLAGS := $(CXXFLAGS) $(COMMON_FLAGS) $(WARNING_FLAGS) $(RELEASE_FLAGS)
else
CXXFLAGS := $(CXXFLAGS) $(COMMON_FLAGS) $(WARNING_FLAGS) $(DEBUG_FLAGS)
endif
all: zuul-preview
install: zuul-preview
mkdir -p $(PREFIX)/bin
cp zuul-preview $(PREFIX)/bin/zuul-preview
uninstall:
rm $(PREFIX)/bin/zuul-preview
zuul-preview: main.o
g++ -o $@ $^ $(LDFLAGS)
%.o: %.cc
g++ $(CXXFLAGS) -c -o $@ $<
clean:
rm -f ./zuul-preview *.o