[m-rev.] For review: Library Mmakefile for grade Java

James Goddard goddardjames at yahoo.com
Fri Jan 23 13:37:15 AEDT 2004


Estimated hours taken: 3
Branches: main

New rules for installing the Mercury standard library in grade Java.

library/Mmakefile:
	Added new target 'jars' which creates a jar file for the library
	classes and a jar file for the runtime classes.

	Modified target 'install_library' so that it adds these jar files to
	a new directory in the install path.

	To use these jar files, the CLASSPATH environment variable must be set
	to:

	<library_path>/mer_std.jar:<library_path>/mer_std.runtime.jar:.


Index: Mmakefile
===================================================================
RCS file: /home/mercury1/repository/mercury/library/Mmakefile,v
retrieving revision 1.127
diff -u -d -r1.127 Mmakefile
--- Mmakefile	15 Jan 2004 05:19:16 -0000	1.127
+++ Mmakefile	23 Jan 2004 02:23:30 -0000
@@ -240,6 +240,17 @@
 	[ -d mercury ] || ln -s . mercury
 	[ -d runtime ] || ln -s $(MERCURY_DIR)/java/runtime .
 
+# Once all of the library classes have been compiled, we put them in a single
+# jar file.  At this point we also add the runtime classes to a jar file.
+# Note that this stage makes use of the symbolic links created earlier to
+# ensure that the path names are correct within the jar files.
+JARS = $(STD_LIB_NAME).jar $(STD_LIB_NAME).runtime.jar
+
+.PHONY:	jars
+jars:	classes
+	jar cf $(STD_LIB_NAME).jar mercury/*.class
+	jar cf $(STD_LIB_NAME).runtime.jar mercury/runtime/*.class
+
 #-----------------------------------------------------------------------------#
 
 .PHONY: lib_std
@@ -306,8 +317,7 @@
 endif
 #-----------------------------------------------------------------------------#
 ifeq ("$(findstring java,$(GRADE))","java")
-# XXX Mmake should add this dependency automatically
-lib_std: classes
+lib_std: jars
 endif
 #-----------------------------------------------------------------------------#
 #
@@ -474,10 +484,23 @@
 	
 else
 
+ifneq (,$(findstring java,$(GRADE)))
+
+JAVA_LIBRARY_INSTALL_PATH = $(INSTALL_PREFIX)/lib/mercury/lib/java
+
+.PHONY: install_library
+install_library: jars
+	mkdir -p $(JAVA_LIBRARY_INSTALL_PATH)
+	cp $(JARS) $(JAVA_LIBRARY_INSTALL_PATH)
+
+else
+
 .PHONY: install_library
 install_library: lib$(STD_LIB_NAME).install_library
 
-endif	# non IL grades
+endif  #ifneq (,$(findstring java,$(GRADE)))
+
+endif  #ifneq (,$(findstring il,$(GRADE)))
 
 # $(STD_LIB_NAME).split.$A is a version of lib$(STD_LIB_NAME).$A
 # that has been compiled with `--split-c-files'.
--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list