diff --git a/NEWS.md b/NEWS.md index 1726dd440..04bdeaa7a 100644 --- a/NEWS.md +++ b/NEWS.md @@ -58,6 +58,77 @@ Changes that may break compatibility * We have dropped support for the x86 (32-bit) version of Cygwin. +* We have changed the meaning of `mmc --make name.cs`. + + We have long had two conventions for the names of mmc --make targets + for building all the files of a particular kind needed by a program. + The original convention was + + - target `program.cs` builds the .c files of all the modules of `program` + - target `program.os` builds the .o files of all the modules of `program` + + A later convention added some synonyms: + + - target `program.all_cs` builds the .c files of all the modules of `program` + - target `program.all_os` builds the .o files of all the modules of `program` + + We added this second convention when we added C# as a target language, + because, due to the suffix for C# files being `.cs`, targets of the form + `name.cs` became possibly ambiguous, with the new possible meaning being + "build the .cs file for the named module". At the time, we kept the old + meaning of target `name.cs`, adding target `csharp` to mean "build the + .cs file of the named module". + + We have now changed the meaning of target `name.cs` to mean + "build the .cs file of the named module". If you want to build + all the .c files of a program, you can specify `program.all_cs` + as the target. + +* For similar reasons, the compiler has stopped putting into + `program.dep` files (where `program` is the name of any program) + the definitions of mmake variables with the following names: + + `program.cs` + `program.os` + `program.pic_os` + `program.javas` + `program.css` + + which list the names the names of the `.c`, `.o`, `.pic_o`, `.java` and + `.cs` files of all the modules of the program. All references of these + mmake variables should be replaced to refer to one of the following + mmake variables: + + `program.all_cs` + `program.all_os` + `program.all_pic_os` + `program.all_javas` + `program.all_css` + +* We have deprecated the names of three more mmake variables in favor of + newly introduced replacements. These variables are + + `program.all_mhs` + `program.all_mihs` + `program.all_int0s` + + Their values were defined as the set of files with suffixes `.mh`, `.mih` + and `.int0` that MAY, or MAY NOT, exist for modules of the named program. + + We are deprecating these variable names because their meaning conflicts + with the meaning of the other mmake variables mentioned above, + whose values all contain the names of the files that definitely MUST + exist during the building of the program. + + Since the only intended purpose of these three variable names + was to specify a set of files that should be deleted during cleanup, + we recommend that all references of these three mmake variables should be + replaced by references to the newly defined mmake variables + + `program.mhs_to_clean` + `program.mihs_to_clean` + `program.int0s_to_clean` + Changes to the Mercury standard library --------------------------------------- diff --git a/browser/Mmakefile b/browser/Mmakefile index f2d8bcf47..0e83b2569 100644 --- a/browser/Mmakefile +++ b/browser/Mmakefile @@ -22,7 +22,7 @@ CHECK_HDRS = CHECK_MHDRS = $(mer_browser.mhs) -CHECK_OBJS = $(mer_browser.os) +CHECK_OBJS = $(mer_browser.all_os) ALLOW_LIB_PREFIX=yes ALLOW_BROWSER_PREFIX=yes ALLOW_MDBCOMP_PREFIX=yes @@ -232,28 +232,28 @@ dates: .PHONY: os cs css javas ifeq ($(MMAKE_USE_MMC_MAKE),yes) -os: $(BROWSER_LIB_NAME).os -cs: $(BROWSER_LIB_NAME).cs -css: $(BROWSER_LIB_NAME).css -javas: $(BROWSER_LIB_NAME).javas +all_os: $(BROWSER_LIB_NAME).all_os +all_cs: $(BROWSER_LIB_NAME).all_cs +all_css: $(BROWSER_LIB_NAME).all_css +all_javas: $(BROWSER_LIB_NAME).all_javas else -ifneq ($(origin $(BROWSER_LIB_NAME).os),undefined) -os: $($(BROWSER_LIB_NAME).os) -cs: $($(BROWSER_LIB_NAME).cs) -css: $($(BROWSER_LIB_NAME).css) -javas: $($(BROWSER_LIB_NAME).javas) +ifneq ($(origin $(BROWSER_LIB_NAME).all_os),undefined) +all_os: $($(BROWSER_LIB_NAME).all_os) +all_cs: $($(BROWSER_LIB_NAME).all_cs) +all_css: $($(BROWSER_LIB_NAME).all_css) +all_javas: $($(BROWSER_LIB_NAME).all_javas) else -os: +all_os: mmake depend; mmake os -cs: - mmake depend; mmake cs +all_cs: + mmake depend; mmake all_cs -css: - mmake depend; mmake css +all_css: + mmake depend; mmake all_css -javas: - mmake depend; mmake javas +all_javas: + mmake depend; mmake all_javas endif endif diff --git a/compiler/Mmakefile b/compiler/Mmakefile index 8a58194d8..08aec3ca1 100644 --- a/compiler/Mmakefile +++ b/compiler/Mmakefile @@ -181,37 +181,38 @@ dates: # The documentation of the reason for this set of rules # can be found in library/Mmakefile. -# Note that the cs and os targets don't build mercury_compile_init.{c,o}. +# Note that the all_cs and all_os targets don't build +# mercury_compile_init.{c,o}. -.PHONY: os cs css javas opts +.PHONY: all_os all_cs all_css all_javas all_opts ifeq ($(MMAKE_USE_MMC_MAKE),yes) -os: $(MC_PROG).os -cs: $(MC_PROG).cs -css: $(MC_PROG).css -javas: $(MC_PROG).javas -opts: $(MC_PROG).opts +all_os: $(MC_PROG).all_os +all_cs: $(MC_PROG).all_cs +all_css: $(MC_PROG).all_css +all_javas: $(MC_PROG).all_javas +all_opts: $(MC_PROG).all_opts else -ifneq ($(origin $(MC_PROG).os),undefined) -os: $($(MC_PROG).os) -cs: $($(MC_PROG).cs) -css: $($(MC_PROG).css) -javas: $($(MC_PROG).javas) -opts: $($(MC_PROG).opts) +ifneq ($(origin $(MC_PROG).all_os),undefined) +all_os: $($(MC_PROG).all_os) +all_cs: $($(MC_PROG).all_cs) +all_css: $($(MC_PROG).all_css) +all_javas: $($(MC_PROG).all_javas) +all_opts: $($(MC_PROG).all_opts) else -os: - mmake depend; mmake os +all_os: + mmake depend; mmake all_os -cs: - mmake depend; mmake cs +all_cs: + mmake depend; mmake all_cs -css: - mmake depend; mmake css +all_css: + mmake depend; mmake all_css -javas: - mmake depend; mmake javas +all_javas: + mmake depend; mmake all_javas -opts: - mmake depend; mmake opts +all_opts: + mmake depend; mmake all_opts endif endif @@ -241,7 +242,7 @@ install_mercury: install_compiler .PHONY: install_dirs install_dirs: - -[ -d $(INSTALL_MERC_BIN_DIR) ] || mkdir -p $(INSTALL_MERC_BIN_DIR) + -test -d $(INSTALL_MERC_BIN_DIR) || mkdir -p $(INSTALL_MERC_BIN_DIR) # If the compiler is built in the Java grade then we need to install Java # archive containing its class files, 'mercury_compiler.jar', but diff --git a/compiler/file_names.m b/compiler/file_names.m index 771a1f887..7cfefa21c 100644 --- a/compiler/file_names.m +++ b/compiler/file_names.m @@ -566,14 +566,18 @@ string::in, string::in, ext::in, module_name::in, file_name::out, file_name::out, io::di, io::uo) is det. + % fact_table_file_name(Globals, Ext, FactTableFileName, + % FullPathName): % fact_table_file_name_return_dirs(Globals, Ext, FactTableFileName, - % DirNames, FileName): + % DirNames, FullPathName): % - % Returns the filename to use when compiling fact table files. - % Return the directory pathname in FileName as DirNames. The caller - % can then create those directories (with create_any_dirs_on_path below), - % or not, as they wish. + % Returns the full path name to use when compiling fact table files. + % The second version returns the directory path in FullPathName + % as DirNames. The caller can then create those directories + % (with create_any_dirs_on_path below), or not, as they wish. % +:- pred fact_table_file_name(globals::in, string::in, + ext::in, file_name::in, file_name::out) is det. :- pred fact_table_file_name_return_dirs(globals::in, string::in, ext::in, file_name::in, list(dir_name)::out, file_name::out) is det. @@ -1077,6 +1081,11 @@ make_fake_module_name(Prefix, ModuleName) = FakeModuleName :- %---------------------% +fact_table_file_name(Globals, From, Ext, + FactTableFileName, FullFileName) :- + fact_table_file_name_return_dirs(Globals, From, Ext, + FactTableFileName, _DirNames, FullFileName). + fact_table_file_name_return_dirs(Globals, From, Ext, FactTableFileName, DirNames, FullFileName) :- FakeModuleName = unqualified(FactTableFileName), diff --git a/compiler/make.file_names.m b/compiler/make.file_names.m index 659969947..5a09c0ca4 100644 --- a/compiler/make.file_names.m +++ b/compiler/make.file_names.m @@ -82,9 +82,6 @@ :- import_module parse_tree.module_dep_info. :- import_module parse_tree.prog_foreign. -:- import_module list. - -%---------------------------------------------------------------------------% %---------------------------------------------------------------------------% % XXX MAKE Give this predicate a more descriptive name. @@ -170,8 +167,8 @@ module_target_to_file_name(Globals, From, TargetType, ModuleName, ; TargetExt = fact_table_obj(PIC, FactFile), maybe_pic_object_file_extension(PIC, ObjExt, _), - fact_table_file_name_return_dirs(Globals, $pred, - ext_cur_ngs_gs(ObjExt), FactFile, _FactDirs, FileName) + fact_table_file_name(Globals, $pred, ext_cur_ngs_gs(ObjExt), + FactFile, FileName) ). :- pred module_target_to_search_file_name(globals::in, string::in, @@ -198,8 +195,8 @@ module_target_to_search_file_name(Globals, From, TargetType, ModuleName, TargetExt = fact_table_obj(PIC, FactFile), maybe_pic_object_file_extension(PIC, ObjExt, _), % XXX This call ignores the implicit for_search setting. - fact_table_file_name_return_dirs(Globals, $pred, - ext_cur_ngs_gs(ObjExt), FactFile, _FactDirs, FileName) + fact_table_file_name(Globals, $pred, ext_cur_ngs_gs(ObjExt), + FactFile, FileName) ). %---------------------------------------------------------------------------% diff --git a/compiler/make.module_target.m b/compiler/make.module_target.m index d5358b95d..f5059b95d 100644 --- a/compiler/make.module_target.m +++ b/compiler/make.module_target.m @@ -1045,8 +1045,8 @@ find_files_maybe_touched_by_task(ProgressStream, Globals, TargetFile, Task, TouchedTargetFiles = [TargetFile], get_object_extension(Globals, PIC, ObjExt), fact_table_file_name_return_dirs(Globals, $pred, - ext_cur_ngs_gs(ObjExt), - FactTableName, FactTableDirs, FactTableObjectFile), + ext_cur_ngs_gs(ObjExt), FactTableName, + FactTableDirs, FactTableObjectFile), create_any_dirs_on_path(FactTableDirs, !IO), TouchedFileNames = [FactTableObjectFile] ). @@ -1214,11 +1214,11 @@ get_fact_table_foreign_code_file(Globals, Mkdir, ObjExt, FactTableFileName, ForeignCodeFile, !IO) :- % XXX EXT Neither of these calls should be needed. fact_table_file_name_return_dirs(Globals, $pred, - ext_cur_ngs_gs(ext_cur_ngs_gs_target_c), - FactTableFileName, FactTableDirsC, FactTableCFileName), + ext_cur_ngs_gs(ext_cur_ngs_gs_target_c), FactTableFileName, + FactTableDirsC, FactTableCFileName), maybe_create_any_dirs_on_path(Mkdir, FactTableDirsC, !IO), - fact_table_file_name_return_dirs(Globals, $pred, ObjExt, - FactTableFileName, FactTableDirsO, FactTableObjFileName), + fact_table_file_name_return_dirs(Globals, $pred, ObjExt, FactTableFileName, + FactTableDirsO, FactTableObjFileName), maybe_create_any_dirs_on_path(Mkdir, FactTableDirsO, !IO), ForeignCodeFile = foreign_code_file(lang_c, FactTableCFileName, FactTableObjFileName). diff --git a/compiler/make.program_target.m b/compiler/make.program_target.m index c27ed213e..15d9aec90 100644 --- a/compiler/make.program_target.m +++ b/compiler/make.program_target.m @@ -1600,30 +1600,31 @@ install_ints_and_headers(ProgressStream, Globals, SubdirLinkSucceeded, % find the `.int0' file. module_dep_info_get_children(ModuleDepInfo, Children), ( if set.is_empty(Children) then - Exts0 = [] + ExtExtDirs0 = [] else - Exts0 = [{ext_cur_ngs(ext_cur_ngs_int_int0), "int0s"}] + ExtExtDirs0 = [{ext_cur_ngs(ext_cur_ngs_int_int0), "int0s"}] ), globals.get_any_intermod(Globals, AnyIntermod), ( AnyIntermod = yes, - Exts1 = [{ext_cur_ngs_gs_max_ngs(ext_cur_ngs_gs_max_ngs_opt_plain), - "opts"} | Exts0] + ExtExtDirs1 = + [{ext_cur_ngs_gs_max_ngs(ext_cur_ngs_gs_max_ngs_opt_plain), + "opts"} | ExtExtDirs0] ; AnyIntermod = no, - Exts1 = Exts0 + ExtExtDirs1 = ExtExtDirs0 ), - Exts = [{ext_cur_ngs(ext_cur_ngs_int_int1), "ints"}, + ExtExtDirs = [{ext_cur_ngs(ext_cur_ngs_int_int1), "ints"}, {ext_cur_ngs(ext_cur_ngs_int_int2), "int2s"}, {ext_cur_ngs(ext_cur_ngs_int_int3), "int3s"}, {ext_cur_ngs(ext_cur_ngs_misc_module_dep), "module_deps"} - | Exts1], + | ExtExtDirs1], globals.lookup_string_option(Globals, install_prefix, Prefix), LibDir = Prefix/"lib"/"mercury", list.map_foldl( install_subdir_file(ProgressStream, Globals, SubdirLinkSucceeded, LibDir/"ints", ModuleName), - Exts, Results, !IO), + ExtExtDirs, Results, !IO), globals.get_target(Globals, Target), ( @@ -1957,14 +1958,14 @@ install_grade_ints_and_headers(ProgressStream, Globals, LinkSucceeded, maybe_succeeded::out, io::di, io::uo) is det. install_subdir_file(ProgressStream, Globals, SubdirLinkSucceeded, InstallDir, - ModuleName, {Ext, Exts}, Succeeded, !IO) :- + ModuleName, {Ext, ExtDir}, Succeeded, !IO) :- module_name_to_file_name(Globals, $pred, Ext, ModuleName, FileName), install_file(ProgressStream, Globals, FileName, InstallDir, Succeeded1, !IO), ( SubdirLinkSucceeded = did_not_succeed, install_file(ProgressStream, Globals, FileName, - InstallDir/"Mercury"/Exts, Succeeded2, !IO), + InstallDir/"Mercury"/ExtDir, Succeeded2, !IO), Succeeded = Succeeded1 `and` Succeeded2 ; SubdirLinkSucceeded = succeeded, diff --git a/compiler/make.top_level.m b/compiler/make.top_level.m index f2b91ef4b..23925aebb 100644 --- a/compiler/make.top_level.m +++ b/compiler/make.top_level.m @@ -70,7 +70,6 @@ :- import_module dir. :- import_module pair. :- import_module set. -:- import_module solutions. :- import_module string. :- import_module version_array. :- import_module version_hash_table. @@ -107,10 +106,10 @@ make_process_compiler_args(ProgressStream, Globals, DetectedGradeFlags, % Accept and ignore `.depend' targets. `mmc --make' does not need % a separate make depend step. The dependencies for each module % are regenerated on demand. - NonDependTargets = list.filter( + list.filter( ( pred(Target::in) is semidet :- not string.suffix(Target, ".depend") - ), Targets), + ), Targets, NonDependTargets), % Classify the remaining targets. list.map(classify_target(Globals), NonDependTargets, ClassifiedTargets), @@ -248,12 +247,12 @@ classify_target(Globals, FileName, TopTargetFile) :- string.length(FileName, NameLength), search_backwards_for_dot(FileName, NameLength, DotLocn), string.split(FileName, DotLocn, ModuleNameStr0, Suffix), - solutions(classify_target_2(Globals, ModuleNameStr0, Suffix), - TopTargetFiles), - TopTargetFiles = [OnlyTopTargetFile] + classify_target_2(Globals, ModuleNameStr0, Suffix, TopTargetFilePrime) then - TopTargetFile = OnlyTopTargetFile + TopTargetFile = TopTargetFilePrime else if + % XXX This possibility should also be handled together with the + % rest of classify_target_2. string.append("lib", ModuleNameStr, FileName) then file_name_to_module_name(ModuleNameStr, ModuleName), @@ -267,21 +266,24 @@ classify_target(Globals, FileName, TopTargetFile) :- ). :- pred classify_target_2(globals::in, string::in, string::in, - top_target_file::out) is nondet. + top_target_file::out) is semidet. classify_target_2(Globals, ModuleNameStr0, ExtStr, TopTargetFile) :- + % XXX This if-then-else chain cries out for conversion of most of it + % to a switch. ( if - extension_to_target_type(Globals, ExtStr, ModuleTargetType), + extension_to_target_type(Globals, ExtStr, ModuleTargetType) % The .cs extension was used to build all C target files, but .cs is % also the file name extension for a C# file. The former use is being % migrated over to the .all_cs target but we still accept it for now. % NOTE This workaround is still in use as of 2020 may 23, even though % it was added in 2010, - ExtStr \= ".cs" + % ZZZ ExtStr \= ".cs" then ModuleNameStr = ModuleNameStr0, TargetType = module_target(ModuleTargetType) else if + % ZZZ This is probably not needed anymore. target_extension_synonym(ExtStr, ModuleTargetType) then ModuleNameStr = ModuleNameStr0, @@ -307,17 +309,24 @@ classify_target_2(Globals, ModuleNameStr0, ExtStr, TopTargetFile) :- ExecutableType = get_executable_type(Globals), TargetType = linked_target(ExecutableType) else if - ( - string.append(".all_", Rest, ExtStr), - string.append(DotlessExtStr1, "s", Rest), - ExtStr1 = "." ++ DotlessExtStr1 - ; + ( if + % string.append(".all_", DotAllLessExtStr, ExtStr), + % string.append(DotAllSlessExtStr, "s", DotAllLessExtStr), + string.remove_prefix(".all_", ExtStr, DotAllLessExtStr), + string.remove_suffix(DotAllLessExtStr, "s", DotAllSLessExtStr) + then + ExtStr1 = "." ++ DotAllSLessExtStr + else if % Deprecated. - string.append(ExtStr1, "s", ExtStr) + string.remove_suffix(ExtStr, "s", SLessExtStr) + then + ExtStr1 = SLessExtStr + else + fail ), - ( - extension_to_target_type(Globals, ExtStr1, ModuleTargetType) - ; + ( if extension_to_target_type(Globals, ExtStr1, ModuleTargetType0) then + ModuleTargetType = ModuleTargetType0 + else target_extension_synonym(ExtStr1, ModuleTargetType) ), % Not yet implemented. `build_all' targets are only used by diff --git a/compiler/write_deps_file.m b/compiler/write_deps_file.m index d40bc694c..e81495bbc 100644 --- a/compiler/write_deps_file.m +++ b/compiler/write_deps_file.m @@ -81,8 +81,7 @@ % :- pred write_dependency_file(globals::in, burdened_aug_comp_unit::in, maybe_intermod_deps::in, set(module_name)::in, - maybe_include_trans_opt_rule::in, - io::di, io::uo) is det. + maybe_include_trans_opt_rule::in, io::di, io::uo) is det. % generate_dependencies_write_d_files(Globals, Modules, % IntDepsGraph, ImplDepsGraph, IndirectDepsGraph, IndirectOptDepsGraph, @@ -551,22 +550,14 @@ construct_fact_tables_entries(ModuleMakeVarName, SourceFileName, ObjFileName, MmakeVarFactTables = mmake_var_defn_list( ModuleMakeVarName ++ ".fact_tables", FactTableFileNames), - MmakeVarFactTablesOs = mmake_var_defn( - ModuleMakeVarName ++ ".fact_tables.os", - "$(" ++ ModuleMakeVarName ++ ".fact_tables:%=$(os_subdir)%.$O)"), MmakeVarFactTablesAllOs = mmake_var_defn( ModuleMakeVarName ++ ".fact_tables.all_os", "$(" ++ ModuleMakeVarName ++ ".fact_tables:%=$(os_subdir)%.$O)"), - MmakeVarFactTablesCs = mmake_var_defn( - ModuleMakeVarName ++ ".fact_tables.cs", - "$(" ++ ModuleMakeVarName ++ ".fact_tables:%=$(cs_subdir)%.c)"), MmakeVarFactTablesAllCs = mmake_var_defn( ModuleMakeVarName ++ ".fact_tables.all_cs", "$(" ++ ModuleMakeVarName ++ ".fact_tables:%=$(cs_subdir)%.c)"), - MmakeVarsFactTables = - [MmakeVarFactTables, - MmakeVarFactTablesOs, MmakeVarFactTablesAllOs, - MmakeVarFactTablesCs, MmakeVarFactTablesAllCs], + MmakeVarsFactTables = [MmakeVarFactTables, + MmakeVarFactTablesAllOs, MmakeVarFactTablesAllCs], FactTableSourceGroup = mmake_file_name_group("fact tables", one_or_more("$(" ++ ModuleMakeVarName ++ ".fact_tables)", [])), @@ -575,12 +566,12 @@ construct_fact_tables_entries(ModuleMakeVarName, SourceFileName, ObjFileName, % XXX These rules seem wrong to me. -zs MmakeRuleFactOs = mmake_simple_rule("fact_table_os", mmake_rule_is_not_phony, - "$(" ++ ModuleMakeVarName ++ ".fact_tables.os)", + "$(" ++ ModuleMakeVarName ++ ".fact_tables.all_os)", ["$(" ++ ModuleMakeVarName ++ ".fact_tables)", SourceFileName], []), MmakeRuleFactCs = mmake_simple_rule("fact_table_cs", mmake_rule_is_not_phony, - "$(" ++ ModuleMakeVarName ++ ".fact_tables.cs)", + "$(" ++ ModuleMakeVarName ++ ".fact_tables.all_cs)", [ObjFileName], []), MmakeRulesFactTables = [MmakeRuleFactOs, MmakeRuleFactCs] @@ -861,7 +852,7 @@ construct_c_header_rules(Globals, ModuleName, AllDeps, %---------------------% % The `.module_dep' file is made as a side effect of - % creating the `.c' or `.java'. + % creating the `.c' or `.java' file. % XXX What about C#? % (See the main comment on generate_d_file above. % @@ -894,9 +885,10 @@ construct_module_dep_fragment(Globals, ModuleName, CFileName, %---------------------% - % The .date and .date0 files depend on the .int0 files for the parent - % modules, and the .int3 files for the directly and indirectly imported - % modules. + % The .date and .date0 files depend on + % + % - the .int0 files for the parent modules, and + % - the .int3 files for the directly and indirectly imported modules. % % For nested submodules, the `.date' files for the parent modules % also depend on the same things as the `.date' files for this module, @@ -1327,16 +1319,6 @@ foreign_include_file_path_name(SourceFileName, IncludeFile) = IncludePath :- IncludeFile = foreign_include_file_info(_Lang, IncludeFileName), make_include_file_path(SourceFileName, IncludeFileName, IncludePath). -:- pred get_fact_table_dependencies(globals::in, ext::in, - list(file_name)::in, list(string)::out, io::di, io::uo) is det. - -get_fact_table_dependencies(_, _, [], [], !IO). -get_fact_table_dependencies(Globals, Ext, - [ExtraLink | ExtraLinks], [FileName | FileNames], !IO) :- - fact_table_file_name_return_dirs(Globals, $pred, Ext, ExtraLink, - _Dirs, FileName), - get_fact_table_dependencies(Globals, Ext, ExtraLinks, FileNames, !IO). - % With `--use-subdirs', allow users to type `mmake module.c' % rather than `mmake Mercury/cs/module.c'. % @@ -1600,6 +1582,16 @@ generate_dv_file(Globals, SourceFileName, ModuleName, DepsMap, mmake_var_defn_list(ModuleMakeVarName ++ ".foreign_cs", ForeignFileNames), + get_fact_table_file_names(DepsMap, Modules, FactTableFileNames), + list.map( + fact_table_file_name(Globals, $pred, + ext_cur_ngs_gs(ext_cur_ngs_gs_obj_dollar_o)), + FactTableFileNames, FactTableFileNamesOs), + list.map( + fact_table_file_name(Globals, $pred, + ext_cur_ngs_gs(ext_cur_ngs_gs_obj_dollar_efpo)), + FactTableFileNames, FactTableFileNamesPicOs), + % The dlls that contain the foreign_code. MmakeVarForeignDlls = mmake_var_defn(ModuleMakeVarName ++ ".foreign_dlls", string.format("$(%s.foreign:%%=$(dlls_subdir)%%.dll)", @@ -1610,23 +1602,6 @@ generate_dv_file(Globals, SourceFileName, ModuleName, DepsMap, MmakeVarAllCs = mmake_var_defn(ModuleMakeVarName ++ ".all_cs", string.format("$(%s.mods:%%=$(cs_subdir)%%.c)", [s(ModuleMakeVarName)])), - - get_fact_table_file_names(DepsMap, Modules, FactTableFileNames), - % XXX EXT - % We should just be able to append ".c", ".$O" and the pic extension - % to each string in FactTableFileNames. - get_fact_table_dependencies(Globals, - ext_cur_ngs_gs(ext_cur_ngs_gs_target_c), - FactTableFileNames, FactTableFileNamesC, !IO), - get_fact_table_dependencies(Globals, - ext_cur_ngs_gs(ext_cur_ngs_gs_obj_dollar_o), - FactTableFileNames, FactTableFileNamesOs, !IO), - get_fact_table_dependencies(Globals, - ext_cur_ngs_gs(ext_cur_ngs_gs_obj_dollar_efpo), - FactTableFileNames, FactTableFileNamesPicOs, !IO), - - MmakeVarCs = mmake_var_defn_list(ModuleMakeVarName ++ ".cs", - ["$(" ++ ModuleMakeVarName ++ ".init_cs)" | FactTableFileNamesC]), MmakeVarDlls = mmake_var_defn(ModuleMakeVarName ++ ".dlls", string.format("$(%s.mods:%%=$(dlls_subdir)%%.dll)", [s(ModuleMakeVarName)])), @@ -1638,16 +1613,9 @@ generate_dv_file(Globals, SourceFileName, ModuleName, DepsMap, [string.format("$(%s.mods:%%=$(os_subdir)%%.$(EXT_FOR_PIC_OBJECTS))", [s(ModuleMakeVarName)]) | FactTableFileNamesPicOs]), - MmakeVarOs = mmake_var_defn(ModuleMakeVarName ++ ".os", - string.format("$(%s.all_os)", [s(ModuleMakeVarName)])), - MmakeVarPicOs = mmake_var_defn(ModuleMakeVarName ++ ".pic_os", - string.format("$(%s.all_pic_os)", [s(ModuleMakeVarName)])), MmakeVarUseds = mmake_var_defn(ModuleMakeVarName ++ ".useds", string.format("$(%s.mods:%%=$(useds_subdir)%%.used)", [s(ModuleMakeVarName)])), - MmakeVarJavas = mmake_var_defn(ModuleMakeVarName ++ ".javas", - string.format("$(%s.mods:%%=$(javas_subdir)%%.java)", - [s(ModuleMakeVarName)])), MmakeVarAllJavas = mmake_var_defn(ModuleMakeVarName ++ ".all_javas", string.format("$(%s.mods:%%=$(javas_subdir)%%.java)", [s(ModuleMakeVarName)])), @@ -1657,8 +1625,9 @@ generate_dv_file(Globals, SourceFileName, ModuleName, DepsMap, % `module\$*.class', hence the "\\$$*.class" below. % If no such files exist, Make will use the pattern verbatim, % so we enclose the pattern in a `wildcard' function to prevent this. - % Evaluating the .classes variable can be slow, so we make it conditional - % on the grade. + % + % Evaluating the .classes variable can be slow, so we make its definition + % conditional on the grade. MmakeVarClassesJava = mmake_var_defn_list(ModuleMakeVarName ++ ".classes", [string.format("$(%s.mods:%%=$(classes_subdir)%%.class)", [s(ModuleMakeVarName)]), @@ -1671,9 +1640,8 @@ generate_dv_file(Globals, SourceFileName, ModuleName, DepsMap, mmake_cond_grade_has_component("java"), MmakeVarClassesJava, MmakeVarClassesNonJava), - MmakeVarCss = mmake_var_defn(ModuleMakeVarName ++ ".css", - string.format("$(%s.mods:%%=$(css_subdir)%%.cs)", - [s(ModuleMakeVarName)])), + % XXX Probably not needed, since we don't support building C# executables + % using mmake. MmakeVarAllCss = mmake_var_defn(ModuleMakeVarName ++ ".all_css", string.format("$(%s.mods:%%=$(css_subdir)%%.cs)", [s(ModuleMakeVarName)])), @@ -1746,13 +1714,18 @@ generate_dv_file(Globals, SourceFileName, ModuleName, DepsMap, ), MmakeVarMihs = mmake_var_defn_list(ModuleMakeVarName ++ ".mihs", MihSources), - MmakeVarMhs = mmake_var_defn_list(ModuleMakeVarName ++ ".mhs", MhSources), + MmakeVarMhs = + mmake_var_defn_list(ModuleMakeVarName ++ ".mhs", MhSources), - % The `.all_mihs' variable is like `.mihs' except that + % The `.mihs_to_clean' variable is like `.mihs' except that % it contains header files for all the modules, regardless of the grade % or --target option. It is used by the rule for `mmake realclean', % which should remove anything that could have been automatically % generated, even if the grade or --target option has changed. + MmakeVarMihsToClean = mmake_var_defn(ModuleMakeVarName ++ ".mihs_to_clean", + string.format("$(%s.mods:%%=$(mihs_subdir)%%.mih)", + [s(ModuleMakeVarName)])), + % The deprecated old version of .mihs_to_clean. MmakeVarAllMihs = mmake_var_defn(ModuleMakeVarName ++ ".all_mihs", string.format("$(%s.mods:%%=$(mihs_subdir)%%.mih)", [s(ModuleMakeVarName)])), @@ -1760,6 +1733,10 @@ generate_dv_file(Globals, SourceFileName, ModuleName, DepsMap, % The `.all_mhs' variable is like `.mhs' except that % it contains header files for all the modules, as for `.all_mihs' % above. + MmakeVarMhsToClean = mmake_var_defn(ModuleMakeVarName ++ ".mhs_to_clean", + string.format("$(%s.mods:%%=%%.mh)", + [s(ModuleMakeVarName)])), + % The deprecated old version of .mhs_to_clean. MmakeVarAllMhs = mmake_var_defn(ModuleMakeVarName ++ ".all_mhs", string.format("$(%s.mods:%%=%%.mh)", [s(ModuleMakeVarName)])), @@ -1776,21 +1753,35 @@ generate_dv_file(Globals, SourceFileName, ModuleName, DepsMap, MmakeVarInt0s = mmake_var_defn(ModuleMakeVarName ++ ".int0s", string.format("$(%s.parent_mods:%%=$(int0s_subdir)%%.int0)", [s(ModuleMakeVarName)])), - % XXX The `.all_int0s' variables is like `.int0s' except - % that it contains .int0 files for all modules, regardless of whether - % they should have been created or not. It is used by the rule for + % XXX The `.int0s_to_clean' variable is like `.int0s' + % except that it contains .int0 files for all modules, regardless of + % whether they should have been created or not. It is used by the rule for % `mmake realclean' to ensure that we clean up all the .int0 files, % including the ones that were accidentally created by the bug described % above. + MmakeVarInt0sToClean = mmake_var_defn( + ModuleMakeVarName ++ ".int0s_to_clean", + string.format("$(%s.mods:%%=$(int0s_subdir)%%.int0)", + [s(ModuleMakeVarName)])), + % The deprecated old version of .int0s_to_clean. MmakeVarAllInt0s = mmake_var_defn(ModuleMakeVarName ++ ".all_int0s", string.format("$(%s.mods:%%=$(int0s_subdir)%%.int0)", [s(ModuleMakeVarName)])), MmakeVarInt3s = mmake_var_defn(ModuleMakeVarName ++ ".int3s", string.format("$(%s.mods:%%=$(int3s_subdir)%%.int3)", [s(ModuleMakeVarName)])), + MmakeVarAllOpts = mmake_var_defn(ModuleMakeVarName ++ ".all_opts", + string.format("$(%s.mods:%%=$(opts_subdir)%%.opt)", + [s(ModuleMakeVarName)])), + % The deprecated old version of .all_opts. MmakeVarOpts = mmake_var_defn(ModuleMakeVarName ++ ".opts", string.format("$(%s.mods:%%=$(opts_subdir)%%.opt)", [s(ModuleMakeVarName)])), + MmakeVarAllTransOpts = mmake_var_defn( + ModuleMakeVarName ++ ".all_trans_opts", + string.format("$(%s.mods:%%=$(trans_opts_subdir)%%.trans_opt)", + [s(ModuleMakeVarName)])), + % The deprecated old version of .all_opts. MmakeVarTransOpts = mmake_var_defn(ModuleMakeVarName ++ ".trans_opts", string.format("$(%s.mods:%%=$(trans_opts_subdir)%%.trans_opt)", [s(ModuleMakeVarName)])), @@ -1812,20 +1803,23 @@ generate_dv_file(Globals, SourceFileName, ModuleName, DepsMap, MmakeVarModuleDepErrs, MmakeVarModuleErrs, MmakeVarModuleMods, MmakeVarModuleParentMods, MmakeVarForeignModules, MmakeVarForeignFileNames, MmakeVarForeignDlls, - MmakeVarInitCs, MmakeVarAllCs, MmakeVarCs, MmakeVarDlls, - MmakeVarAllOs, MmakeVarAllPicOs, MmakeVarOs, MmakeVarPicOs, + MmakeVarInitCs, MmakeVarAllCs, MmakeVarDlls, + MmakeVarAllOs, MmakeVarAllPicOs, MmakeVarUseds, - MmakeVarJavas, MmakeVarAllJavas]), + MmakeVarAllJavas]), MmakeFragmentsB = list.map(mmake_entry_to_fragment, - [MmakeVarCss, MmakeVarAllCss, + [MmakeVarAllCss, MmakeVarDirs, MmakeVarDirOs, MmakeVarDates, MmakeVarDate0s, MmakeVarDate3s, MmakeVarOptDates, MmakeVarTransOptDates, MmakeVarCDates, MmakeVarJavaDates, MmakeVarCsDates, MmakeVarDs, MmakeVarModuleDeps, MmakeVarMihs, - MmakeVarMhs, MmakeVarAllMihs, MmakeVarAllMhs, - MmakeVarInts, MmakeVarInt0s, MmakeVarAllInt0s, MmakeVarInt3s, - MmakeVarOpts, MmakeVarTransOpts, + MmakeVarMhs, + MmakeVarMihsToClean, MmakeVarAllMihs, + MmakeVarMhsToClean, MmakeVarAllMhs, + MmakeVarInts, MmakeVarInt0s, MmakeVarInt0sToClean, MmakeVarAllInt0s, + MmakeVarInt3s, + MmakeVarAllOpts, MmakeVarOpts, MmakeVarAllTransOpts, MmakeVarTransOpts, MmakeVarAnalysiss, MmakeVarRequests, MmakeVarImdgs, MmakeVarProfs]), MmakeFile = cord.from_list(MmakeFragmentsA) ++ @@ -1958,7 +1952,7 @@ generate_dep_file(Globals, SourceFileName, ModuleName, DepsMap, ), ( Intermod = yes, - OptsVar = "$(" ++ ModuleMakeVarName ++ ".opts)", + OptsVar = "$(" ++ ModuleMakeVarName ++ ".all_opts)", MaybeOptsVar = [OptsVar], MaybeOptsVarSpace = OptsVar ++ " " ; @@ -1968,7 +1962,7 @@ generate_dep_file(Globals, SourceFileName, ModuleName, DepsMap, ), ( TransOpt = yes, - TransOptsVar = "$(" ++ ModuleMakeVarName ++ ".trans_opts)", + TransOptsVar = "$(" ++ ModuleMakeVarName ++ ".all_trans_opts)", MaybeTransOptsVar = [TransOptsVar], MaybeTransOptsVarSpace = TransOptsVar ++ " " ; @@ -2042,10 +2036,11 @@ generate_dep_file_exec_library_targets(Globals, ModuleName, % create all the C files first, thus detecting errors early, % rather than first spending time compiling C files to .$O, % which could be a waste of time if the program contains errors. + % XXX The above comment seems to have suffered bit rot. ModuleMakeVarNameClasses = "$(" ++ ModuleMakeVarName ++ ".classes)", - ModuleMakeVarNameOs = "$(" ++ ModuleMakeVarName ++ ".os)", + ModuleMakeVarNameOs = "$(" ++ ModuleMakeVarName ++ ".all_os)", NonJavaMainRuleAction1Line1 = "$(ML) $(ALL_GRADEFLAGS) $(ALL_MLFLAGS) -- $(ALL_LDFLAGS) " ++ "$(EXEFILE_OPT)" ++ ExeFileName ++ "$(EXT_FOR_EXE) " ++ @@ -2110,7 +2105,7 @@ generate_dep_file_exec_library_targets(Globals, ModuleName, mmake_cond_grade_has_component("java"), MmakeRuleLibTargetJava, MmakeRuleLibTargetNonJava), - ModuleMakeVarNamePicOs = "$(" ++ ModuleMakeVarName ++ ".pic_os)", + ModuleMakeVarNamePicOs = "$(" ++ ModuleMakeVarName ++ ".all_pic_os)", SharedLibAction1Line1 = "$(ML) --make-shared-lib $(ALL_GRADEFLAGS) $(ALL_MLFLAGS) " ++ "-- " ++ InstallNameOpt ++ " $(ALL_LD_LIBFLAGS) " ++ @@ -2167,7 +2162,7 @@ generate_dep_file_init_targets(Globals, ModuleName, ModuleMakeVarName, module_name_to_file_name(Globals, $pred, ext_cur_ngs(ext_cur_ngs_mf_dv), ModuleName, DvFileName), - ModuleMakeVarNameCs = "$(" ++ ModuleMakeVarName ++ ".cs)", + ModuleMakeVarNameCs = "$(" ++ ModuleMakeVarName ++ ".all_cs)", InitAction1 = "echo > " ++ InitFileName, InitAction2 = "$(MKLIBINIT) " ++ ModuleMakeVarNameCs ++ " >> " ++ InitFileName, @@ -2455,7 +2450,7 @@ generate_dep_file_collective_targets(Globals, ModuleName, {ext_cur(ext_cur_pmt_int3s), ".date3s"}, {ext_cur(ext_cur_pmt_opts), ".optdates"}, {ext_cur(ext_cur_pmt_trans_opts), ".trans_opt_dates"}, - {ext_cur(ext_cur_pmt_javas), ".javas"}, + {ext_cur(ext_cur_pmt_javas), ".all_javas"}, {ext_cur(ext_cur_pmt_classes), ".classes"}, {ext_cur(ext_cur_pmt_all_ints), ".dates"}, {ext_cur(ext_cur_pmt_all_int3s), ".date3s"}, @@ -2496,8 +2491,9 @@ generate_dep_file_clean_targets(Globals, ModuleName, ModuleMakeVarName, ModuleName, RealCleanTargetName), % XXX Put these into a logical order. - CleanSuffixes = [".dirs", ".cs", ".mihs", ".all_os", ".all_pic_os", - ".c_dates", ".java_dates", ".useds", ".javas", ".profs", + % XXX Why not clean up C# files? + CleanSuffixes = [".dirs", ".all_cs", ".mihs", ".all_os", ".all_pic_os", + ".c_dates", ".java_dates", ".useds", ".all_javas", ".profs", ".dep_errs", ".errs", ".foreign_cs"], CleanFiles = [InitCFileName, InitObjFileName, InitPicObjFileName], MmakeRulesClean = @@ -2516,9 +2512,9 @@ generate_dep_file_clean_targets(Globals, ModuleName, ModuleMakeVarName, % any spurious .int0 files created for nested submodules. % For further details, see the XXX comments above. RealCleanSuffixes = [".dates", ".date0s", ".date3s", - ".optdates", ".trans_opt_dates", ".ints", ".all_int0s", ".int3s", + ".optdates", ".trans_opt_dates", ".ints", ".int0s_to_clean", ".int3s", ".opts", ".trans_opts", ".analyses", ".requests", ".imdgs", - ".ds", ".module_deps", ".all_mhs", ".all_mihs", ".dlls", + ".ds", ".module_deps", ".mhs_to_clean", ".mihs_to_clean", ".dlls", ".foreign_dlls", ".classes"], RealCleanFiles = [ExeFileName ++ "$(EXT_FOR_EXE) ", InitFileName, LibFileName, SharedLibFileName, JarFileName, DepFileName, DvFileName], diff --git a/deep_profiler/Mmakefile b/deep_profiler/Mmakefile index 88948d717..8f6ecc23f 100644 --- a/deep_profiler/Mmakefile +++ b/deep_profiler/Mmakefile @@ -229,88 +229,88 @@ dates: # The documentation of the reason for this set of rules # can be found in library/Mmakefile. -.PHONY: os cs css javas +.PHONY: all_os all_cs all_css all_javas ifeq ($(MMAKE_USE_MMC_MAKE),yes) -os: \ - mdprof_cgi.os \ - mdprof_test.os \ - mdprof_dump.os \ - mdprof_create_feedback.os \ - mdprof_report_feedback.os \ - mdprof_procrep.os +all_os: \ + mdprof_cgi.all_os \ + mdprof_test.all_os \ + mdprof_dump.all_os \ + mdprof_create_feedback.all_os \ + mdprof_report_feedback.all_os \ + mdprof_procrep.all_os -cs: \ - mdprof_cgi.cs \ - mdprof_test.cs \ - mdprof_dump.cs \ - mdprof_create_feedback.cs \ - mdprof_report_feedback.cs \ - mdprof_procrep.cs +all_cs: \ + mdprof_cgi.all_cs \ + mdprof_test.all_cs \ + mdprof_dump.all_cs \ + mdprof_create_feedback.all_cs \ + mdprof_report_feedback.all_cs \ + mdprof_procrep.all_cs -css: \ - mdprof_cgi.css \ - mdprof_test.css \ - mdprof_dump.css \ - mdprof_create_feedback.css \ - mdprof_report_feedback.css \ - mdprof_procrep.css +all_css: \ + mdprof_cgi.all_css \ + mdprof_test.all_css \ + mdprof_dump.all_css \ + mdprof_create_feedback.all_css \ + mdprof_report_feedback.all_css \ + mdprof_procrep.all_css -javas: \ - mdprof_cgi.javas \ - mdprof_test.javas \ - mdprof_dump.javas \ - mdprof_create_feedback.javas \ - mdprof_report_feedback.javas \ - mdprof_procrep.javas +all_javas: \ + mdprof_cgi.all_javas \ + mdprof_test.all_javas \ + mdprof_dump.all_javas \ + mdprof_create_feedback.all_javas \ + mdprof_report_feedback.all_javas \ + mdprof_procrep.all_javas else -ifneq ($(origin mdprof_cgi.os),undefined) +ifneq ($(origin mdprof_cgi.all_os),undefined) -os: \ - $(mdprof_cgi.os) \ - $(mdprof_test.os) \ - $(mdprof_dump.os) \ - $(mdprof_create_feedback.os) \ - $(mdprof_report_feedback.os) \ - $(mdprof_procrep.os) +all_os: \ + $(mdprof_cgi.all_os) \ + $(mdprof_test.all_os) \ + $(mdprof_dump.all_os) \ + $(mdprof_create_feedback.all_os) \ + $(mdprof_report_feedback.all_os) \ + $(mdprof_procrep.all_os) -cs: \ - $(mdprof_cgi.cs) \ - $(mdprof_test.cs) \ - $(mdprof_dump.cs) \ - $(mdprof_create_feedback.cs) \ - $(mdprof_report_feedback.cs) \ - $(mdprof_procrep.cs) +all_cs: \ + $(mdprof_cgi.all_cs) \ + $(mdprof_test.all_cs) \ + $(mdprof_dump.all_cs) \ + $(mdprof_create_feedback.all_cs) \ + $(mdprof_report_feedback.all_cs) \ + $(mdprof_procrep.all_cs) -css: \ - $(mdprof_cgi.css) \ - $(mdprof_test.css) \ - $(mdprof_dump.css) \ - $(mdprof_create_feedback.css) \ - $(mdprof_report_feedback.css) \ - $(mdprof_procrep.css) +all_css: \ + $(mdprof_cgi.all_css) \ + $(mdprof_test.all_css) \ + $(mdprof_dump.all_css) \ + $(mdprof_create_feedback.all_css) \ + $(mdprof_report_feedback.all_css) \ + $(mdprof_procrep.all_css) -javas: \ - $(mdprof_cgi.javas) \ - $(mdprof_test.javas) \ - $(mdprof_dump.javas) \ - $(mdprof_create_feedback.javas) \ - $(mdprof_report_feedback.javas) \ - $(mdprof_procrep.javas) +all_javas: \ + $(mdprof_cgi.all_javas) \ + $(mdprof_test.all_javas) \ + $(mdprof_dump.all_javas) \ + $(mdprof_create_feedback.all_javas) \ + $(mdprof_report_feedback.all_javas) \ + $(mdprof_procrep.all_javas) else -os: - mmake depend; mmake os +all_os: + mmake depend; mmake all_os -cs: - mmake depend; mmake cs +all_cs: + mmake depend; mmake all_cs -css: - mmake depend; mmake css +all_css: + mmake depend; mmake all_css -javas: - mmake depend; mmake javas +all_javas: + mmake depend; mmake all_javas endif endif @@ -363,7 +363,7 @@ install_cgi_progs: mdprof_cgi mdprof_dump mdprof_test \ # distribution (even if the step above failed). It is useful for # mdprof_test and mdprof_dump to be available when debugging problems # with the deep profiler, so we install them as well. - -[ -d $(INSTALL_MERC_BIN_DIR) ] || mkdir -p $(INSTALL_MERC_BIN_DIR) + -test -d $(INSTALL_MERC_BIN_DIR) || mkdir -p $(INSTALL_MERC_BIN_DIR) cp `vpath_find mdprof_cgi$(EXT_FOR_EXE)` \ $(INSTALL_MERC_BIN_DIR)/mdprof_cgi$(EXT_FOR_EXE) cp `vpath_find mdprof_test$(EXT_FOR_EXE)` \ diff --git a/grade_lib/Mmakefile b/grade_lib/Mmakefile index 2f21f2a96..7b577c276 100644 --- a/grade_lib/Mmakefile +++ b/grade_lib/Mmakefile @@ -107,62 +107,62 @@ tags_file_exists: # The documentation of the reason for this set of rules # can be found in library/Mmakefile. -.PHONY: os cs css javas +.PHONY: all_os all_cs all_css all_javas ifeq ($(MMAKE_USE_MMC_MAKE),yes) -os: \ - choose_grade.os \ - test_grades.os \ - try_all_grade_structs.os +all_os: \ + choose_grade.all_os \ + test_grades.all_os \ + try_all_grade_structs.all_os -cs: \ - choose_grade.cs \ - test_grades.cs \ - try_all_grade_structs.cs +all_cs: \ + choose_grade.all_cs \ + test_grades.all_cs \ + try_all_grade_structs.all_cs -css: \ - choose_grade.css \ - test_grades.css \ - try_all_grade_structs.css +all_css: \ + choose_grade.all_css \ + test_grades.all_css \ + try_all_grade_structs.all_css -javas: \ - choose_grade.javas \ - test_grades.javas \ - try_all_grade_structs.javas +all_javas: \ + choose_grade.all_javas \ + test_grades.all_javas \ + try_all_grade_structs.all_javas else -ifneq ($(origin choose_grade.os),undefined) -os: \ - $(choose_grade.os) \ - $(test_grades.os) \ - $(try_all_grade_structs.os) +ifneq ($(origin choose_grade.all_os),undefined) +all_os: \ + $(choose_grade.all_os) \ + $(test_grades.all_os) \ + $(try_all_grade_structs.all_os) -cs: \ - $(choose_grade.cs) \ - $(test_grades.cs) \ - $(try_all_grade_structs.cs) +all_cs: \ + $(choose_grade.all_cs) \ + $(test_grades.all_cs) \ + $(try_all_grade_structs.all_cs) -css: \ - $(choose_grade.css) \ - $(test_grades.css) \ - $(try_all_grade_structs.css) +all_css: \ + $(choose_grade.all_css) \ + $(test_grades.all_css) \ + $(try_all_grade_structs.all_css) -javas: \ - $(choose_grade.javas) \ - $(test_grades.javas) \ - $(try_all_grade_structs.javas) +all_javas: \ + $(choose_grade.all_javas) \ + $(test_grades.all_javas) \ + $(try_all_grade_structs.all_javas) else -os: - mmake depend; mmake os +all_os: + mmake depend; mmake all_os -cs: - mmake depend; mmake cs +all_cs: + mmake depend; mmake all_cs -css: - mmake depend; mmake css +all_css: + mmake depend; mmake all_css -javas: - mmake depend; mmake javas +all_javas: + mmake depend; mmake all_javas endif endif diff --git a/library/Mmakefile b/library/Mmakefile index d5da55c40..4c43634df 100644 --- a/library/Mmakefile +++ b/library/Mmakefile @@ -21,7 +21,7 @@ EXTRA_LDLIBS = CHECK_HDRS = CHECK_MHDRS = $(mer_std.mhs) -CHECK_OBJS = $(mer_std.os) +CHECK_OBJS = $(mer_std.all_os) ALLOW_LIB_PREFIX=yes ALLOW_BROWSER_PREFIX=no ALLOW_MDBCOMP_PREFIX=no @@ -305,8 +305,8 @@ dates: #-----------------------------------------------------------------------------# -# We have three separate rules for each of the os, cs, css, javas and -# opts targets, because no single rule can get the job done. +# We have three separate rules for each of the all_os, all_cs, all_css, +# all_javas and all_opts targets, because no single rule can get the job done. # # 1. When we are using mmake merely as a wrapper around mmc --make, # we get mmc --make compute the set of .o, .c, .cs, .java or .opt files @@ -321,10 +321,10 @@ dates: # so it is mmake's job to decide which files to ask mmc to (re)build. # Mmake gets this information from the .dv files it reads. These files # are created by "mmake depend" on an executable or library, and will -# define the make variables x.os, x.cs, x.css, x.javas and x.opts -# (if the executable or library is named x). +# define the make variables x.all_os, x.all_cs, x.all_css, x.all_javas +# and x.opts (if the executable or library is named x). # -# 2a. If e.g. x.os is defined (which we test for as "not undefined"), +# 2a. If e.g. x.all_os is defined (which we test for as "not undefined"), # that means that "mmake depend" has been run at least on x, and since # we just about always just run "mmake depend" in a directory instead of # running "mmake x.depend" on its executables/libraries individually, @@ -332,54 +332,54 @@ dates: # we get the set of .o, .c, .cs, .java or .opt files to (re)build # from these variables defined in the .dv files. # -# 2b. Conversely, if x.os is undefined, we assume that all the related +# 2b. Conversely, if x.all_os is undefined, we assume that all the related # make variables are also undefined. In this case, we invoke mmake # depend to build the .dv files, and then invoke mmake again to do # the job we were asked to do. We need two separate mmake invocations, # because mmake can read .dv files only when it starts up. And while # the second invocation of mmake looks like a case of infinite tail # recursion, it isn't, because after the mmake depend step, the -# recursive invocation will end up using the 2a rule, not the 2b. +# recursive invocation will end up using the 2a rule, not the 2b rule. # # An additional reason why we want to handle 2a separately from 2b is that # the mere existence of an mmake rule such as # -# os: $(mslice.os) +# all_os: $(mslice.all_os) # -# in the Mmakefile will generate a warning about mslice.os being undefined +# in the Mmakefile will generate a warning about mslice.all_os being undefined # (if in fact it is undefined) *even if* the mmake invocation does not -# involve the "os" target in any way, which can be confusing, and even +# involve the "all_os" target in any way, which can be confusing, and even # to those to whom it isn't confusing, it *is* annoying. -.PHONY: os cs css javas opts +.PHONY: all_os all_cs all_css all_javas all_opts ifeq ($(MMAKE_USE_MMC_MAKE),yes) -os: $(STD_LIB_NAME).os -cs: $(STD_LIB_NAME).cs -css: $(STD_LIB_NAME).css -javas: $(STD_LIB_NAME).javas -opts: $(STD_LIB_NAME).opts +all_os: $(STD_LIB_NAME).all_os +all_cs: $(STD_LIB_NAME).all_cs +all_css: $(STD_LIB_NAME).all_css +all_javas: $(STD_LIB_NAME).all_javas +all_opts: $(STD_LIB_NAME).all_opts else -ifneq ($(origin $(STD_LIB_NAME).os),undefined) -os: $($(STD_LIB_NAME).os) -cs: $($(STD_LIB_NAME).cs) -css: $($(STD_LIB_NAME).css) -javas: $($(STD_LIB_NAME).javas) -opts: $($(STD_LIB_NAME).opts) +ifneq ($(origin $(STD_LIB_NAME).all_os),undefined) +all_os: $($(STD_LIB_NAME).all_os) +all_cs: $($(STD_LIB_NAME).all_cs) +all_css: $($(STD_LIB_NAME).all_css) +all_javas: $($(STD_LIB_NAME).all_javas) +all_opts: $($(STD_LIB_NAME).all_opts) else -os: - mmake depend; mmake os +all_os: + mmake depend; mmake all_os -cs: - mmake depend; mmake cs +all_cs: + mmake depend; mmake all_cs -css: - mmake depend; mmake css +all_css: + mmake depend; mmake all_css -javas: - mmake depend; mmake javas +all_javas: + mmake depend; mmake all_javas -opts: - mmake depend; mmake opts +all_opts: + mmake depend; mmake all_opts endif endif @@ -395,8 +395,8 @@ endif ifeq ("$(findstring java,$(GRADE))","java") copy_java_runtime_files: - [ -d jmercury ] || mkdir jmercury - [ -d jmercury/runtime ] || cp -r ../java/runtime jmercury + test -d jmercury || mkdir jmercury + test -d jmercury/runtime || cp -r ../java/runtime jmercury install_mer_rt: $(RT_LIB_NAME).jar mkdir -p $(INSTALL_PREFIX)/lib/mercury/lib/$(GRADE) @@ -473,7 +473,7 @@ endif # GRADE != csharp && GRADE != java # have changed. Only some source files use the configuration macros, # but these uses may leak into other object files with inter-module # optimization. -$(mer_std.os): $(RUNTIME_DIR)/mercury_conf.h +$(mer_std.all_os): $(RUNTIME_DIR)/mercury_conf.h # The object files in this directory depend on many of the header files # in the runtime. However, changes to many of these header files require diff --git a/mdbcomp/Mmakefile b/mdbcomp/Mmakefile index 158005f0e..27197d70f 100644 --- a/mdbcomp/Mmakefile +++ b/mdbcomp/Mmakefile @@ -14,7 +14,7 @@ CHECK_HDRS = CHECK_MHDRS = $(mer_mdbcomp.mhs) -CHECK_OBJS = $(mer_mdbcomp.os) +CHECK_OBJS = $(mer_mdbcomp.all_os) ALLOW_LIB_PREFIX=yes ALLOW_BROWSER_PREFIX=no ALLOW_MDBCOMP_PREFIX=yes @@ -192,42 +192,35 @@ dates: # The documentation of the reason for this set of rules # can be found in library/Mmakefile. -.PHONY: os cs css javas +.PHONY: all_os all_cs all_css all_javas ifeq ($(MMAKE_USE_MMC_MAKE),yes) -os: $(MDBCOMP_LIB_NAME).os -cs: $(MDBCOMP_LIB_NAME).cs -css: $(MDBCOMP_LIB_NAME).css -javas: $(MDBCOMP_LIB_NAME).javas +all_os: $(MDBCOMP_LIB_NAME).all_os +all_cs: $(MDBCOMP_LIB_NAME).all_cs +all_css: $(MDBCOMP_LIB_NAME).all_css +all_javas: $(MDBCOMP_LIB_NAME).all_javas else -ifneq ($(origin $(MDBCOMP_LIB_NAME).os),undefined) -os: $($(MDBCOMP_LIB_NAME).os) -cs: $($(MDBCOMP_LIB_NAME).cs) -css: $($(MDBCOMP_LIB_NAME).css) -javas: $($(MDBCOMP_LIB_NAME).javas) +ifneq ($(origin $(MDBCOMP_LIB_NAME).all_os),undefined) +all_os: $($(MDBCOMP_LIB_NAME).all_os) +all_cs: $($(MDBCOMP_LIB_NAME).all_cs) +all_css: $($(MDBCOMP_LIB_NAME).all_css) +all_javas: $($(MDBCOMP_LIB_NAME).all_javas) else -os: - mmake depend; mmake os +all_os: + mmake depend; mmake all_os -cs: - mmake depend; mmake cs +all_cs: + mmake depend; mmake all_cs -css: - mmake depend; mmake css +all_css: + mmake depend; mmake all_css -javas: - mmake depend; mmake javas +all_javas: + mmake depend; mmake all_javas endif endif #-----------------------------------------------------------------------------# -# Ensure we recompile mdb.version if VERSION is changed. -$(os_subdir)mdb.o \ -$(os_subdir)mdb.pic_o \ - : $(RUNTIME_DIR)/mercury_conf.h - -#-----------------------------------------------------------------------------# - realclean_local: rm -f Mercury.modules tags MDBCOMP_FLAGS diff --git a/mfilterjavac/Mmakefile b/mfilterjavac/Mmakefile index 82c3ae42a..70713418e 100644 --- a/mfilterjavac/Mmakefile +++ b/mfilterjavac/Mmakefile @@ -125,28 +125,28 @@ dates: .PHONY: os cs css javas ifeq ($(MMAKE_USE_MMC_MAKE),yes) -os: mfilterjavac.os -cs: mfilterjavac.cs -css: mfilterjavac.css -javas: mfilterjavac.javas +all_os: mfilterjavac.all_os +all_cs: mfilterjavac.all_cs +all_css: mfilterjavac.all_css +all_javas: mfilterjavac.all_javas else -ifneq ($(origin mfilterjavac.os),undefined) -os: $(mfilterjavac.os) -cs: $(mfilterjavac.cs) -css: $(mfilterjavac.css) -javas: $(mfilterjavac.javas) +ifneq ($(origin mfilterjavac.all_os),undefined) +all_os: $(mfilterjavac.all_os) +all_cs: $(mfilterjavac.all_cs) +all_css: $(mfilterjavac.all_css) +all_javas: $(mfilterjavac.all_javas) else -os: - mmake depend; mmake os +all_os: + mmake depend; mmake all_os -cs: - mmake depend; mmake cs +all_cs: + mmake depend; mmake all_cs -css: - mmake depend; mmake css +all_css: + mmake depend; mmake all_css -javas: - mmake depend; mmake javas +all_javas: + mmake depend; mmake all_javas endif endif @@ -170,7 +170,7 @@ INSTALL_PROGRAM=mfilterjavac$(EXT_FOR_EXE) endif install: mfilterjavac - -[ -d $(INSTALL_MERC_BIN_DIR) ] || mkdir -p $(INSTALL_MERC_BIN_DIR) + -test -d $(INSTALL_MERC_BIN_DIR) || mkdir -p $(INSTALL_MERC_BIN_DIR) cp `vpath_find $(INSTALL_PROGRAM)` $(INSTALL_MERC_BIN_DIR)/$(INSTALL_PROGRAM) #-----------------------------------------------------------------------------# diff --git a/profiler/Mmakefile b/profiler/Mmakefile index 45cafdc6f..6bff6e2cd 100644 --- a/profiler/Mmakefile +++ b/profiler/Mmakefile @@ -110,30 +110,30 @@ dates: # The documentation of the reason for this set of rules # can be found in library/Mmakefile. -.PHONY: os cs css javas +.PHONY: all_os all_cs all_css all_javas ifeq ($(MMAKE_USE_MMC_MAKE),yes) -os: mercury_profile.os -cs: mercury_profile.cs -css: mercury_profile.css -javas: mercury_profile.javas +all_os: mercury_profile.all_os +all_cs: mercury_profile.all_cs +all_css: mercury_profile.all_css +all_javas: mercury_profile.all_javas else -ifneq ($(origin mercury_profile.os),undefined) -os: $(mercury_profile.os) -cs: $(mercury_profile.cs) -css: $(mercury_profile.css) -javas: $(mercury_profile.javas) +ifneq ($(origin mercury_profile.all_os),undefined) +all_os: $(mercury_profile.all_os) +all_cs: $(mercury_profile.all_cs) +all_css: $(mercury_profile.all_css) +all_javas: $(mercury_profile.all_javas) else -os: - mmake depend; mmake os +all_os: + mmake depend; mmake all_os -cs: - mmake depend; mmake cs +all_cs: + mmake depend; mmake all_cs -css: - mmake depend; mmake css +all_css: + mmake depend; mmake all_css -javas: - mmake depend; mmake javas +all_javas: + mmake depend; mmake all_javas endif endif @@ -152,7 +152,7 @@ install: install_profiler .PHONY: install_profiler install_profiler: mercury_profile - -[ -d $(INSTALL_MERC_BIN_DIR) ] || mkdir -p $(INSTALL_MERC_BIN_DIR) + -test -d $(INSTALL_MERC_BIN_DIR) || mkdir -p $(INSTALL_MERC_BIN_DIR) cp `vpath_find mercury_profile$(EXT_FOR_EXE)` $(INSTALL_MERC_BIN_DIR) ifeq ($(findstring java,$(GRADE)),java) cp `vpath_find mercury_profile.jar` $(INSTALL_MERC_BIN_DIR) diff --git a/scripts/Mmake.rules b/scripts/Mmake.rules index d7b78c5a7..37a01888b 100644 --- a/scripts/Mmake.rules +++ b/scripts/Mmake.rules @@ -19,7 +19,7 @@ main_target: $(MAIN_TARGET) #-----------------------------------------------------------------------------# -# Beware that the order of suffixes is significant. +# Note that the order of suffixes is significant. .SUFFIXES: .m .err \ .int0 .int .int2 .int3 .opt .trans_opt \ .dep .depend .dv .doit .ugly \ @@ -379,9 +379,9 @@ lib%.install_library: lib%.$A lib%.$(EXT_FOR_SHARED_LIB) \ lib%.install_grades: rm -rf tmp_dir && \ mkdir tmp_dir && \ - grade_files="$(foreach ext,$(GRADE_SUBDIR_EXTS),$($*.$(ext)s))" && \ + grade_files="$(foreach mve,$(GRADE_SUBDIR_MVEXTS),$($*.$(mve)))" && \ for file in x $$grade_files; do \ - if [ "$$file" != "x" ]; then \ + if test "$$file" != "x"; then \ mv -f $$file tmp_dir > /dev/null 2>&1; \ true; \ fi; \ @@ -389,13 +389,13 @@ lib%.install_grades: { mv -f $(deps_subdir)$*.dep $(deps_subdir)$*.dv \ *.a *.so tmp_dir || true; } && \ for grade in $(ALL_LIBGRADES); do \ - if [ "$$grade" != "$(GRADE)" ]; then \ + if test "$$grade" != "$(GRADE)"; then \ $(MMAKE) GRADE=$$grade $*.depend || \ exit 1; \ $(MMAKE) GRADE=$$grade lib$*.install_library || \ exit 1; \ for file in x $$grade_files; do \ - if [ "$$file" != "x" ]; then \ + if test "$$file" != "x"; then \ rm -f $$file; \ fi; \ done; \ @@ -404,7 +404,7 @@ lib%.install_grades: fi; \ done && \ for file in x $$grade_files; do \ - if [ "$$file" != "x" ]; then \ + if test "$$file" != "x"; then \ mv -f tmp_dir/`basename $$file` $$file > /dev/null 2>&1; \ true; \ fi; \ @@ -414,25 +414,26 @@ lib%.install_grades: .PHONY: install_lib_dirs install_lib_dirs: - -[ -d $(INSTALL_INT_DIR) ] || $(INSTALL_MKDIR) $(INSTALL_INT_DIR) - -[ -d $(INSTALL_INC_DIR) ] || $(INSTALL_MKDIR) $(INSTALL_INC_DIR) - -[ -d $(INSTALL_MODULE_DIR) ] || $(INSTALL_MKDIR) $(INSTALL_MODULE_DIR) + -test -d $(INSTALL_INT_DIR) || $(INSTALL_MKDIR) $(INSTALL_INT_DIR) + -test -d $(INSTALL_INC_DIR) || $(INSTALL_MKDIR) $(INSTALL_INC_DIR) + -test -d $(INSTALL_MODULE_DIR) || \ + $(INSTALL_MKDIR) $(INSTALL_MODULE_DIR) # The following is needed to support the `--use-subdirs' option. - -[ -d $(INSTALL_INT_DIR)/Mercury ] || \ + -test -d $(INSTALL_INT_DIR)/Mercury || \ $(INSTALL_MKDIR) $(INSTALL_INT_DIR)/Mercury .PHONY: install_grade_dirs install_grade_dirs: #install_lib_dirs - -[ -d $(INSTALL_MERC_LIB_DIR) ] || \ + -test -d $(INSTALL_MERC_LIB_DIR) || \ $(INSTALL_MKDIR) $(INSTALL_MERC_LIB_DIR) - -[ -d $(INSTALL_GRADE_INC_DIR) ] || \ + -test -d $(INSTALL_GRADE_INC_DIR) || \ $(INSTALL_MKDIR) $(INSTALL_GRADE_INC_DIR) - -[ -d $(INSTALL_GRADE_INT_DIR) ] || \ + -test -d $(INSTALL_GRADE_INT_DIR) || \ $(INSTALL_MKDIR) $(INSTALL_GRADE_INT_DIR) - -[ -d $(INSTALL_GRADE_MODULE_DIR) ] || \ + -test -d $(INSTALL_GRADE_MODULE_DIR) || \ $(INSTALL_MKDIR) $(INSTALL_GRADE_MODULE_DIR) # The following is needed to support the `--use-subdirs' option. - -[ -d $(INSTALL_GRADE_INC_DIR)/Mercury ] || \ + -test -d $(INSTALL_GRADE_INC_DIR)/Mercury || \ $(INSTALL_MKDIR) $(INSTALL_GRADE_INC_DIR)/Mercury - -[ -d $(INSTALL_GRADE_INT_DIR)/Mercury ] || \ + -test -d $(INSTALL_GRADE_INT_DIR)/Mercury || \ $(INSTALL_MKDIR) $(INSTALL_GRADE_INT_DIR)/Mercury diff --git a/scripts/Mmake.vars.in b/scripts/Mmake.vars.in index 89cda5e13..71c2c38bc 100644 --- a/scripts/Mmake.vars.in +++ b/scripts/Mmake.vars.in @@ -1,4 +1,6 @@ #-----------------------------------------------------------------------------# +# vim: ts=8 sw=8 noexpandtab ft=make +#-----------------------------------------------------------------------------# # Copyright (C) 1996-2008, 2010-2011 The University of Melbourne. # Copyright (C) 2013, 2015, 2017, 2020, 2023 The Mercury team. # This file may only be copied under the terms of the GNU General @@ -214,7 +216,7 @@ LIB_CFLAGS = $(patsubst %,-I %,$(EXTRA_C_INCL_DIRS)) #-----------------------------------------------------------------------------# # -# Stuff for the .NET back-end +# Stuff for the C# back-end. # CSC = @CSC@ @@ -226,7 +228,7 @@ LIB_CSCFLAGS = #-----------------------------------------------------------------------------# # -# Stuff for the Java back-end +# Stuff for the Java back-end. # # JAVAC is the command line java compiler; @@ -515,6 +517,10 @@ maybe-base-JAVACFLAGS-undefined = GRADE_SUBDIR_EXTS = \ mih optdate trans_opt trans_opt_date c c_date java java_date \ class dll s s_date pic_s pic_s_date o pic_o +GRADE_SUBDIR_MVEXTS = \ + mihs optdates trans_opts trans_opt_dates all_cs c_dates \ + all_javas java_dates \ + classs dlls ss s_dates pic_ss pic_s_dates all_os all_pic_os ifeq ($(MMAKE_USE_SUBDIRS),yes) @@ -745,7 +751,3 @@ ERR_REDIRECT = > $(*F).err 2>&1 # If this variable is set to no, then mmake doesn't automatically include # the ".d" files in the current directory in the Mmakefile. MMAKE_AUTO_INCLUDE_DS = yes - -#-----------------------------------------------------------------------------# -# vim: ts=8 sw=8 noexpandtab ft=make -#-----------------------------------------------------------------------------# diff --git a/slice/Mmakefile b/slice/Mmakefile index ff46b7bf4..d7a79162f 100644 --- a/slice/Mmakefile +++ b/slice/Mmakefile @@ -209,78 +209,78 @@ dates: # The documentation of the reason for this set of rules # can be found in library/Mmakefile. -.PHONY: os cs css javas +.PHONY: all_os all_cs all_css all_javas ifeq ($(MMAKE_USE_MMC_MAKE),yes) -os: \ - mslice.os \ - mdice.os \ - mcov.os \ - mtc_union.os \ - mtc_diff.os +all_os: \ + mslice.all_os \ + mdice.all_os \ + mcov.all_os \ + mtc_union.all_os \ + mtc_diff.all_os -cs: \ - mslice.cs \ - mdice.cs \ - mcov.cs \ - mtc_union.cs \ - mtc_diff.cs -css: \ - mslice.css \ - mdice.css \ - mcov.css \ - mtc_union.css \ - mtc_diff.css -javas: \ - mslice.javas \ - mdice.javas \ - mcov.javas \ - mtc_union.javas \ - mtc_diff.javas +all_cs: \ + mslice.all_cs \ + mdice.all_cs \ + mcov.all_cs \ + mtc_union.all_cs \ + mtc_diff.all_cs +all_css: \ + mslice.all_css \ + mdice.all_css \ + mcov.all_css \ + mtc_union.all_css \ + mtc_diff.all_css +all_javas: \ + mslice.all_javas \ + mdice.all_javas \ + mcov.all_javas \ + mtc_union.all_javas \ + mtc_diff.all_javas else -ifneq ($(origin mslice.os),undefined) +ifneq ($(origin mslice.all_os),undefined) -os: \ - $(mslice.os) \ - $(mdice.os) \ - $(mcov.os) \ - $(mtc_union.os) \ - $(mtc_diff.os) +all_os: \ + $(mslice.all_os) \ + $(mdice.all_os) \ + $(mcov.all_os) \ + $(mtc_union.all_os) \ + $(mtc_diff.all_os) -cs: \ - $(mslice.cs) \ - $(mdice.cs) \ - $(mcov.cs) \ - $(mtc_union.cs) \ - $(mtc_diff.cs) -css: \ - $(mslice.css) \ - $(mdice.css) \ - $(mcov.css) \ - $(mtc_union.css) \ - $(mtc_diff.css) -javas: \ - $(mslice.javas) \ - $(mdice.javas) \ - $(mcov.javas) \ - $(mtc_union.javas) \ - $(mtc_diff.javas) +all_cs: \ + $(mslice.all_cs) \ + $(mdice.all_cs) \ + $(mcov.all_cs) \ + $(mtc_union.all_cs) \ + $(mtc_diff.all_cs) +all_css: \ + $(mslice.all_css) \ + $(mdice.all_css) \ + $(mcov.all_css) \ + $(mtc_union.all_css) \ + $(mtc_diff.all_css) +all_javas: \ + $(mslice.all_javas) \ + $(mdice.all_javas) \ + $(mcov.all_javas) \ + $(mtc_union.all_javas) \ + $(mtc_diff.all_javas) else -os: - mmake depend; mmake os +all_os: + mmake depend; mmake all_os -cs: - mmake depend; mmake cs +all_cs: + mmake depend; mmake all_cs -css: - mmake depend; mmake css +all_css: + mmake depend; mmake all_css -javas: - mmake depend; mmake javas +all_javas: + mmake depend; mmake all_javas endif endif @@ -301,7 +301,7 @@ install: install_slicer .PHONY: install_slicer install_slicer: mslice mdice mtc_union mcov mtc_diff - -[ -d $(INSTALL_MERC_BIN_DIR) ] || mkdir -p $(INSTALL_MERC_BIN_DIR) + -test -d $(INSTALL_MERC_BIN_DIR) || mkdir -p $(INSTALL_MERC_BIN_DIR) cp `vpath_find mslice$(EXT_FOR_EXE)` \ $(INSTALL_MERC_BIN_DIR)/mslice$(EXT_FOR_EXE) cp `vpath_find mdice$(EXT_FOR_EXE)` \ diff --git a/ssdb/Mmakefile b/ssdb/Mmakefile index 84d1c2ac9..a8f9bb487 100644 --- a/ssdb/Mmakefile +++ b/ssdb/Mmakefile @@ -22,7 +22,7 @@ CHECK_HDRS = CHECK_MHDRS = $(mer_ssdb.mhs) -CHECK_OBJS = $(mer_ssdb.os) +CHECK_OBJS = $(mer_ssdb.all_os) ALLOW_LIB_PREFIX=yes ALLOW_BROWSER_PREFIX=yes ALLOW_MDBCOMP_PREFIX=yes @@ -110,13 +110,15 @@ LN = ln # complete, so we need to pass `--allow-stubs' to get them to compile. # Since the standard library is compiled with `--halt-at-warn', # we also need `--no-warn-stubs'. +# XXX That comment seems out of place: this is not the directory +# of the standard library. ifneq ("$(filter csharp% java%,$(GRADE))","") MCFLAGS += --allow-stubs --no-warn-stubs endif #-----------------------------------------------------------------------------# -# Stuff for Windows DLLS using gnu-win32 +# Stuff for Windows DLLS using gnu-win32. ifeq ($(USE_DLLS),yes) @@ -201,40 +203,33 @@ dates: .PHONY: os cs css javas ifeq ($(MMAKE_USE_MMC_MAKE),yes) -os: $(SSDB_LIB_NAME).os -cs: $(SSDB_LIB_NAME).cs -css: $(SSDB_LIB_NAME).css -javas: $(SSDB_LIB_NAME).javas +all_os: $(SSDB_LIB_NAME).all_os +all_cs: $(SSDB_LIB_NAME).all_cs +all_css: $(SSDB_LIB_NAME).all_css +all_javas: $(SSDB_LIB_NAME).all_javas else -ifneq ($(origin $(SSDB_LIB_NAME).os),undefined) -os: $($(SSDB_LIB_NAME).os) -cs: $($(SSDB_LIB_NAME).cs) -css: $($(SSDB_LIB_NAME).css) -javas: $($(SSDB_LIB_NAME).javas) +ifneq ($(origin $(SSDB_LIB_NAME).all_os),undefined) +all_os: $($(SSDB_LIB_NAME).all_os) +all_cs: $($(SSDB_LIB_NAME).all_cs) +all_css: $($(SSDB_LIB_NAME).all_css) +all_javas: $($(SSDB_LIB_NAME).all_javas) else -os: - mmake depend; mmake os +all_os: + mmake depend; mmake all_os -cs: - mmake depend; mmake cs +all_cs: + mmake depend; mmake all_cs -css: - mmake depend; mmake css +all_css: + mmake depend; mmake all_css -javas: - mmake depend; mmake javas +all_javas: + mmake depend; mmake all_javas endif endif #-----------------------------------------------------------------------------# -# Ensure we recompile mdb__version if VERSION is changed. -$(os_subdir)mdb.o \ -$(os_subdir)mdb.pic_o \ - : $(RUNTIME_DIR)/mercury_conf.h - -#-----------------------------------------------------------------------------# - realclean_local: rm -f Mercury.modules tags SSDB_FLAGS SSDB_FLAGS.date diff --git a/tools/bootcheck b/tools/bootcheck index 29e949f02..2f66fc976 100755 --- a/tools/bootcheck +++ b/tools/bootcheck @@ -560,18 +560,21 @@ esac case ${target} in c) target_ext=c + collective_target=all_cs target_subdir=${cs_subdir} target_opt= ;; csharp) target_ext=cs + collective_target=all_css target_subdir=${css_subdir} target_opt= ;; java) target_ext=java + collective_target=all_javas target_subdir=${javas_subdir} target_opt= ;; @@ -1329,6 +1332,7 @@ then check_namespace_status=0 if ${check_namespace} then + echo "starting namespace checks at $(date)" cd "${root}"/${stage2dir}/runtime mmake ${mmake_opts} check_namespace || { echo '** mmake check_namespace failed in runtime!' @@ -1366,6 +1370,7 @@ then } mmake ${mmake_opts} clean_check cd "${root}" + echo "namespace checks done at $(date)" fi check_stdlib_modules_status=0 @@ -1378,7 +1383,7 @@ then if ${stop_after_stage_2} then - echo "stopping after building stage 2" + echo "stopping after building stage 2 at $(date)" exit 0 fi @@ -1673,7 +1678,7 @@ EOF if (cd ${stage3dir}/library && ${MMAKE} ${mmake_opts} ${mmake_jobs} all-ints && - ${MMAKE} ${mmake_opts} ${mmake_jobs} ${target_ext}s) + ${MMAKE} ${mmake_opts} ${mmake_jobs} ${collective_target}) then echo "building of stage 3 library successful" else @@ -1682,7 +1687,7 @@ EOF # Try again, in case the failure cause was transient. if (cd ${stage3dir}/library && ${MMAKE} ${mmake_opts} ${mmake_jobs} all-ints && - ${MMAKE} ${mmake_opts} ${mmake_jobs} ${target_ext}s) + ${MMAKE} ${mmake_opts} ${mmake_jobs} ${collective_target}) then echo "building of stage 3 library successful" else @@ -1707,7 +1712,7 @@ EOF if (cd ${stage3dir}/mdbcomp && ${MMAKE} ${mmake_opts} ${mmake_jobs} all-ints && - ${MMAKE} ${mmake_opts} ${mmake_jobs} ${target_ext}s) + ${MMAKE} ${mmake_opts} ${mmake_jobs} ${collective_target}) then echo "building of stage 3 mdbcomp successful" else @@ -1715,7 +1720,7 @@ EOF df . # Try again, in case the failure cause was transient. if (cd ${stage3dir}/mdbcomp && \ - ${MMAKE} ${mmake_opts} ${mmake_jobs} ${target_ext}s) + ${MMAKE} ${mmake_opts} ${mmake_jobs} ${collective_target}) then echo "building of stage 3 mdbcomp successful" else @@ -1726,7 +1731,7 @@ EOF if (cd ${stage3dir}/browser && ${MMAKE} ${mmake_opts} ${mmake_jobs} all-ints && - ${MMAKE} ${mmake_opts} ${mmake_jobs} ${target_ext}s) + ${MMAKE} ${mmake_opts} ${mmake_jobs} ${collective_target}) then echo "building of stage 3 browser successful" else @@ -1734,7 +1739,7 @@ EOF df . # Try again, in case the failure cause was transient. if (cd ${stage3dir}/browser && \ - ${MMAKE} ${mmake_opts} ${mmake_jobs} ${target_ext}s) + ${MMAKE} ${mmake_opts} ${mmake_jobs} ${collective_target}) then echo "building of stage 3 browser successful" else @@ -1745,7 +1750,7 @@ EOF if (cd ${stage3dir}/ssdb && ${MMAKE} ${mmake_opts} ${mmake_jobs} all-ints && - ${MMAKE} ${mmake_opts} ${mmake_jobs} ${target_ext}s) + ${MMAKE} ${mmake_opts} ${mmake_jobs} ${collective_target}) then echo "building of stage 3 ssdb successful" else @@ -1753,7 +1758,7 @@ EOF df . # Try again, in case the failure cause was transient. if (cd ${stage3dir}/ssdb && \ - ${MMAKE} ${mmake_opts} ${mmake_jobs} ${target_ext}s) + ${MMAKE} ${mmake_opts} ${mmake_jobs} ${collective_target}) then echo "building of stage 3 ssdb successful" else @@ -1763,7 +1768,7 @@ EOF fi if (cd ${stage3dir}/compiler && \ - ${MMAKE} ${mmake_opts} ${mmake_jobs} ${target_ext}s) + ${MMAKE} ${mmake_opts} ${mmake_jobs} ${collective_target}) then echo "building of stage 3 compiler successful" else @@ -1771,7 +1776,7 @@ EOF df . # Try again, in case the failure cause was transient. if (cd ${stage3dir}/compiler && \ - ${MMAKE} ${mmake_opts} ${mmake_jobs} ${target_ext}s) + ${MMAKE} ${mmake_opts} ${mmake_jobs} ${collective_target}) then echo "building of stage 3 compiler successful" else @@ -1786,7 +1791,7 @@ EOF unset MMAKE_DIR && \ unset MERCURY_CONFIG_DIR && \ unset MERCURY_STDLIB_DIR && \ - mmake ${mmake_opts} ${mmake_jobs} ${target_ext}s) + mmake ${mmake_opts} ${mmake_jobs} ${collective_target}) then echo "building of stage 3 grade_lib successful" else @@ -1800,7 +1805,7 @@ EOF unset MMAKE_DIR && \ unset MERCURY_CONFIG_DIR && \ unset MERCURY_STDLIB_DIR && \ - mmake ${mmake_opts} ${mmake_jobs} ${target_ext}s) + mmake ${mmake_opts} ${mmake_jobs} ${collective_target}) then echo "building of stage 3 slice successful" else @@ -1814,7 +1819,7 @@ EOF unset MMAKE_DIR && \ unset MERCURY_CONFIG_DIR && \ unset MERCURY_STDLIB_DIR && \ - mmake ${mmake_opts} ${mmake_jobs} ${target_ext}s) + mmake ${mmake_opts} ${mmake_jobs} ${collective_target}) then echo "building of stage 3 profiler successful" else @@ -1828,7 +1833,7 @@ EOF unset MMAKE_DIR && \ unset MERCURY_CONFIG_DIR && \ unset MERCURY_STDLIB_DIR && \ - mmake ${mmake_opts} ${mmake_jobs} ${target_ext}s) + mmake ${mmake_opts} ${mmake_jobs} ${collective_target}) then echo "building of stage 3 deep profiler successful" else @@ -1842,7 +1847,7 @@ EOF unset MMAKE_DIR && \ unset MERCURY_CONFIG_DIR && \ unset MERCURY_STDLIB_DIR && \ - mmake ${mmake_opts} ${mmake_jobs} ${target_ext}s) + mmake ${mmake_opts} ${mmake_jobs} ${collective_target}) then echo "building of stage 3 mfilterjavac successful" else @@ -1865,10 +1870,19 @@ EOF exec > "${outfile}" # redirect stdout to ${outfile} fi - for dir in library mdbcomp browser ssdb compiler \ - grade_lib slice profiler deep_profiler mfilterjavac + for dir in \ + library \ + mdbcomp \ + browser \ + ssdb \ + compiler \ + grade_lib \ + slice \ + profiler \ + deep_profiler \ + mfilterjavac do - # `mmake cs' in the compiler directory doesn't build + # `mmake all_cs' in the compiler directory doesn't build # `mercury_compile_init.c', so we only compare the `.c' # files present in the stage 3 directory. for file in ${stage3dir}/${dir}/${target_subdir}*.${target_ext}