diff: clpr/Mmakefile minor changes

Fergus Henderson fjh at hydra.cs.mu.oz.au
Mon Oct 6 22:39:42 AEST 1997


clpr/Mmakefile:
clpr/samples/Mmakefile:
	A few changes needed to make it work with shared libraries on Linux.

cvs diff clpr/Mmakefile clpr/samples/Mmakefile
Index: clpr/Mmakefile
===================================================================
RCS file: /home/staff/zs/imp/clpr/Mmakefile,v
retrieving revision 1.8
diff -u -r1.8 Mmakefile
--- Mmakefile	1997/09/30 08:54:29	1.8
+++ Mmakefile	1997/10/06 08:41:08
@@ -30,11 +30,15 @@
 MGNUCFLAGS += -Wno-strict-prototypes
 
 # Link in the CLP(R) library
-MLLIBS = -Lclpr -lclpr $(EXTRA_MLLIBS)
+MLFLAGS = -R`pwd`/clpr -Lclpr $(EXTRA_MLFLAGS)
+MLLIBS = -lclpr $(EXTRA_MLLIBS)
 
 # We need to make sure that the CLP(R) library gets initialized
 C2INITFLAGS = cfloat.c
 %_init.c: cfloat.c
+
+# We need this to use shared libraries on Linux
+ML = ml --mercury-libs shared
 
 #-----------------------------------------------------------------------------#
 
Index: clpr/samples/Mmakefile
===================================================================
RCS file: /home/staff/zs/imp/clpr/samples/Mmakefile,v
retrieving revision 1.4
diff -u -r1.4 Mmakefile
--- Mmakefile	1997/09/15 08:55:21	1.4
+++ Mmakefile	1997/10/06 12:35:40
@@ -19,22 +19,44 @@
 
 # Link in the CLP(R) library and the cfloat_lib library
 MCFLAGS += -I..
-MLFLAGS += -R`pwd`/.. -R`pwd`/../clpr -L.. -L../clpr $(EXTRA_MLFLAGS)
-MLLIBS = -lcfloat_lib -lclpr $(EXTRA_MLLIBS)
+MLFLAGS += -R`pwd`/.. -R`pwd`/../clpr -L.. -L../clpr
+MLLIBS = -lcfloat_lib -lclpr
 VPATH = ..:$(MMAKE_VPATH)
 C2INITFLAGS = ../cfloat_lib.init ../cfloat.c
 %_init.c: $(C2INITFLAGS)
 
+# The following is needed so that we can use shared libraries on Linux
+MGNUCFLAGS += -DPIC_REG
+ML = ml --mercury-libs shared
+
+# The following would be needed to use static libraries on Linux
+# MLLIBS = ../libcfloat_lib.a -lclpr
+# ML = ml --mercury-libs static
+
+#-----------------------------------------------------------------------------#
+
+# The following lets you add extra flags on the command line, e.g.
+# 	mmake EXTRA_CFLAGS=-O3
+
+MGNUCFLAGS += $(EXTRA_CFLAGS)
+MCFLAGS += $(EXTRA_MCFLAGS)
+MLFLAGS += $(EXTRA_MLFLAGS)
+MLLIBS += $(EXTRA_MLLIBS)
+C2INITFLAGS += $(EXTRA_C2INITFLAGS)
+
 #-----------------------------------------------------------------------------#
 
 PROGS	=	 tranny fib laplace mortgage sum_list tests
 
 DEPENDS =	$(PROGS:%=%.depend)
 CS	=	$(PROGS:%=%.c)
+OUTS	=	$(PROGS:%=%.out)
 RESS	=	$(PROGS:%=%.res)
 
 #-----------------------------------------------------------------------------#
 
+$(PROGS): ../clpr/libclpr.a ../libcfloat_lib.a
+
 %.out: %
 	./$< > $@ 2>&1
 
@@ -54,6 +76,9 @@
 
 .PHONY: cs
 cs: $(CS)
+
+.PHONY: outs
+outs: $(OUTS)
 
 .PHONY: clean
 clean:

-- 
Fergus Henderson <fjh at cs.mu.oz.au>   |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>   |  of excellence is a lethal habit"
PGP: finger fjh at 128.250.37.3         |     -- the last words of T. S. Garp.



More information about the developers mailing list