# 
# (c) Copyright 1994 OPEN SOFTWARE FOUNDATION, INC.
# (c) Copyright 1994 HEWLETT-PACKARD COMPANY
# (c) Copyright 1994 DIGITAL EQUIPMENT CORPORATION
# To anyone who acknowledges that this file is provided "AS IS"
# without any express or implied warranty:
#                 permission to use, copy, modify, and distribute this
# file for any purpose is hereby granted without fee, provided that
# the above copyright notices and this notice appears in all source
# code copies, and that none of the names of Open Software
# Foundation, Inc., Hewlett-Packard Company, or Digital Equipment
# Corporation be used in advertising or publicity pertaining to
# distribution of the software without specific, written prior
# permission.  Neither Open Software Foundation, Inc., Hewlett-
# Packard Company, nor Digital Equipment Corporation makes any
# representations about the suitability of this software for any
# purpose.
# 

CC	      = gcc
CP	      = cp -p

CFLAGS	      = -I. -I$(INCDIR) -D_BSD -DLINUX -D_REENTRANT -DDEBUGTHREADS -DLINUX_TEST
INCDIR	      = ../inc

DEST	      = .

EXTHDRS	      =

HDRS	      = exc_handling.h \
		pthread_exc.h \
		pthread_np.h \
		pthread_sig.h \
		dcethread.h

INSTALL	      = /usr/bin/install

LIBRARY	      = libpthreads-ext.a

MAKEFILE      = Makefile

OBJS	      = exc_handling.o \
		pthread_exc.o \
		pthread_np.o \
		pthread_sig.o

PRINT	      = pr

PROGRAM       =

SHELL	      = /bin/sh

SRCS	      = exc_handling.c \
		pthread_exc.c \
		pthread_np.c \
		pthread_sig.c

SYSHDRS	      =

all:		copy $(LIBRARY)

$(LIBRARY):	$(OBJS)
		@echo "Loading $(LIBRARY) ..."
		ar cru $(LIBRARY) $(OBJS)
		ranlib $(LIBRARY)
		@echo "done"

clean:;		@rm -f $(OBJS) core

clobber:;	@rm -f $(OBJS) $(LIBRARY) core tags \
		$(INCDIR)/dce/pthread* $(INCDIR)/dce/exc*

depend:;	@mkmf -f $(MAKEFILE) ROOT=$(ROOT)

echo:;		@echo $(HDRS) $(SRCS)

index:;		@ctags -wx $(HDRS) $(SRCS)

install:	$(PROGRAM)
		@echo Installing $(LIBRARY) in $(DEST)
		@if [ $(DEST) != . ]; then \
		(rm -f $(DEST)/$(LIBRARY); $(INSTALL) -f $(DEST) $(LIBRARY)); fi

print:;		@$(PRINT) $(HDRS) $(SRCS)

tags:           $(HDRS) $(SRCS); @ctags $(HDRS) $(SRCS)

update:         $(DEST)/$(LIBRARY)

$(DEST)/$(PROGRAM): $(SRCS) $(LIBS) $(HDRS) $(EXTHDRS)
		@$(MAKE) -f $(MAKEFILE) ROOT=$(ROOT) DEST=$(DEST) install

#
# dependencies and rules
# Dependency doesn't work. Do clean build.
#
copy: $(HDRS)
	$(CP) $(HDRS) $(INCDIR)/dce
	$(CP) $(HDRS) /opt/dcelocal/include/dce
	$(CP) $(LIBRARY) /opt/dcelocal/lib

#
# following dependencies are incomplete
#
###
