From 61e017f6655c2b7e205e533c73228400ad4ac9e6 Mon Sep 17 00:00:00 2001 From: Avril Date: Fri, 13 Nov 2020 21:08:20 +0000 Subject: [PATCH] update makefile --- .gitignore | 2 +- Makefile | 12 ++++++++---- src/hex.cpp | 2 +- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index 60ab6f4..6eab03e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ *~ -build/ test* obj/ +hexview diff --git a/Makefile b/Makefile index f927adb..811ab2a 100644 --- a/Makefile +++ b/Makefile @@ -1,8 +1,12 @@ SRC=$(wildcard src/*.cpp) INCLUDE =include -CXXFLAGS = -Wall -pedantic --std=gnu++20 $(addprefix -I,$(INCLUDE)) -CXXFLAGS+= -flto -felide-constructors -fgraphite -O3 -LDFLAGS = -lfmt -O3 -flto +_HX_FEAT?= -DFIXED_ROW_SIZE=24 + +CXXFLAGS?= -pipe -O3 -march=native +CXXFLAGS+= -flto -felide-constructors -fgraphite +CXXFLAGS+= -Wall -pedantic --std=gnu++20 $(addprefix -I,$(INCLUDE)) +LDFLAGS?= -O3 -flto +LDFLAGS+= -lfmt PROJ = hexview @@ -15,7 +19,7 @@ dirs: @mkdir -p obj/src obj/%.o: %.cpp - $(CXX) -c $< $(CXXFLAGS) -o $@ $(LDFLAGS) + $(CXX) -c $< $(_HX_FEAT) $(CXXFLAGS) -o $@ $(LDFLAGS) $(PROJ): $(OBJ) $(CXX) $^ $(CXXFLAGS) -o $@ $(LDFLAGS) diff --git a/src/hex.cpp b/src/hex.cpp index 9a52363..7cdded2 100644 --- a/src/hex.cpp +++ b/src/hex.cpp @@ -25,7 +25,7 @@ const static constexpr char ascii_map[256] = { #endif #ifdef FIXED_ROW_SIZE -constexpr int ROW_SZ = FIXED_ROW_SIZE; +constexpr const int ROW_SZ = FIXED_ROW_SIZE; #endif namespace hv {