# $Id: Makefile,v 1.1.1.1 1996/06/29 01:20:49 mtp Exp $
############################################################################
#    
#  COPYRIGHT NOTICE
#    
#  Copyright (C) 1995, 1996 Michael T. Peterson
#  This file is part of the PCthreads (tm) multithreading library
#  package.
#    
#  The source files and libraries constituting the PCthreads (tm) package
#  are free software; you can redistribute them and/or modify them under
#  the terms of the GNU Library General Public License as published by the Free
#  Software Foundation; either version 2 of the License, or (at your
#  option) any later version.
#    
#  The PCthreads (tm) package is distributed in the hope that it will
#  be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
#  Library General Public License for more details.
#    
#  You should have received a copy of the GNU Library General Public
#  License along with this library (see the file COPYING.LIB); if not,
#  write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge,
#  MA 02139, USA.
#    
#  To report bugs, bug fixes, or provide feedback you may contact the
#  author, Michael T. Peterson, at either of the two email addresses listed
#  below:
#    
#                 mtp@big.aa.net (Preferred)
#                 mtp@zso.dec.com
#    
#    
#  Michael T. Peterson
#  Redmond, WA.
#  12 January, 1996
############################################################################
# $Log: Makefile,v $
# Revision 1.1.1.1  1996/06/29 01:20:49  mtp
# pthreads 1.0 distribution
#
# Revision 1.1.1.1  1996/06/28 15:45:40  mtp
# Official V1.0 Sources
#
# Revision 2.0  1996/06/28 14:57:40  mtp
# + Release 2.0
#
# Revision 1.6  1996/06/28 14:36:12  mtp
# + Changed include directory path for Rules.pthreads
#
# Revision 1.5  1996/01/14 18:07:48  mtp
# + Added copyright and permission notice.
#
# Revision 1.4  1995/12/22 05:01:38  mtp
# + Fixed output of "building libpthread.a".
#
# Revision 1.3  1995/12/18 22:34:25  mtp
# + Minor cosmetic changes
#
# Revision 1.2  1995/12/16 23:15:56  mtp
# + Modified a.out library name to libpthread.a
#
# Revision 1.1.1.1  1995/12/16 21:41:59  mtp
# + Placed under CVS control
#
############################################################################

#  Makefile for POSIX pthreads API
include    ./Rules.lib

SOURCE_DIRS     = asm private public
DOC_DIRS        = man
#LIB             = ${PTHREAD_LIB}
LIB             = ../lib/${PTHREAD_LIBNAME}

all: headers sources docs
ifeq (${ISELF},yes)
	@echo + building ${LIB}.${VERSION}
	@${CC} -shared -Wl,-soname,${LIB}.so.1 \
        -o ${LIB}.${VERSION} ${PTHREAD_OBJS}
	@rm -f ${LIB}.so.1
else
	@echo + building ${LIB}.${VERSION}
	@ar -r ${LIB}.${VERSION} ${PTHREAD_OBJS}
	@ranlib ${LIB}.${VERSION}
endif

headers: ./public/pthread.h ./public/typedefs.h
	@cp -f ./public/pthread.h ${PTHREAD_INCDIR}
	@cp -f ./public/typedefs.h ${PTHREAD_INCDIR}

sources:
	@for dir in ${SOURCE_DIRS}; do \
        (cd $$dir; $(MAKE) all); done

docs:
	@for dir in ${DOC_DIRS}; do \
        (cd $$dir; $(MAKE) all ); done
clean:
	@rm -f *.bak *.rem *~ ${OBJDIR}/libpthread*
	@for dir in asm man private public; do \
        (cd $$dir; $(MAKE) clobber); done
