Author: ankit
Date: 2007-08-22 12:41:10 -0400 (Wed, 22 Aug 2007)
New Revision: 84648

Modified:
   trunk/monodevelop/Extras/MonoDevelop.Autotools/ChangeLog
   
trunk/monodevelop/Extras/MonoDevelop.Autotools/SimpleProjectMakefileHandler.cs
   trunk/monodevelop/Extras/MonoDevelop.Autotools/SolutionMakefileHandler.cs
   
trunk/monodevelop/Extras/MonoDevelop.Autotools/templates/Makefile.noauto.project.template
   
trunk/monodevelop/Extras/MonoDevelop.Autotools/templates/Makefile.solution.template
   trunk/monodevelop/Extras/MonoDevelop.Autotools/templates/make-dist.targets
   trunk/monodevelop/Extras/MonoDevelop.Autotools/templates/rules.make
Log:
Add support for hooks.

* templates/*: Add invocation for various hooks.
* SimpleProjectMakefileHandler.cs: Include custom-hooks.make .
* SolutionMakefileHandler.cs: Include custom-hooks.make . Emit
invocation for hooks.


Modified: trunk/monodevelop/Extras/MonoDevelop.Autotools/ChangeLog
===================================================================
--- trunk/monodevelop/Extras/MonoDevelop.Autotools/ChangeLog    2007-08-22 
16:25:40 UTC (rev 84647)
+++ trunk/monodevelop/Extras/MonoDevelop.Autotools/ChangeLog    2007-08-22 
16:41:10 UTC (rev 84648)
@@ -1,5 +1,12 @@
 2007-08-22  Ankit Jain  <[EMAIL PROTECTED]>
 
+       * templates/*: Add invocation for various hooks.
+       * SimpleProjectMakefileHandler.cs: Include custom-hooks.make .
+       * SolutionMakefileHandler.cs: Include custom-hooks.make . Emit
+       invocation for hooks.
+
+2007-08-22  Ankit Jain  <[EMAIL PROTECTED]>
+
        * templates/Makefile.solution.template: Replace all *-recursive targets
        with a single %-recursive target.
        * templates/*: minor updates.

Modified: 
trunk/monodevelop/Extras/MonoDevelop.Autotools/SimpleProjectMakefileHandler.cs
===================================================================
--- 
trunk/monodevelop/Extras/MonoDevelop.Autotools/SimpleProjectMakefileHandler.cs  
    2007-08-22 16:25:40 UTC (rev 84647)
+++ 
trunk/monodevelop/Extras/MonoDevelop.Autotools/SimpleProjectMakefileHandler.cs  
    2007-08-22 16:41:10 UTC (rev 84648)
@@ -189,10 +189,12 @@
                                        programFilesDir = 
programFilesDir.Replace ("@prefix@", "$(prefix)");
                                        programFilesDir = 
programFilesDir.Replace ("@PACKAGE@", "$(PACKAGE)");
                                        installDirs.Add (programFilesDir);
+                                       installTarget.Append ("\tmake 
pre-install-local-hook prefix=$(prefix)\n");
                                        installTarget.AppendFormat ("\tmkdir -p 
{0}\n", programFilesDir);
                                        installTarget.AppendFormat ("\tcp 
$(ASSEMBLY) $(ASSEMBLY_MDB) {0}\n", programFilesDir);
 
                                        //remove dir?
+                                       uninstallTarget.Append ("\tmake 
pre-uninstall-local-hook prefix=$(prefix)\n");
                                        uninstallTarget.AppendFormat ("\trm -f 
{0}/$(notdir $(ASSEMBLY))\n", programFilesDir);
                                        uninstallTarget.AppendFormat ("\ttest 
-z '$(ASSEMBLY_MDB)' || rm -f {0}/$(notdir $(ASSEMBLY_MDB))\n", 
programFilesDir);
 
@@ -204,6 +206,10 @@
 
                                        conf_vars.AppendFormat ("include 
$(top_srcdir)/Makefile.include\n");
                                        conf_vars.AppendFormat ("include 
$(top_srcdir)/config.make\n\n");
+                                       if (ctx.TargetCombine.BaseDirectory != 
project.BaseDirectory)
+                                               //Don't emit for top level 
project makefile(eg. pdn.make), as it would be
+                                               //included by top level 
solution makefile
+                                               conf_vars.AppendFormat 
("#include $(srcdir)/custom-hooks.make\n\n");
                                }
 
                                List<ConfigSection> configSections = new 
List<ConfigSection> ();
@@ -374,7 +380,10 @@
 
                                if (!generateAutotools) {
                                        installTarget.Insert (0, String.Format 
("install-local:{0}\n", installDeps.ToString ()));
+                                       installTarget.Append ("\tmake 
post-install-local-hook prefix=$(prefix)\n");
+
                                        uninstallTarget.Insert (0, 
String.Format ("uninstall-local:{0}\n", installDeps.ToString ()));
+                                       uninstallTarget.Append ("\tmake 
post-uninstall-local-hook prefix=$(prefix)\n");
                                }
 
                                templateEngine.Variables["CONFIG_VARS"] = 
conf_vars.ToString ();

Modified: 
trunk/monodevelop/Extras/MonoDevelop.Autotools/SolutionMakefileHandler.cs
===================================================================
--- trunk/monodevelop/Extras/MonoDevelop.Autotools/SolutionMakefileHandler.cs   
2007-08-22 16:25:40 UTC (rev 84647)
+++ trunk/monodevelop/Extras/MonoDevelop.Autotools/SolutionMakefileHandler.cs   
2007-08-22 16:41:10 UTC (rev 84648)
@@ -61,6 +61,7 @@
                                                        entry.BaseDirectory, 
ctx.TargetCombine.BaseDirectory));
                                        solutionTop.Append ("include 
$(top_srcdir)/config.make\n");
                                        solutionTop.Append ("include 
$(top_srcdir)/rules.make\n\n");
+                                       solutionTop.Append ("#include 
$(top_srcdir)/custom-hooks.make\n\n");
                                }
 
                                ArrayList children = new ArrayList ();
@@ -135,7 +136,7 @@
                                                                makefile.Append 
("install: install-local\nuninstall: uninstall-local\nclean: clean-local\n");
                                                                if (ce is 
Combine)
                                                                        //non 
TargetCombine
-                                                                       
makefile.Append ("distlocal: distlocal-recursive\n");
+                                                                       
makefile.Append ("dist-local: dist-local-recursive\n");
                                                                else
                                                                        
makefile.Append ("include $(top_srcdir)/rules.make\n");
                                                        }

Modified: 
trunk/monodevelop/Extras/MonoDevelop.Autotools/templates/Makefile.noauto.project.template
===================================================================
--- 
trunk/monodevelop/Extras/MonoDevelop.Autotools/templates/Makefile.noauto.project.template
   2007-08-22 16:25:40 UTC (rev 84647)
+++ 
trunk/monodevelop/Extras/MonoDevelop.Autotools/templates/Makefile.noauto.project.template
   2007-08-22 16:41:10 UTC (rev 84648)
@@ -32,8 +32,11 @@
        %%RESGEN%% '$<' '$@'
 
 $(ASSEMBLY) $(ASSEMBLY_MDB): $(build_sources) $(build_resources) 
$(build_datafiles) $(DLL_REFERENCES) $(PROJECT_REFERENCES) $(build_xamlg_list)
+       make pre-all-local-hook prefix=$(prefix)
        mkdir -p $(dir $(ASSEMBLY))
        $(ASSEMBLY_COMPILER_COMMAND) $(ASSEMBLY_COMPILER_FLAGS) 
-out:$(ASSEMBLY) -target:$(COMPILE_TARGET) $(build_sources_embed) 
$(build_resources_embed) $(build_references_ref)
+       make post-all-local-hook prefix=$(prefix)
 
+
 %%INSTALL_TARGET%%
 %%UNINSTALL_TARGET%%

Modified: 
trunk/monodevelop/Extras/MonoDevelop.Autotools/templates/Makefile.solution.template
===================================================================
--- 
trunk/monodevelop/Extras/MonoDevelop.Autotools/templates/Makefile.solution.template
 2007-08-22 16:25:40 UTC (rev 84647)
+++ 
trunk/monodevelop/Extras/MonoDevelop.Autotools/templates/Makefile.solution.template
 2007-08-22 16:41:10 UTC (rev 84648)
@@ -8,12 +8,14 @@
        @set . $$MAKEFLAGS; final_exit=:; \
        case $$2 in --unix) shift ;; esac; \
        case $$2 in *=*) dk="exit 1" ;; *k*) dk=: ;; *) dk="exit 1" ;; esac; \
+       make pre-$*-hook prefix=$(prefix)
        for dir in $(SUBDIRS); do \
                case $$dir in \
                .) make $*-local || { final_exit="exit 1"; $$dk; };;\
                *) (cd $$dir && make $*) || { final_exit="exit 1"; $$dk; };;\
                esac \
        done
+       make post-$*-hook prefix=$(prefix)
        $$final_exit
 
 $(CONFIG_MAKE):

Modified: 
trunk/monodevelop/Extras/MonoDevelop.Autotools/templates/make-dist.targets
===================================================================
--- trunk/monodevelop/Extras/MonoDevelop.Autotools/templates/make-dist.targets  
2007-08-22 16:25:40 UTC (rev 84647)
+++ trunk/monodevelop/Extras/MonoDevelop.Autotools/templates/make-dist.targets  
2007-08-22 16:41:10 UTC (rev 84648)
@@ -1,16 +1,18 @@
 dist: $(CONFIG_MAKE)
        rm -rf $(PACKAGE)-$(VERSION)
        mkdir $(PACKAGE)-$(VERSION)
+       make pre-dist-hook distdir=$$distdir
        for dir in $(SUBDIRS); do \
                pkgdir=`pwd`/$(PACKAGE)-$(VERSION); \
                mkdir $$pkgdir/$$dir || true; \
                case $$dir in \
-               .) make distlocal distdir=$$pkgdir || exit 1;; \
-               *) (cd $$dir; make distlocal distdir=$$pkgdir/$$dir) || exit 
1;; \
+               .) make dist-local distdir=$$pkgdir || exit 1;; \
+               *) (cd $$dir; make dist-local distdir=$$pkgdir/$$dir) || exit 
1;; \
                esac \
        done
-       (make distlocal distdir=$(PACKAGE)-$(VERSION))
+       (make dist-local distdir=$(PACKAGE)-$(VERSION))
        make
+       make post-dist-hook distsir=$$distdir
        tar czvf $(PACKAGE)-$(VERSION).tar.gz $(PACKAGE)-$(VERSION)
        rm -rf $(PACKAGE)-$(VERSION)
        @echo "=========================================="

Modified: trunk/monodevelop/Extras/MonoDevelop.Autotools/templates/rules.make
===================================================================
--- trunk/monodevelop/Extras/MonoDevelop.Autotools/templates/rules.make 
2007-08-22 16:25:40 UTC (rev 84647)
+++ trunk/monodevelop/Extras/MonoDevelop.Autotools/templates/rules.make 
2007-08-22 16:41:10 UTC (rev 84648)
@@ -1,10 +1,13 @@
 clean-local:
+       make pre-clean-local-hook
        -rm -f $(CLEANFILES)
+       make post-clean-local-hook
 
 install-local:
 uninstall-local:
 
-distlocal:
+dist-local:
+       make pre-dist-local-hook distdir=$$distdir
        list='$(EXTRA_DIST)'; \
        for f in Makefile $$list; do \
                d=`dirname "$$f"`; \
@@ -12,12 +15,18 @@
                        mkdir -p "$(distdir)/$$d"; \
                cp -p "$$f" "$(distdir)/$$d" || exit 1; \
        done
+       make post-dist-local-hook distdir=$$distdir
 
-distlocal-recursive:
+dist-local-recursive:
        for dir in $(SUBDIRS); do \
                mkdir -p $(distdir)/$$dir || true; \
                case $$dir in \
-               .) make distlocal distdir=$(distdir) || exit 1;; \
-               *) (cd $$dir; make distlocal distdir=$(distdir)/$$dir) || exit 
1; \
+               .) make dist-local distdir=$(distdir) || exit 1;; \
+               *) (cd $$dir; make dist-local distdir=$(distdir)/$$dir) || exit 
1; \
                esac \
        done
+
+#hooks: Available hooks - all, clean, install, uninstall and dist
+#      and their *-local variants
+pre-%-hook: ; @:
+post-%-hook: ; @:

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to