dwarf-assembly/src/Makefile

28 lines
677 B
Makefile
Raw Normal View History

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
OBJS=DwarfReader.o SimpleDwarf.o CodeGenerator.o settings.o main.o
2018-04-23 16:12:19 +02:00
###############################################################################
all: $(TARGET)
$(TARGET): gen_context_struct.hpp $(OBJS)
2018-04-23 16:12:19 +02:00
$(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 ";" >> $@
2018-04-23 16:12:19 +02:00
%.o: %.cpp
$(CXX) -o $@ $(CXXFLAGS) -c $<
.PHONY: clean
clean:
rm -f $(TARGET) *.o gen_*.hpp