%.$(OBJ_SUFFIX) : $(DEPTH)/Makefile.modules \
		  $(DEPTH)/Makefile.local \
		  $(DEPTH)/Makefile.subdir \
		  $(DEPTH)/Makefile.os

%.$(OBJ_SUFFIX) : %.cpp
	@echo $(CXX) -c $<
	@$(CXX) $(CPPFLAGS) $(CXXFLAGS) $(INCLUDE) $(DEPGEN_FLAGS) -o $@ -c $<

-include $(OBJECTS:.$(OBJ_SUFFIX)=.d)

.PHONY : $(DIRECTORIES)
$(DIRECTORIES) :
	$(MAKE) -C $@

.PHONY : clean
clean :
ifdef OBJ_SUFFIX
	$(RM) *.$(OBJ_SUFFIX)
endif
	$(RM) *~
	$(RM) *.d
	$(RM) seed
ifdef PROGNAME
	$(RM) $(PROGNAME) core tags
endif
ifeq ($(SHELLTYPE), sh)
	@for d in *; \
	do	if test -d $$d; \
		then	if test -e $$d/Makefile; \
			then	make -C $$d $@; \
			fi \
		fi \
	done
endif
ifeq ($(SHELLTYPE), COMMAND.COM)
	-for %%d in ( $(DIRECTORIES) ) do make -C %%d $@
endif

ifeq ($(SHELLTYPE), sh)
.PHONY : touch
touch :
	touch -c *
	@for d in *; \
	do	if test -d $$d; \
		then	if test -e $$d/Makefile; \
			then	make -C $$d $@; \
			fi \
		fi \
	done
endif

ifeq ($(SHELLTYPE), sh)
.PHONY : chmod
chmod :
	@find -type d -exec chmod +x \{\} \;
	chmod -R go-w .
	chmod -R a+rX .
	@find . ! -type d ! -type l -exec chmod -x \{\} \;
	@find -name "c" -exec chmod +x \{\} \;
	@find -name "*.bat" -exec chmod +x \{\} \;
	@find -name "*.exe" -exec chmod +x \{\} \;
endif
