[GRASS-SVN] r40667 - grass/trunk/include/Make

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Jan 26 08:44:07 EST 2010


Author: glynn
Date: 2010-01-26 08:44:06 -0500 (Tue, 26 Jan 2010)
New Revision: 40667

Modified:
   grass/trunk/include/Make/Compile.make
   grass/trunk/include/Make/Dir.make
   grass/trunk/include/Make/Grass.make
   grass/trunk/include/Make/Rules.make
Log:
Allow creation of dependency files


Modified: grass/trunk/include/Make/Compile.make
===================================================================
--- grass/trunk/include/Make/Compile.make	2010-01-26 12:52:09 UTC (rev 40666)
+++ grass/trunk/include/Make/Compile.make	2010-01-26 13:44:06 UTC (rev 40667)
@@ -9,7 +9,9 @@
 linker_cxx = $(call linker_x,$(CXX))
 linker = $(call linker_x,$(LINK))
 
-compiler_x = $(1) $(2) $(LFS_CFLAGS) $(EXTRA_CFLAGS) $(NLS_CFLAGS) $(DEFS) $(EXTRA_INC) $(INC) -o $@ -c $<
+ALL_CFLAGS = $(LFS_CFLAGS) $(EXTRA_CFLAGS) $(NLS_CFLAGS) $(DEFS) $(EXTRA_INC) $(INC)
+
+compiler_x = $(1) $(2) $(ALL_CFLAGS) -o $@ -c $<
 compiler_c = $(call compiler_x,$(CC),$(COMPILE_FLAGS_C) $($*_c_FLAGS))
 compiler_cxx = $(call compiler_x,$(CXX),$(COMPILE_FLAGS_CXX) $($*_cc_FLAGS) $($*_cpp_FLAGS) $($*_cxx_FLAGS))
 compiler = $(call compiler_x,$(CC))
@@ -30,3 +32,8 @@
 
 %.output %.tab.h %.tab.c: %.y
 	$(YACC) -b$* $(YFLAGS) $<
+
+depend: $(C_SOURCES) $(CC_SOURCES) $(CPP_SOURCES)
+	-$(CC) -E -MM -MG $(ALL_CFLAGS) $^ | sed 's!^[0-9a-zA-Z_.-]*\.o:!$$(OBJDIR)/&!' > $(DEPFILE)
+
+-include $(DEPFILE)

Modified: grass/trunk/include/Make/Dir.make
===================================================================
--- grass/trunk/include/Make/Dir.make	2010-01-26 12:52:09 UTC (rev 40666)
+++ grass/trunk/include/Make/Dir.make	2010-01-26 13:44:06 UTC (rev 40667)
@@ -15,17 +15,19 @@
 	    $(MAKE) -C $$subdir || echo $(CURDIR)/$$subdir >> $(ERRORLOG) ; \
 	done
 
-cleansubdirs:
+%-recursive:
 	@list='$(SUBDIRS)'; \
 	for subdir in $$list; do \
-	    $(MAKE) -C $$subdir clean; \
+	    $(MAKE) -C $$subdir $*; \
 	done
 
-clean: cleansubdirs
+clean: clean-recursive
 
+depend: depend-recursive
+
 htmldir: html
 
-.PHONY: subdirs cleansubdirs parsubdirs htmldir $(SUBDIRS)
+.PHONY: subdirs parsubdirs htmldir $(SUBDIRS)
 
 parsubdirs: $(SUBDIRS)
 

Modified: grass/trunk/include/Make/Grass.make
===================================================================
--- grass/trunk/include/Make/Grass.make	2010-01-26 12:52:09 UTC (rev 40666)
+++ grass/trunk/include/Make/Grass.make	2010-01-26 13:44:06 UTC (rev 40667)
@@ -100,6 +100,8 @@
 GDAL_LINK = $(USE_GDAL)
 GDAL_DYNAMIC = 1
 
+DEPFILE = depend.mk
+
 ##################### library switches ##################################
 
 libs = \

Modified: grass/trunk/include/Make/Rules.make
===================================================================
--- grass/trunk/include/Make/Rules.make	2010-01-26 12:52:09 UTC (rev 40666)
+++ grass/trunk/include/Make/Rules.make	2010-01-26 13:44:06 UTC (rev 40667)
@@ -39,7 +39,7 @@
 # default clean rules
 clean:
 	-rm -rf $(OBJDIR) $(EXTRA_CLEAN_DIRS)
-	-rm -f $(EXTRA_CLEAN_FILES) *.tab.[ch] *.yy.c *.output *.backup *.tmp.html *.pyc
+	-rm -f $(EXTRA_CLEAN_FILES) *.tab.[ch] *.yy.c *.output *.backup *.tmp.html *.pyc $(DEPFILE)
 	-if [ "$(CLEAN_SUBDIRS)" != "" ] ; then \
 		list='$(CLEAN_SUBDIRS)' ; \
 		for dir in $$list ; do \
@@ -47,3 +47,6 @@
 		done ; \
 	fi
 
+depend:
+
+.PHONY: clean depend



More information about the grass-commit mailing list