# === Makefile ================================================================
# Copyright (c) 1991, 1992, 1993 Chris Provenzano, proven@athena.mit.edu
#
#	Description: This file is for creating libpthread.a
#
#	1.00 93/07/15 proven
#		-Initial cut for pthreads.
#
#	1.10 93/07/15 proven
#		-Reorg, of build procedures
#

          AR = ar
          AS = gas
          CC = gcc
         CPP = $(CC) -E -I$(INCDIR)
      CFLAGS = -c -g -O -I../include -DPTHREAD_KERNEL
 CDEBUGFLAGS = -g -DDEBUG		# -g, -O, -DDEBUG
          LD = gld

        CSRC = ttyname.c directory.c popen.c

     HEADERS = queue.h mutex.h machdep.h

        OBJS = ttyname.o directory.o popen.o

       LINKS =

   LIBRARIES = 

################################################################################
#
# Here starts the nitty grity part of the Makefile.

REALOBJS = $(addprefix ../, $(OBJS))

all: $(REALOBJS)

clean: 
	rm -f $(OBJS) a.out core maketmp makeout

depend:
	sed '/\#\#\# Dependencies/q' < Makefile > maketmp
	(for i in $(CSRC);do $(CPP) -M $$i;done) >> maketmp
	cp maketmp Makefile

install: all 
	install mylib.a $(LIBDIR)

realclean: clean
	rm -f $(LIBRARIES) $(BINARIES) $(LINKS)

../%.o: %.S
	$(CC) $(CFLAGS) -c $< -o $@

../%.o: %.c
	$(CC) $(CFLAGS) -c $< -o $@

# For some machines it is necessary to do the following to compile the .S
# Architects include hppa
#	$(CC) $(CFLAGS) -E syscall.S > ../syscall.s
#	as ../syscall.s -o ../syscall.o
#	rm ../syscall.s

################################################################################
### Do not remove the following line. It is for depend #########################
### Dependencies:
