parent
bc8ea7b6b0
commit
68e59ae37d
@ -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…
Reference in new issue