#	@(#)Makefile	5.2 (Berkeley) 3/5/91
#

LIB=pthread
#NOPIC=
# Disable "-pg" style profiling -- mcount isn't likely to be thread-safe.
NOPROFILE=1
CPPFLAGS+= -I${.CURDIR} -I${.CURDIR}/include -I${srcdir}/include -DPTHREAD_KERNEL
CDEBUGFLAGS= @CFLAGS@
CFLAGS+= ${CDEBUGFLAGS}
# This is done by bsd.lib.mk for NetBSD, but never gets done for FreeBSD:
CFLAGS+= ${CPPFLAGS} 

LIBDIR= $(exec_prefix)/lib
BINDIR= $(exec_prefix)/bin
INCDIR= $(exec_prefix)/include
MANDIR= $(exec_prefix)/man

.OBJDIR != if test -d ${.CURDIR}/obj ; then true ; else mkdir ${.CURDIR}/obj || exit 1 ; fi ; echo ${.CURDIR}/obj

# Standard bsd install rules look for the "install" program, rather than
# using some variable.  So, hack things so that that install rule works.
BINGRP != echo " " `groups` " " | sed 's/ [0-9][0-9]* / /g' | awk '{print $$1}'
BINOWN != echo $${USER}
LIBMODE = 644 # so ranlib can run!

.include "config.flags"

# %!$@ pmake seems to automagically cd into the obj directory, so relative 
# srcdir references are completely botched.  Try to figure out an absolute
# pathname for srcdir here, and live with it.
srcdir = $(srctop)

beforeinstall:: install-dirs

.include "${srcdir}/pthreads/Makefile.inc"
.include "${srcdir}/stdlib/Makefile.inc"
.include "${srcdir}/stdio/Makefile.inc"
.include "${srcdir}/string/Makefile.inc"
.include "${srcdir}/gen/Makefile.inc"
.include "${srcdir}/net/Makefile.inc"
.include "${srcdir}/scripts/Makefile.inc"

.include <bsd.lib.mk>

$(OBJS) : $(types) $(paths)

Makefile: ${srcdir}/config/Makefile.in
	cd ${.CURDIR} && sh config.status

all-lib : libpthread.a
install : install-bin install-include
