From: Axel S. <as...@us...> - 2005-01-23 15:44:44
|
Update of /cvsroot/gtk2hs/gtk2hs/mk In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16378/mk Modified Files: common.mk Log Message: Repaired dependency generation. It is still not fully automatic (see comment in mk/common.mk). Make it compile on Mac OS that has a funny C pre-processor. Decrease the initial heap size to 400MB. Index: common.mk =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/mk/common.mk,v retrieving revision 1.53 retrieving revision 1.54 diff -u -d -r1.53 -r1.54 --- common.mk 17 Jan 2005 18:33:57 -0000 1.53 +++ common.mk 23 Jan 2005 15:44:31 -0000 1.54 @@ -42,19 +42,33 @@ .DELETE_ON_ERROR : %.deps -%.deps : - $(strip if test -f $@; then touch $@; else \ - touch $@; $(MAKE) $(AM_MAKEFLAGS) NAME="$*" depend; fi;) +# A string that is non-empty if dependencies should not be calculated. +# All but the "clean" target are run during dependencies calculation +# and hence are listed here to avoid nasty recursion. +noDeps := $(strip $(findstring clean,$(MAKECMDGOALS)) \ + $(findstring c2hsLocal,$(MAKECMDGOALS)) \ + $(findstring .hs,$(MAKECMDGOALS)) \ + $(findstring .precomp,$(MAKECMDGOALS))) -.PHONY: depend +# Dependencies are only calculated if the .deps files does not exist. +# Thereafter it is never updated. A fix that likely works is to +# recalculate the dependencies of a .hs file each time it is +# recompiled. This does not work if some module reexports entities of +# another module. A sound fix would be to calculate dependencies each +# time which is too time consuming. -depend: $($(NAME)_BUILDSOURCES) - $(if $(word 2,$($(NAME)_HSFILES)),\ - $(HC) -M $(addprefix -optdep,-f $(NAME).deps) \ - $($(NAME)_HCFLAGS) -i$(subst $(SPACE),:,$($(NAME)_SOURCESDIRS)) \ - $(addprefix -package ,$($(NAME)_PACKAGEDEPS)) \ - $(AM_CPPFLAGS) $(EXTRA_CPPFLAGS) $(CPPFLAGS) \ - $($(NAME)_HSFILES)) +%.deps : + $(if $(strip \ + $(if $(findstring c2hs,$@),\ + $(findstring clean,$(MAKECMDGOALS)),$(noDeps))),,\ + $(strip if test -f $@; then touch $@; else \ + touch $@; \ + $(if $(word 2,$($(PKG)_HSFILES)),\ + $(MAKE) $(AM_MAKEFLAGS) $($(PKG)_HSFILES); \ + $(HC) -M $(addprefix -optdep,-f $@) \ + $(HCFLAGS) $($(PKG)_HCFLAGS) -i$(pkgVPATH) \ + $(AM_CPPFLAGS) $($(PKG)_CPPFLAGS) $($(PKG)_HSFILES);) \ + fi;)) .chs.dep : $(CHSDEPEND) -i$(pkgVPATH) $< @@ -73,7 +87,7 @@ # Same for .chi .PRECIOUS: %.chi -HSTOOLFLAGS = -H500m -M650m +HSTOOLFLAGS = -H400m -M650m .PHONY: debug debug : |