Author: ankit Date: 2008-01-18 13:43:05 -0500 (Fri, 18 Jan 2008) New Revision: 93283
Modified: trunk/monodevelop/main/src/addins/MonoDevelop.Autotools/ChangeLog trunk/monodevelop/main/src/addins/MonoDevelop.Autotools/SimpleProjectMakefileHandler.cs trunk/monodevelop/main/src/addins/MonoDevelop.Autotools/SolutionDeployer.cs trunk/monodevelop/main/src/addins/MonoDevelop.Autotools/SolutionMakefileHandler.cs trunk/monodevelop/main/src/addins/MonoDevelop.Autotools/templates/Makefile.include trunk/monodevelop/main/src/addins/MonoDevelop.Autotools/templates/Makefile.noauto.project.template Log: * SimpleProjectMakefileHandler.cs: Ensure that custom-hooks.make is included after the first target (all:). If the file exists then add it to EXTRA_DIST. Track change in emit-deploy-wrapper macro. * SolutionDeployer.cs: Emit sed script to generate wrapper only for simple makefiles. * SolutionMakefileHandler.cs: Use AppendToVariable for EXTRA_DIST, to allow a project to add to EXTRA_DIST. * templates/Makefile.include: sed is not required for autotools based makefiles. * templates/Makefile.auto.project.template: Add INCLUDE_CUSTOM_HOOKS after 'all:' target. Modified: trunk/monodevelop/main/src/addins/MonoDevelop.Autotools/ChangeLog =================================================================== --- trunk/monodevelop/main/src/addins/MonoDevelop.Autotools/ChangeLog 2008-01-18 18:43:06 UTC (rev 93282) +++ trunk/monodevelop/main/src/addins/MonoDevelop.Autotools/ChangeLog 2008-01-18 18:43:05 UTC (rev 93283) @@ -1,3 +1,18 @@ +2008-01-19 Ankit Jain <[EMAIL PROTECTED]> + + * SimpleProjectMakefileHandler.cs: Ensure that custom-hooks.make is + included after the first target (all:). If the file exists then add it + to EXTRA_DIST. + Track change in emit-deploy-wrapper macro. + * SolutionDeployer.cs: Emit sed script to generate wrapper only for + simple makefiles. + * SolutionMakefileHandler.cs: Use AppendToVariable for EXTRA_DIST, to + allow a project to add to EXTRA_DIST. + * templates/Makefile.include: sed is not required for autotools based + makefiles. + * templates/Makefile.auto.project.template: Add INCLUDE_CUSTOM_HOOKS + after 'all:' target. + 2008-01-16 Ankit Jain <[EMAIL PROTECTED]> * SolutionDeployer.cs: Sort the list of common and required packages Modified: trunk/monodevelop/main/src/addins/MonoDevelop.Autotools/SimpleProjectMakefileHandler.cs =================================================================== --- trunk/monodevelop/main/src/addins/MonoDevelop.Autotools/SimpleProjectMakefileHandler.cs 2008-01-18 18:43:06 UTC (rev 93282) +++ trunk/monodevelop/main/src/addins/MonoDevelop.Autotools/SimpleProjectMakefileHandler.cs 2008-01-18 18:43:05 UTC (rev 93283) @@ -128,6 +128,7 @@ extras = new StringBuilder (); datafiles = new StringBuilder (); + string include_custom_hooks = String.Empty; string references, dllReferences; ProcessProjectReferences (project, out references, out dllReferences, ctx); @@ -215,15 +216,15 @@ conf_vars.AppendFormat ("include $(top_srcdir)/Makefile.include\n"); conf_vars.AppendFormat ("include $(top_srcdir)/config.make\n\n"); - // Don't emit for top level project makefile(eg. pdn.make), as it would be // included by top level solution makefile if (ctx.TargetCombine.BaseDirectory != project.BaseDirectory){ string customhooks = Path.Combine (project.BaseDirectory, "custom-hooks.make"); bool include = File.Exists (customhooks); - Console.WriteLine ("------ {0} for {1}", include, customhooks); - conf_vars.AppendFormat ("{0}include $(srcdir)/custom-hooks.make\n\n", include ? "" : "#"); + include_custom_hooks = String.Format ("{0}include $(srcdir)/custom-hooks.make\n\n", include ? "" : "#"); + if (include) + makefile.SetVariable ("EXTRA_DIST", "$(srcdir)/custom-hooks.make"); } } @@ -428,6 +429,7 @@ templateEngine.Variables["COPY_DEPLOY_FILES_VARS"] = deployFileCopyVars.ToString(); templateEngine.Variables["COPY_DEPLOY_FILES_TARGETS"] = deployFileCopyTargets.ToString(); templateEngine.Variables["ALL_TARGET"] = (ctx.TargetCombine.BaseDirectory == project.BaseDirectory) ? "all-local" : "all"; + templateEngine.Variables["INCLUDE_CUSTOM_HOOKS"] = include_custom_hooks; templateEngine.Variables["FILES"] = files.ToString(); templateEngine.Variables["RESOURCES"] = res_files.ToString(); @@ -582,7 +584,10 @@ builtFiles.Add (Path.GetFileName (dfile.RelativeTargetPath)); if (dfile.ContainsPathReferences) - deployFileCopyTargets.AppendFormat ("$(eval $(call emit-deploy-wrapper,{0},{1}))\n", targetDeployVar, dependencyDeployFile); + deployFileCopyTargets.AppendFormat ("$(eval $(call emit-deploy-wrapper,{0},{1}{2}))\n", + targetDeployVar, + dependencyDeployFile, + (dfile.FileAttributes & DeployFileAttributes.Executable) != 0 ? ",x" : String.Empty); else deployFileCopyTargets.AppendFormat ("$(eval $(call emit-deploy-target,{0}))\n", targetDeployVar); Modified: trunk/monodevelop/main/src/addins/MonoDevelop.Autotools/SolutionDeployer.cs =================================================================== --- trunk/monodevelop/main/src/addins/MonoDevelop.Autotools/SolutionDeployer.cs 2008-01-18 18:43:06 UTC (rev 93282) +++ trunk/monodevelop/main/src/addins/MonoDevelop.Autotools/SolutionDeployer.cs 2008-01-18 18:43:05 UTC (rev 93283) @@ -458,6 +458,13 @@ templateEngine.Variables["DEPLOY_DIRS"] = deployDirs.ToString(); templateEngine.Variables["DEPLOY_FILES_CLEAN"] = deployDirVars; + templateEngine.Variables["CONFIG_MAKE_DEP"] = generateAutotools ? String.Empty : "$(top_srcdir)/config.make"; + if (generateAutotools) + templateEngine.Variables["WRAPPER_SED"] = String.Empty; + else + templateEngine.Variables["WRAPPER_SED"] = + "\n$2: $2.in $(top_srcdir)/config.make\n" + + "\tsed -e \"s,@prefix@,$(prefix),\" -e \"s,@PACKAGE@,$(PACKAGE),\" < $2.in > $2"; string fileName = Path.Combine (solution_dir, "Makefile.include"); Modified: trunk/monodevelop/main/src/addins/MonoDevelop.Autotools/SolutionMakefileHandler.cs =================================================================== --- trunk/monodevelop/main/src/addins/MonoDevelop.Autotools/SolutionMakefileHandler.cs 2008-01-18 18:43:06 UTC (rev 93282) +++ trunk/monodevelop/main/src/addins/MonoDevelop.Autotools/SolutionMakefileHandler.cs 2008-01-18 18:43:05 UTC (rev 93283) @@ -127,7 +127,7 @@ if (!generateAutotools) solutionMakefile.SetVariable ("EXTRA_DIST", projectMakefileName); } else { - makefile.SetVariable ("EXTRA_DIST", generateAutotools ? String.Empty : "Makefile"); + makefile.AppendToVariable ("EXTRA_DIST", generateAutotools ? String.Empty : "Makefile"); outpath = Path.Combine (Path.GetDirectoryName(ce.FileName), "Makefile"); if (generateAutotools) { ctx.AddAutoconfFile (outpath); Modified: trunk/monodevelop/main/src/addins/MonoDevelop.Autotools/templates/Makefile.include =================================================================== --- trunk/monodevelop/main/src/addins/MonoDevelop.Autotools/templates/Makefile.include 2008-01-18 18:43:06 UTC (rev 93282) +++ trunk/monodevelop/main/src/addins/MonoDevelop.Autotools/templates/Makefile.include 2008-01-18 18:43:05 UTC (rev 93283) @@ -40,16 +40,13 @@ cp '$$<' '$$@' endef -# $(call emit-deploy-wrapper,wrapper-variable-name,wrapper-sourcefile) +# $(call emit-deploy-wrapper,wrapper-variable-name,wrapper-sourcefile,x) # assumes that for a wrapper foo.pc its source template is foo.pc.in +# if $3 is non-empty then wrapper is marked exec define emit-deploy-wrapper -$($1): $2 $(top_srcdir)/config.make - mkdir -p $$(BUILD_DIR) +$($1): $2 %%CONFIG_MAKE_DEP%% + mkdir -p $$(dir $($1)) cp '$$<' '$$@' - chmod +x '$$@' - -$2: $2.in $(top_srcdir)/config.make - sed -e "s,@prefix@,$(prefix)," -e "s,@PACKAGE@,$(PACKAGE)," < $2.in > $2 - + test -z '$3' || chmod +x '$$@' +%%WRAPPER_SED%% endef - Modified: trunk/monodevelop/main/src/addins/MonoDevelop.Autotools/templates/Makefile.noauto.project.template =================================================================== --- trunk/monodevelop/main/src/addins/MonoDevelop.Autotools/templates/Makefile.noauto.project.template 2008-01-18 18:43:06 UTC (rev 93282) +++ trunk/monodevelop/main/src/addins/MonoDevelop.Autotools/templates/Makefile.noauto.project.template 2008-01-18 18:43:05 UTC (rev 93283) @@ -3,7 +3,6 @@ %%CONFIG_VARS%% %%COPY_DEPLOY_FILES_VARS%% - FILES = %%FILES%% DATA_FILES = %%DATA_FILES%% @@ -21,18 +20,16 @@ #Targets %%ALL_TARGET%%: $(ASSEMBLY) %%DEPLOY_FILE_VARS%% $(top_srcdir)/config.make -%%COPY_DEPLOY_FILES_TARGETS%% +%%INCLUDE_CUSTOM_HOOKS%% +%%COPY_DEPLOY_FILES_TARGETS%% %%TEMPLATE_FILES_TARGETS%% - $(build_xamlg_list): %.xaml.g.cs: %.xaml xamlg '$<' $(build_resx_resources) : %.resources: %.resx %%RESGEN%% '$<' '$@' - %%CUSTOM_COMMAND_TARGETS%% - $(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)) @@ -41,6 +38,5 @@ make $(CONFIG)_AfterBuild make post-all-local-hook prefix=$(prefix) - %%INSTALL_TARGET%% %%UNINSTALL_TARGET%% _______________________________________________ Mono-patches maillist - Mono-patches@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-patches