
CXXFLAGS = -g -MMD -Wall -O3 -ffast-math $(GCCFLAGS)
LDFLAGS = -g $(GCCLDFLAGS)

TARGETS = munge-trees
SOURCES = munge-trees.cc
OBJECTS = $(patsubst %.l,%.o,$(patsubst %.c,%.o,$(SOURCES:%.cc=%.o)))

%: %.cc

%: %.o
	$(CXX) $(LDFLAGS) $^ -o $@

# top is what Makefile builds if it isn't given any targets

top: $(TARGETS)

.PHONY: 
clean: 
	rm -fr *.o *.d *~ core

.PHONY: real-clean
real-clean: clean 
	rm -fr $(TARGETS) anaphora.out anaphora-maxent.out

# this command tells GNU make to look for dependencies in *.d files
-include $(patsubst %.cpp,%.d,$(patsubst %.c,%.d,$(SOURCES:%.cc=%.d)))
