
all: mesh_factory.o subs

PWD = $(shell pwd)

%.d: %.cc
	$(SHELL) -ec "$(CXX) -MM $(CPPFLAGS) $(CXXFLAGS) $(INCLUDES) $< | sed 's/$*.o/& $@/g' > $@"

ifneq ($(MAKECMDGOALS),clean)
-include mesh_factory.d
endif

.PHONY: subs
subs:
	cd sc_rtl_1; $(MAKE)
	cd sc_rtl_2; $(MAKE)
	cd sc_tlm_1; $(MAKE)
	cd sc_ocp_tl3_1; $(MAKE)

mesh_factory.o:
	$(CXX) -c mesh_factory.cc $(CPPFLAGS) $(CXXFLAGS) $(INCLUDES)

.PHONY: clean
clean:
	cd sc_rtl_1; $(MAKE) clean
	cd sc_rtl_2; $(MAKE) clean
	cd sc_tlm_1; $(MAKE) clean
	cd sc_ocp_tl3_1; $(MAKE) clean
	rm -f *~ *.o *.d