dwarf-assembly/src/Makefile
Théophile Bastian 353a97c49d Refactor code generation: use shared/context_struct.h
This allows #include'ing `context_struct.h` in the stack walker
implementation as well
2018-04-25 18:11:59 +02:00

28 lines
666 B
Makefile

CXX=g++
CXXLOCS?=-L. -I.
CXXFLAGS=$(CXXLOCS) -Wall -Wextra -std=c++14 -O2 -g
CXXLIBS=-lelf -ldwarf -ldwarfpp -lsrk31c++ -lc++fileno
TARGET=dwarf-assembly
OBJS=DwarfReader.o SimpleDwarf.o CodeGenerator.o main.o
###############################################################################
all: $(TARGET)
$(TARGET): gen_context_struct.hpp $(OBJS)
$(CXX) -o $@ $(CXXFLAGS) $^ $(CXXLIBS)
gen_context_struct.hpp: ../shared/context_struct.h
echo "static const char* CONTEXT_STRUCT_STR =" > $@
sed 's/"/\\"/g' $< | sed 's/^\(.*\)$$/"\1\\n"/g' >> $@
echo ";" >> $@
%.o: %.cpp
$(CXX) -o $@ $(CXXFLAGS) -c $<
.PHONY: clean
clean:
rm -f $(TARGET) *.o gen_*.hpp