#-----------------------------------------------------------------------------#
# Copyright (C) 2000, 2002-2004 The University of Melbourne.
# This file may only be copied under the terms of the GNU Library General
# Public License - see the file COPYING.LIB in the Mercury distribution.
#-----------------------------------------------------------------------------#

INSTALL_PREFIX := $(INSTALL_PREFIX)/extras

-include ../Mmake.params

# The following is needed (on some systems) to enable declarations of
# Posix functions in standard C header files.
MGNUCFLAGS = --no-ansi

# 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 
MLOBJS = posix_workarounds.$O
MLPICOBJS = posix_workarounds.$(EXT_FOR_PIC_OBJECTS)

.PHONY: default_target
default_target: all

.PHONY: depend
depend: posix.depend hello.depend

.PHONY: all
all: libposix hello

.PHONY: check
check: hello
	./hello

.PHONY: install
install: libposix.install
	cp $(ADDITIONAL_HDRS) $(INSTALL_PREFIX)/lib/mercury/inc

.PHONY: clean
clean:
	-/bin/rm -f posix_workarounds.$(O)
	-/bin/rm -f posix_workarounds.$(EXT_FOR_PIC_OBJECTS)

.PHONY: realclean
realclean: clean
