parent
bc8ea7b6b0
commit
68e59ae37d
@ -1,3 +1,4 @@
|
|||||||
*~
|
*~
|
||||||
build/
|
build/
|
||||||
test*
|
test*
|
||||||
|
obj/
|
||||||
|
@ -1,17 +1,26 @@
|
|||||||
SRC:=src/*.cpp
|
SRC=$(wildcard src/*.cpp)
|
||||||
INCLUDE:=include/
|
INCLUDE =include
|
||||||
BUILD:=build
|
CXXFLAGS = -Wall -pedantic --std=gnu++20 $(addprefix -I,$(INCLUDE))
|
||||||
FEATURES?=-DFIXED_ROW_SIZE=24
|
CXXFLAGS+= -flto -felide-constructors -fgraphite -O3
|
||||||
CXXFLAGS+= $(FEATURES) -Wall -pedantic -O3 -march=native --std=gnu++20 -fgraphite -flto
|
LDFLAGS = -lfmt -O3 -flto
|
||||||
LDFLAGS+=-O3 -flto -lfmt
|
|
||||||
bindir?=/usr/local/bin
|
|
||||||
|
|
||||||
hexview:
|
PROJ = hexview
|
||||||
g++ $(SRC) $(CXXFLAGS) -I$(INCLUDE) -o $(BUILD)/$@ $(LDFLAGS)
|
|
||||||
strip $(BUILD)/$@
|
|
||||||
|
|
||||||
clean:
|
OBJ = $(addprefix obj/,$(SRC:.cpp=.o))
|
||||||
rm -f $(BUILD)/*
|
|
||||||
|
.PHONY: all
|
||||||
|
all: dirs $(PROJ)
|
||||||
|
|
||||||
|
dirs:
|
||||||
|
@mkdir -p obj/src
|
||||||
|
|
||||||
install:
|
obj/%.o: %.cpp
|
||||||
cp -f $(BUILD)/hexview $(DESTDIR)$(bindir)/hexview
|
$(CXX) -c $< $(CXXFLAGS) -o $@ $(LDFLAGS)
|
||||||
|
|
||||||
|
$(PROJ): $(OBJ)
|
||||||
|
$(CXX) $^ $(CXXFLAGS) -o $@ $(LDFLAGS)
|
||||||
|
strip $@
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm -f $(PROJ)
|
||||||
|
rm -rf obj
|
||||||
|
Loading…
Reference in new issue