diff --git a/poly2d/Makefile b/poly2d/Makefile index d3b90ea..11b0e59 100644 --- a/poly2d/Makefile +++ b/poly2d/Makefile @@ -34,22 +34,26 @@ CC_normal := $(CC) CXX_normal := $(CXX) AR_normal := $(AR) DEPEND_normal := $(CPP) $(CFLAGS) -MM -MG +DEPENDXX_normal := $(CPP) $(CXXFLAGS) -MM -MG CC_quiet = @echo " CC " $@ && $(CC_normal) CXX_quiet = @echo " CXX " $@ && $(CXX_normal) AR_quiet = @echo " AR " $@ && $(AR_normal) DEPEND_quiet = @$(DEPEND_normal) +DEPENDXX_quiet = @$(DEPENDXX_normal) ifeq ($(V),1) CC = $(CC_normal) CXX = $(CXX_normal) AR = $(AR_normal) DEPEND = $(DEPEND_normal) + DEPENDXX = $(DEPENDXX_normal) else CC = $(CC_quiet) CXX = $(CXX_quiet) AR = $(AR_quiet) DEPEND = $(DEPEND_quiet) + DEPENDXX = $(DEPENDXX_quiet) endif # ----- Rules ----------------------------------------------------------------- @@ -90,6 +94,14 @@ uninstall: -e '$${g;p;}' -e d >$*.d; \ [ "$${PIPESTATUS[*]}" = "0 0" ] || { rm -f $*.d; exit 1; } +%.o: %.cpp + $(CXX) -c $(CXXFLAGS) $*.cpp -o $*.o + $(DEPENDXX) $*.cpp | \ + sed -e \ + '/^\(.*:\)\? */{p;s///;s/ *\\\?$$/ /;s/ */:\n/g;H;}' \ + -e '$${g;p;}' -e d >$*.d; \ + [ "$${PIPESTATUS[*]}" = "0 0" ] || { rm -f $*.d; exit 1; } + -include $(OBJS:.o=.d) # ----- Tests ----------------------------------------------------------------- diff --git a/poly2d/README b/poly2d/README index 9b0418d..2ae56df 100644 --- a/poly2d/README +++ b/poly2d/README @@ -44,7 +44,6 @@ Other: - change the license from GPL to LGPL - transform CGAL's idea of outer polygons into something we can use - check for memory leaks -- try to generate dependencies also for *.cpp Prerequisite: libcgal-dev