2018-04-23 16:12:19 +02:00
|
|
|
CXX=g++
|
|
|
|
CXXLOCS?=-L. -I.
|
2018-06-25 16:32:52 +02:00
|
|
|
CXXFL?=
|
|
|
|
CXXFLAGS=$(CXXLOCS) -Wall -Wextra -std=c++14 -O2 -g $(CXXFL)
|
2018-04-23 16:12:19 +02:00
|
|
|
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-07-04 18:14:30 +02:00
|
|
|
EmptyFdeDeleter.o \
|
2018-06-22 08:57:36 +02:00
|
|
|
ConseqEquivFilter.o \
|
2018-06-25 11:33:36 +02:00
|
|
|
SwitchStatement.o \
|
|
|
|
NativeSwitchCompiler.o \
|
2018-06-25 16:32:52 +02:00
|
|
|
FactoredSwitchCompiler.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
|