update makefile

master v1.0.0
Avril 4 years ago
parent bc8ea7b6b0
commit 68e59ae37d
Signed by: flanchan
GPG Key ID: 284488987C31F630

1
.gitignore vendored

@ -1,3 +1,4 @@
*~
build/
test*
obj/

@ -1,17 +1,26 @@
SRC:=src/*.cpp
INCLUDE:=include/
BUILD:=build
FEATURES?=-DFIXED_ROW_SIZE=24
CXXFLAGS+= $(FEATURES) -Wall -pedantic -O3 -march=native --std=gnu++20 -fgraphite -flto
LDFLAGS+=-O3 -flto -lfmt
bindir?=/usr/local/bin
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
hexview:
g++ $(SRC) $(CXXFLAGS) -I$(INCLUDE) -o $(BUILD)/$@ $(LDFLAGS)
strip $(BUILD)/$@
PROJ = hexview
clean:
rm -f $(BUILD)/*
OBJ = $(addprefix obj/,$(SRC:.cpp=.o))
.PHONY: all
all: dirs $(PROJ)
dirs:
@mkdir -p obj/src
install:
cp -f $(BUILD)/hexview $(DESTDIR)$(bindir)/hexview
obj/%.o: %.cpp
$(CXX) -c $< $(CXXFLAGS) -o $@ $(LDFLAGS)
$(PROJ): $(OBJ)
$(CXX) $^ $(CXXFLAGS) -o $@ $(LDFLAGS)
strip $@
clean:
rm -f $(PROJ)
rm -rf obj

Loading…
Cancel
Save