[m-dev.] for review: improve extras/posix/Mmakefile

Fergus Henderson fjh at cs.mu.OZ.AU
Mon Dec 11 19:08:16 AEDT 2000


extras/posix/Mmakefile:
	Various improvements:
	- Add an `install' target which installs the Posix library.
	- Add an `all' target that builds `libposix' and `hello',
	  and change the default target from `hello' to `all'.
	  Likewise change the rule for `depend' so that it builds
	  `posix.depend' as well as `hello.depend'.
	- Change the rule for `check' so that it runs `hello'.
	- Use $O and $(EXT_FOR_PIC_OBJECTS) rather than hard-coding `.o'.

Workspace: /home/pgrad/fjh/ws/hg
Index: extras/posix/Mmakefile
===================================================================
RCS file: /home/mercury1/repository/mercury/extras/posix/Mmakefile,v
retrieving revision 1.2
diff -u -d -r1.2 Mmakefile
--- extras/posix/Mmakefile	2000/11/21 23:52:31	1.2
+++ extras/posix/Mmakefile	2000/12/11 08:00:24
@@ -6,20 +6,29 @@
 
 -include ../Mmake.params
 
-MLOBJS = posix_workarounds.o
-MLPICOBJS = posix_workarounds.o
+# This library has some parts that are implemented in C
+# rather than in Mercury.  The following lines ensure that
+# the .h and .o files for those parts get included in the library.
+ADDITIONAL_HDRS = posix_workarounds.h text_header.h
+MLOBJS = posix_workarounds.$O
+MLPICOBJS = posix_workarounds.$(EXT_FOR_PIC_OBJECTS)
 
 .PHONY: default_target
-default_target: hello
+default_target: all
 
 .PHONY: depend
-depend: hello.depend
+depend: posix.depend hello.depend
 
-hello:	posix_workarounds.o
+.PHONY: all
+all: libposix hello
 
 .PHONY: check
-check:
-	true
+check: hello
+	./hello
+
+.PHONY: install
+install: libposix.install
+	cp $(ADDITIONAL_HDRS) $(INSTALL_PREFIX)/lib/mercury/inc
 
 .PHONY: clean
 clean:

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
                                    |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list