# $Id: Makefile,v 1.1.1.1 1996/06/30 15:50:54 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
#  Issaquah, WA
#  29 January, 1996
############################################################################
# $Log: Makefile,v $
# Revision 1.1.1.1  1996/06/30 15:50:54  mtp
# DCE threads for Linux V1.0
#
############################################################################
include     ../Make.defs
MAJOR       = 1
MINOR       = 0
REVISION    = 0
VERSION     = ${MAJOR}.${MINOR}.${REVISION}

HDRS        = ./pthread_socket.h ./pthread_io_delay.h
CFLAGS      += -D_ELF_
LIB_OBJECTS =   ${OBJDIR}/accept.o \
                ${OBJDIR}/connect.o \
                ${OBJDIR}/listen.o \
                ${OBJDIR}/read-write.o \
                ${OBJDIR}/recv.o \
                ${OBJDIR}/recvfrom.o \
                ${OBJDIR}/select.o \
                ${OBJDIR}/send.o \
                ${OBJDIR}/sendto.o \
                ${OBJDIR}/socket.o \
                ${OBJDIR}/sendmsg.o \
                ${OBJDIR}/recvmsg.o \
                ${OBJDIR}/sys_io.o \
                ${OBJDIR}/noblock.o

ifeq (${ISELF},yes)
    CFLAGS         += ${DEFINES} -D_ELF_
    TARGET_LIB      = ../lib/${SOCKLIB}.so.${VERSION}
    LINK            = ../lib/${SOCKLIB}.so.1
else
    TARGET_LIB      = ../lib/${SOCKLIB}.a
endif

${TARGET_LIB}: ${LIB_OBJECTS}

${OBJDIR}/accept.o:     accept.c ${HDRS}
${OBJDIR}/bind.o:       bind.c ${HDRS}
${OBJDIR}/connect.o:    connect.c ${HDRS}
${OBJDIR}/listen.o:     listen.c ${HDRS}
${OBJDIR}/read-write.o: read-write.c ${HDRS}
${OBJDIR}/recv.o:       recv.c ${HDRS}
${OBJDIR}/recvfrom.o:   recvfrom.c ${HDRS}
${OBJDIR}/select.o:     select.c ${HDRS}
${OBJDIR}/send.o:       send.c ${HDRS}
${OBJDIR}/sendto.o:     sendto.c ${HDRS}
${OBJDIR}/socket.o:     socket.c ${HDRS}
${OBJDIR}/sys_io.o:     sys_io.S ${HDRS}
${OBJDIR}/noblock.o:    noblock.c ${HDRS}
${OBJDIR}/sendmsg.o:    sendmsg.c ${HDRS}
${OBJDIR}/recvmsg.o:    recvmsg.c ${HDRS}

all: ${TARGET_LIB} install
	@echo + building ${TARGET_LIB}
ifeq (${ISELF},yes)
	@echo + building ${TARGET_LIB}
	@rm -f ${TARGET_LIB} ${LINK}
	@${CC} -shared -Wl,-soname,${LINK} -o ${TARGET_LIB} ${LIB_OBJECTS}
	@ln -s ${TARGET_LIB} ${LINK}
else
	@ar r ${TARGET_LIB} ${LIB_OBJECTS}    
endif

install:
	@cp -f pthread_socket.h ${INCDIR}

clobber: clean
	@rm -f ${TARGET_LIB} ${LINK} ${INCDIR}/pthread_socket.h ${LIB_OBJECTS}

clean:
	@rm -f *.bak *.rem *~
