2018-04-23 16:12:19 +02:00
|
|
|
CXX=g++
|
|
|
|
CXXLOCS?=-L. -I.
|
|
|
|
CXXFLAGS=$(CXXLOCS) -Wall -Wextra -std=c++14 -O2 -g
|
|
|
|
CXXLIBS=-lelf -ldwarf -ldwarfpp -lsrk31c++ -lc++fileno
|
|
|
|
|
|
|
|
TARGET=dwarf-assembly
|
2018-05-11 13:09:35 +02:00
|
|
|
OBJS=\
|
|
|
|
DwarfReader.o \
|
|
|
|
SimpleDwarf.o \
|
|
|
|
CodeGenerator.o \
|
|
|
|
PcListReader.o \
|
2018-06-20 14:12:42 +02:00
|
|
|
SimpleDwarfFilter.o \
|
|
|
|
PcHoleFiller.o \
|
2018-05-11 13:09:35 +02:00
|
|
|
settings.o \
|
|
|
|
main.o
|
2018-04-23 16:12:19 +02:00
|
|
|
|
|
|
|
###############################################################################
|
|
|
|
|
|
|
|
all: $(TARGET)
|
|
|
|
|
2018-04-25 18:11:59 +02:00
|
|
|
$(TARGET): gen_context_struct.hpp $(OBJS)
|
2018-04-23 16:12:19 +02:00
|
|
|
$(CXX) -o $@ $(CXXFLAGS) $^ $(CXXLIBS)
|
|
|
|
|
2018-04-25 18:11:59 +02:00
|
|
|
gen_context_struct.hpp: ../shared/context_struct.h
|
|
|
|
echo "static const char* CONTEXT_STRUCT_STR =" > $@
|
|
|
|
sed 's/"/\\"/g' $< | sed 's/^\(.*\)$$/"\1\\n"/g' >> $@
|
|
|
|
echo ";" >> $@
|
|
|
|
|
2018-04-23 16:12:19 +02:00
|
|
|
%.o: %.cpp
|
|
|
|
$(CXX) -o $@ $(CXXFLAGS) -c $<
|
|
|
|
|
|
|
|
|
|
|
|
.PHONY: clean
|
|
|
|
clean:
|
2018-04-25 18:11:59 +02:00
|
|
|
rm -f $(TARGET) *.o gen_*.hpp
|