# 
# Mach Operating System
# Copyright (c) 1992 Carnegie Mellon University
# All Rights Reserved.
# 
# Permission to use, copy, modify and distribute this software and its
# documentation is hereby granted, provided that both the copyright
# notice and this permission notice appear in all copies of the
# software, derivative works or modified versions, and any portions
# thereof, and that both notices appear in supporting documentation.
# 
# CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
# CONDITION.  CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
# ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
# 
# Carnegie Mellon requests users of this software to return to
# 
#  Software Distribution Coordinator  or  Software.Distribution@CS.CMU.EDU
#  School of Computer Science
#  Carnegie Mellon University
#  Pittsburgh PA 15213-3890
# 
# any improvements or extensions that they make and grant Carnegie Mellon
# the rights to redistribute these changes.
# 
#
# HISTORY
# $Log:	Makefile-host-lib,v $
# Revision 2.2  92/04/08  23:26:51  rpd
# 	Created.
# 	[92/04/01            rpd]
# 

# Makefile-host-lib is used as Makefile-lib,
# except that it is intended for host-machine libraries.

HOST_ILIBTARGET = ${HOST_INSTALLDIR}/${LIBDIR}${LIBRARY}

HOST_TLIBTARGET = ${HOST_TRELEASEDIR}/${LIBDIR}${LIBRARY}

HOST_FLIBTARGET = ${HOST_FRELEASEDIR}/${LIBDIR}${LIBRARY}

# Top-level targets:
# If the Makefile wants to do more stuff, it can also have its own
# all/install/release/clean rules.

all :: ${LIBRARY}

install :: ${HOST_ILIBTARGET}

release :: ${HOST_TLIBTARGET}

clean ::
	${RM} ${HOST_ILIBTARGET}

# installation rules

${HOST_ILIBTARGET} : ${LIBRARY}
	${RM} $@
	${CP} $? $@
	${CHMOD_LIB} $@

# release rules

${HOST_TLIBTARGET} : ${HOST_FLIBTARGET}
	${RM} $@
	${CP} $? $@

# build rules

${LIBRARY} : ${OBJECTS}
	${RM} $@
	${HOST_AR} cq $@ ${OBJECTS}
	${HOST_RANLIB} $@

.c.o:
	${USE_HOST_PATHS} ${HOST_CC} -c ${HOST_CFLAGS} $*.c

.s.o:
	${USE_HOST_PATHS} \
	${HOST_ASCPP} -MD -DASSEMBLER ${DEFS} ${INCS} $*.s > $*.as
	${HOST_AS} ${HOST_ASFLAGS} -o $*.o $*.as
	${RM} $*.as
