# drawing (DXF) to gcode (NGC) converter # Copyright 2013 Stefan Schuermans # Copyleft: GNU public license - http://www.gnu.org/copyleft/gpl.html TARGET=dxfngc SRCS=$(wildcard src/*.cpp) CFLAGS=-Wall -Wextra -Werror -O2 -g -frounding-math DEFINES= INCLUDES= LDFLAGS= LIBS=-lCGAL -lCGAL_Core -ldime -lboost_thread -lgmp -lmpfr -lm CPP=g++ CPPARGS=$(CFLAGS) $(DEFINES) $(INCLUDES) SRCS_BASE=$(patsubst src/%.cpp,%,$(SRCS)) DEPS=$(addprefix dep/,$(addsuffix .d,$(SRCS_BASE))) OBJS=$(addprefix obj/,$(addsuffix .o,$(SRCS_BASE))) .PHONY: all clean .SECONDARY: .SUFFIXES: all: dep/deps $(TARGET) ifneq ($(MAKECMDGOALS),clean) include dep/deps endif dep: mkdir -p $@ dep/deps: $(DEPS) | dep cat /dev/null $^ >$@ dep/%.d: src/%.cpp Makefile | dep $(CPP) $(CPPARGS) -M -MT$(patsubst src/%.cpp,obj/%.o,$<) -o $@ $< obj: mkdir -p $@ obj/%.o: src/%.cpp Makefile | obj $(CPP) $(CPPARGS) -c -o $@ $< $(TARGET): $(OBJS) $(CPP) $(LDFLAGS) -o $@ $^ $(LIBS) clean: rm -rf dep obj $(TARGET)