mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-20 20:03:44 +00:00
Delete more stuff needed only for the IL backend.
This commit is contained in:
@@ -67,7 +67,7 @@ MLFLAGS += -R$(FINAL_INSTALL_MERC_LIB_DIR) \
|
||||
MCFLAGS += -R$(FINAL_INSTALL_MERC_LIB_DIR) \
|
||||
-R$(FINAL_INSTALL_MERC_GC_LIB_DIR)
|
||||
endif
|
||||
ifeq ("$(filter il% csharp% java% erlang%,$(GRADE))","")
|
||||
ifeq ("$(filter csharp% java% erlang%,$(GRADE))","")
|
||||
MLLIBS += $(SOCKET_LIBRARY) $(NSL_LIBRARY) $(DL_LIBRARY) \
|
||||
$(READLINE_LIBRARIES)
|
||||
endif
|
||||
@@ -157,16 +157,13 @@ $(DEPENDS): Mercury.modules
|
||||
# lib$(BROWSER_LIB_NAME).int3s: lib$(MDBCOMP_LIB_NAME).int3s
|
||||
# lib$(BROWSER_LIB_NAME).ints: lib$(MDBCOMP_LIB_NAME).ints
|
||||
# lib$(BROWSER_LIB_NAME).cs: lib$(MDBCOMP_LIB_NAME).cs
|
||||
# lib$(BROWSER_LIB_NAME).ils: lib$(MDBCOMP_LIB_NAME).ils
|
||||
# lib$(BROWSER_LIB_NAME).javas: lib$(MDBCOMP_LIB_NAME).javas
|
||||
# lib$(BROWSER_LIB_NAME).check: lib$(MDBCOMP_LIB_NAME).check
|
||||
# $($(BROWSER_LIB_NAME).ints): $($(MDBCOMP_LIB_NAME).ints)
|
||||
# $($(BROWSER_LIB_NAME).cs): $($(MDBCOMP_LIB_NAME).cs)
|
||||
# $($(BROWSER_LIB_NAME).ils): $($(MDBCOMP_LIB_NAME).ils)
|
||||
# $($(BROWSER_LIB_NAME).javas): $($(MDBCOMP_LIB_NAME).java_dates)
|
||||
# $($(BROWSER_LIB_NAME).c_dates): $($(MDBCOMP_LIB_NAME).c_dates)
|
||||
# $($(BROWSER_LIB_NAME).s_dates): $($(MDBCOMP_LIB_NAME).s_dates)
|
||||
# $($(BROWSER_LIB_NAME).il_dates): $($(MDBCOMP_LIB_NAME).il_dates)
|
||||
# $($(BROWSER_LIB_NAME).java_dates): $($(MDBCOMP_LIB_NAME).java_dates)
|
||||
|
||||
# This directory contains source files for which the module
|
||||
|
||||
@@ -133,11 +133,6 @@ mercury_compile$(EXT_FOR_EXE): $(MC_PROG)$(EXT_FOR_EXE)
|
||||
rm -f mercury_compile$(EXT_FOR_EXE)
|
||||
$(LN) $(MC_PROG)$(EXT_FOR_EXE) mercury_compile$(EXT_FOR_EXE) || \
|
||||
cp $(MC_PROG)$(EXT_FOR_EXE) mercury_compile$(EXT_FOR_EXE)
|
||||
ifeq ($(findstring il,$(GRADE)),il)
|
||||
# set the stack size to 100M -- the default of 1M is too low
|
||||
-editbin /nologo /stack:100000000 mercury_compile$(EXT_FOR_EXE)
|
||||
cp ../browser/*.dll .
|
||||
endif
|
||||
|
||||
#-----------------------------------------------------------------------------#
|
||||
|
||||
@@ -212,7 +207,7 @@ dates:
|
||||
#-----------------------------------------------------------------------------#
|
||||
|
||||
# Note that the cs and os targets don't build top_level_init.{c,o}
|
||||
.PHONY: os cs ils
|
||||
.PHONY: os cs opts
|
||||
ifneq ($(MMAKE_USE_MMC_MAKE),yes)
|
||||
os: $($(MC_PROG).os)
|
||||
cs: $($(MC_PROG).cs)
|
||||
|
||||
@@ -104,7 +104,7 @@ MCFLAGS += $(LIBRARY_TRACE_LEVEL) $(INTER_FLAGS)
|
||||
# yet 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'.
|
||||
ifneq ("$(filter il% csharp% java% erlang%,$(GRADE))","")
|
||||
ifneq ("$(filter csharp% java% erlang%,$(GRADE))","")
|
||||
MCFLAGS += --allow-stubs --no-warn-stubs
|
||||
endif
|
||||
|
||||
@@ -248,16 +248,14 @@ dates:
|
||||
|
||||
#-----------------------------------------------------------------------------#
|
||||
|
||||
.PHONY: os cs ils javas
|
||||
.PHONY: os cs javas
|
||||
ifneq ($(MMAKE_USE_MMC_MAKE),yes)
|
||||
os: $($(STD_LIB_NAME).os)
|
||||
cs: $($(STD_LIB_NAME).cs)
|
||||
ils: $($(STD_LIB_NAME).ils)
|
||||
javas: $($(STD_LIB_NAME).javas)
|
||||
else
|
||||
os: $(STD_LIB_NAME).os
|
||||
cs: $(STD_LIB_NAME).cs
|
||||
ils: $(STD_LIB_NAME).ils
|
||||
javas: $(STD_LIB_NAME).javas
|
||||
endif
|
||||
|
||||
@@ -306,75 +304,6 @@ NATIVE_SO = Native.$(EXT_FOR_SHARED_LIB)
|
||||
|
||||
.PHONY: lib_std
|
||||
|
||||
# The ilc and il grades target Microsoft's .NET frameworks.
|
||||
ifeq ($(findstring il,$(GRADE)),il)
|
||||
|
||||
lib_std: mercury.dll lib$(STD_LIB_NAME)
|
||||
|
||||
# We have to hardcode the names of the runtime DLL files.
|
||||
RUNTIME_DLLS=mercury_dotnet.dll mercury_il.dll
|
||||
|
||||
CSCFLAGS=/t:module
|
||||
|
||||
# If you do generate a new strong name, you had better update
|
||||
# compiler/mlds_to_il.m to generate references to it. It is also hard-coded
|
||||
# in runtime/mercury_il.il.
|
||||
# This is hard-coding is sub-optimal -- the compiler should automatically find
|
||||
# out what the strong name is.
|
||||
library_strong_name.sn:
|
||||
sn -k library_strong_name.sn
|
||||
|
||||
mercury.dll: $($(STD_LIB_NAME).dlls) $($(STD_LIB_NAME).foreign_dlls) \
|
||||
$(RUNTIME_DLLS) library_strong_name.sn
|
||||
$(MS_AL) -v:0.0.0.0 -keyf:library_strong_name.sn -out:mercury.dll \
|
||||
$($(STD_LIB_NAME).dlls) $($(STD_LIB_NAME).foreign_dlls) \
|
||||
$(RUNTIME_DLLS)
|
||||
|
||||
# This is useful for running PEverify on the library.
|
||||
# For multi-file assemblies, PEverify only works on executables,
|
||||
# not on libraries.
|
||||
mercury_exe.exe: $($(STD_LIB_NAME).dlls) $($(STD_LIB_NAME).foreign_dlls) \
|
||||
$(RUNTIME_DLLS) library_strong_name.sn
|
||||
$(MS_AL) -v:0.0.0.0 -keyf:library_strong_name.sn -out:mercury_exe.exe \
|
||||
$($(STD_LIB_NAME).dlls) $($(STD_LIB_NAME).foreign_dlls) \
|
||||
$(RUNTIME_DLLS)
|
||||
|
||||
# The runtime DLLs must be copied into this directory from the runtime
|
||||
# directory so they can be installed properly.
|
||||
.PHONY: copy_runtime_dlls
|
||||
copy_runtime_dlls: $(RUNTIME_DLLS)
|
||||
|
||||
mercury_il.dll: ../runtime/mercury_il.dll
|
||||
cp ../runtime/mercury_il.dll .
|
||||
|
||||
mercury_dotnet.dll: ../runtime/mercury_dotnet.dll
|
||||
cp ../runtime/mercury_dotnet.dll .
|
||||
|
||||
CSHARP_MODULES = \
|
||||
array \
|
||||
builtin \
|
||||
char \
|
||||
construct \
|
||||
dir \
|
||||
exception \
|
||||
float \
|
||||
int \
|
||||
io \
|
||||
library \
|
||||
math \
|
||||
private_builtin \
|
||||
rtti_implementation \
|
||||
std_util \
|
||||
string \
|
||||
time \
|
||||
type_desc
|
||||
|
||||
CSHARP_DLLS = $(CSHARP_MODULES:%=%__csharp_code.dll)
|
||||
|
||||
$(CSHARP_DLLS) : $(RUNTIME_DLLS)
|
||||
|
||||
endif
|
||||
|
||||
#-----------------------------------------------------------------------------#
|
||||
|
||||
# For C# we include the runtime module directly into mer_std.dll.
|
||||
@@ -402,7 +331,7 @@ endif
|
||||
#
|
||||
# Some extra rules that we need for the C and asm back-ends
|
||||
#
|
||||
ifeq ("$(filter il% csharp% java% erlang%,$(GRADE))","")
|
||||
ifeq ("$(filter csharp% java% erlang%,$(GRADE))","")
|
||||
|
||||
# The following dependency is just there to improve compilation speed;
|
||||
# making tree234.$O first improves effective parallelism with parallel makes.
|
||||
@@ -423,7 +352,7 @@ MCFLAGS += --extra-init-command ./print_extra_inits
|
||||
|
||||
endif
|
||||
|
||||
endif # GRADE != il && GRADE != csharp && GRADE != java && GRADE != erlang
|
||||
endif # GRADE != csharp && GRADE != java && GRADE != erlang
|
||||
|
||||
#-----------------------------------------------------------------------------#
|
||||
|
||||
@@ -495,6 +424,7 @@ $(os_subdir)robdd.pic_o \
|
||||
|
||||
# In the past we generated liblibrary.* and then linked
|
||||
# libmer_std.* to the files.
|
||||
# XXX IL We should remove the code cleaning up IL files soon.
|
||||
realclean_local:
|
||||
rm -f mercury_dotnet.dll mercury_il.dll
|
||||
rm -f liblibrary.$A liblibrary.so library.init
|
||||
@@ -536,56 +466,6 @@ install_ints: lib$(STD_LIB_NAME).install_ints
|
||||
.PHONY: install_hdrs
|
||||
install_hdrs: lib$(STD_LIB_NAME).install_hdrs
|
||||
|
||||
ifneq (,$(findstring il,$(GRADE)))
|
||||
|
||||
# XXX some modules in the browser directory need library.int3
|
||||
|
||||
.PHONY: install_library
|
||||
install_library: mercury.dll install_grade_dirs install_gac \
|
||||
install_strong_name lib$(STD_LIB_NAME).install_grade_hdrs \
|
||||
lib$(STD_LIB_NAME).install_opts
|
||||
cp `vpath_find $($(STD_LIB_NAME).foreign_dlls) $($(STD_LIB_NAME).dlls) \
|
||||
mercury.dll` $(INSTALL_MERC_LIB_DIR)
|
||||
|
||||
# To build the .NET library with debugging information, add
|
||||
# the following to ../Mmake.params:
|
||||
#
|
||||
# EXTRA_ILASMFLAGS=/debug
|
||||
# EXTRA_CSCFLAGS=/debug+ /debug:full
|
||||
#
|
||||
# XXX Unfortunately, however, this is a problem with AL, which prohibits
|
||||
# linking debuggable C# code with IL code. The following horrible hack
|
||||
# avoids that problem. After modifying Mmake.params as described above,
|
||||
# invoke `mmake install_debug_library'.
|
||||
|
||||
.PHONY: install_debug_library
|
||||
install_debug_library:
|
||||
-$(MMAKE) $(MMAKEFLAGS)
|
||||
$(MMAKE) $(MMAKEFLAGS) munge_dll_debug_info
|
||||
$(MMAKE) $(MMAKEFLAGS) install_library
|
||||
|
||||
# The GAC is the global assembly cache, which is the system managed
|
||||
# place to put .NET assemblies.
|
||||
# gacutil installs (and uninstalls) DLLs from the GAC.
|
||||
.PHONY: install_gac
|
||||
install_gac: mercury.dll
|
||||
gacutil -i mercury.dll
|
||||
|
||||
.PHONY: install_strong_name
|
||||
install_strong_name: library_strong_name.sn
|
||||
cp `vpath_find library_strong_name.sn` \
|
||||
$(INSTALL_MERC_LIB_DIR)/mercury.sn
|
||||
|
||||
else
|
||||
|
||||
# we depend on lib$(STD_LIB_NAME) because lib$(STD_LIB_NAME).install_library
|
||||
# doesn't make library.int3, but some modules in the browser directory need it.
|
||||
|
||||
.PHONY: install_library
|
||||
install_library: lib$(STD_LIB_NAME) lib$(STD_LIB_NAME).install_library
|
||||
|
||||
endif #ifneq (,$(findstring il,$(GRADE)))
|
||||
|
||||
else #ifneq ($(MMAKE_USE_MMC_MAKE),yes)
|
||||
|
||||
.PHONY: install_mercury
|
||||
@@ -630,13 +510,4 @@ install_library:
|
||||
|
||||
endif
|
||||
|
||||
.PHONY: munge_dll_debug_info
|
||||
munge_dll_debug_info:
|
||||
for file in *csharp_code.dll; do \
|
||||
ildasm /out:$$file.ild $$file; \
|
||||
sed 's/01 00 00 01/01 00 01 01/' $$file.ild \
|
||||
> $$file.ild.munged; \
|
||||
ilasm /quiet /dll /debug /out:$$file $$file.ild.munged; \
|
||||
done
|
||||
|
||||
#-----------------------------------------------------------------------------#
|
||||
|
||||
@@ -183,7 +183,7 @@ dates:
|
||||
|
||||
#-----------------------------------------------------------------------------#
|
||||
|
||||
.PHONY: os cs ils
|
||||
.PHONY: os cs
|
||||
ifneq ($(MMAKE_USE_MMC_MAKE),yes)
|
||||
os: $($(MDBCOMP_LIB_NAME).os)
|
||||
cs: $($(MDBCOMP_LIB_NAME).cs)
|
||||
|
||||
@@ -67,7 +67,7 @@ MLFLAGS += -R$(FINAL_INSTALL_MERC_LIB_DIR) \
|
||||
MCFLAGS += -R$(FINAL_INSTALL_MERC_LIB_DIR) \
|
||||
-R$(FINAL_INSTALL_MERC_GC_LIB_DIR)
|
||||
endif
|
||||
ifeq ("$(filter il% csharp% java% erlang%,$(GRADE))","")
|
||||
ifeq ("$(filter csharp% java% erlang%,$(GRADE))","")
|
||||
MLLIBS += $(SOCKET_LIBRARY) $(NSL_LIBRARY) $(DL_LIBRARY) \
|
||||
$(READLINE_LIBRARIES)
|
||||
endif
|
||||
@@ -103,7 +103,7 @@ 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'.
|
||||
ifneq ("$(filter il% csharp% java% erlang%,$(GRADE))","")
|
||||
ifneq ("$(filter csharp% java% erlang%,$(GRADE))","")
|
||||
MCFLAGS += --allow-stubs --no-warn-stubs
|
||||
endif
|
||||
|
||||
@@ -156,16 +156,13 @@ $(DEPENDS): Mercury.modules
|
||||
# lib$(SSDB_LIB_NAME).int3s: lib$(MDBCOMP_LIB_NAME).int3s
|
||||
# lib$(SSDB_LIB_NAME).ints: lib$(MDBCOMP_LIB_NAME).ints
|
||||
# lib$(SSDB_LIB_NAME).cs: lib$(MDBCOMP_LIB_NAME).cs
|
||||
# lib$(SSDB_LIB_NAME).ils: lib$(MDBCOMP_LIB_NAME).ils
|
||||
# lib$(SSDB_LIB_NAME).javas: lib$(MDBCOMP_LIB_NAME).javas
|
||||
# lib$(SSDB_LIB_NAME).check: lib$(MDBCOMP_LIB_NAME).check
|
||||
# $($(SSDB_LIB_NAME).ints): $($(MDBCOMP_LIB_NAME).ints)
|
||||
# $($(SSDB_LIB_NAME).cs): $($(MDBCOMP_LIB_NAME).cs)
|
||||
# $($(SSDB_LIB_NAME).ils): $($(MDBCOMP_LIB_NAME).ils)
|
||||
# $($(SSDB_LIB_NAME).javas): $($(MDBCOMP_LIB_NAME).java_dates)
|
||||
# $($(SSDB_LIB_NAME).c_dates): $($(MDBCOMP_LIB_NAME).c_dates)
|
||||
# $($(SSDB_LIB_NAME).s_dates): $($(MDBCOMP_LIB_NAME).s_dates)
|
||||
# $($(SSDB_LIB_NAME).il_dates): $($(MDBCOMP_LIB_NAME).il_dates)
|
||||
# $($(SSDB_LIB_NAME).java_dates): $($(MDBCOMP_LIB_NAME).java_dates)
|
||||
|
||||
# This directory contains source files for which the module
|
||||
@@ -216,15 +213,13 @@ dates:
|
||||
|
||||
#-----------------------------------------------------------------------------#
|
||||
|
||||
.PHONY: os cs ils
|
||||
.PHONY: os cs
|
||||
ifneq ($(MMAKE_USE_MMC_MAKE),yes)
|
||||
os: $($(SSDB_LIB_NAME).os)
|
||||
cs: $($(SSDB_LIB_NAME).cs)
|
||||
ils: $($(SSDB_LIB_NAME).ils)
|
||||
else
|
||||
os: $(SSDB_LIB_NAME).os
|
||||
cs: $(SSDB_LIB_NAME).cs
|
||||
ils: $(SSDB_LIB_NAME).ils
|
||||
endif
|
||||
|
||||
#-----------------------------------------------------------------------------#
|
||||
@@ -246,7 +241,7 @@ realclean_local:
|
||||
.PHONY: install
|
||||
install: install_library
|
||||
|
||||
ifneq ("$(filter il% erlang%,$(GRADE))","")
|
||||
ifneq ("$(filter erlang%,$(GRADE))","")
|
||||
|
||||
# There is no ssdb in the .NET or Erlang backends.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user