- for file in `echo "$(SRCS)" | grep ".c$$"`; do\
- echo "`$(CC) $(CFLAGS) $(SEARCH_DIRS) $(DEFS) -MM $$file` Makefile ../../Makefile.conf" >> deps ;\
- echo -e '\t$$(CC) $(CFLAGS) $(SEARCH_DIRS) $(DEFS) -c $$<' >> deps ;\
- done;\
- for file in `echo "$(SRCS)" | grep ".cpp$$"`; do\
- echo "`$(CXX) $(CXXFLAGS) $(SEARCH_DIRS) $(DEFS) -MM $$file` Makefile ../../Makefile.conf" >> deps ;\
- echo -e '\t$$(CXX) $(CXXFLAGS) $(SEARCH_DIRS) $(DEFS) -c $$<' >> deps ;\
- done\
+ for file in $(SRCS); do\
+ echo "$$file" | grep ".c$$" > /dev/null;\
+ if [ $$? == 0 ];\
+ then\
+ echo "`$(CC) $(CFLAGS) $(SEARCH_DIRS) $(DEFS) -MM $$file` Makefile ../../Makefile.conf" >> deps ;\
+ echo -e '\t$$(CC) $(CFLAGS) $(SEARCH_DIRS) $(DEFS) -c $$<' >> deps ;\
+ else\
+ echo "`$(CXX) $(CXXFLAGS) $(SEARCH_DIRS) $(DEFS) -MM $$file` Makefile ../../Makefile.conf" >> deps ;\
+ echo -e '\t$$(CXX) $(CXXFLAGS) $(SEARCH_DIRS) $(DEFS) -c $$<' >> deps ;\
+ fi;\
+ done