######################################################################
##
## Copyright (c) 1994  Carnegie Mellon University
## All rights reserved.
## 
## Use and copying of this software and preparation of derivative
## works based on this software are permitted, including commercial
## use, provided that the following conditions are observed:
## 
## 1. This copyright notice must be retained in full on any copies
##    and on appropriate parts of any derivative works.
## 2. Documentation (paper or online) accompanying any system that
##    incorporates this software, or any part of it, must acknowledge
##    the contribution of the Gwydion Project at Carnegie Mellon
##    University.
## 
## This software is made available "as is".  Neither the authors nor
## Carnegie Mellon University make any warranty about the software,
## its performance, or its conformity to any specification.
## 
## Bug reports, questions, comments, and suggestions should be sent by
## E-mail to the Internet address "gwydion-bugs@cs.cmu.edu".
##
######################################################################
##
##  $Header: Makefile.in
##
##  This is the makefile for the Mindy compatability library.
##

SHELL	=	f:\os2\cmd.exe

##
## begin autoconf'ed source
##

prefix	=		c:/bin/languages/mindy
exec_prefix	=	${prefix}
srcdir	=		.

SRCDIR	=		${srcdir}
BINDIR	=		${exec_prefix}/bin
LIBDIR	=		${exec_prefix}/lib/mindy

AR      =               ar
CC	=		gcc
CCOPTS	=		-g -O4 -finline-functions -Wall -Zmt
CFLAGS	=		$(CCOPTS) -I${SRCDIR} -DNO_BSTRING_H=1 -DNO_STDLIB_H=1 -DNEED_MATHERR=1 -DBINDIR=\"${BINDIR}\" -DLIBDIR=\"${LIBDIR}\"
YACC	=		bison -y
YFLAGS	=		-d
LEX	=		flex
LFLAGS	=		-i
RANLIB	=		ranlib
INSTALL	=		cp
INSTALL_PROGRAM	=	cp
INSTALL_DATA	=	cp

LIBOBJS =		strerror.o memmove.o strtoul.o matherr.o
LIBS	=		-lm

##
## end of configure written portion
##

OBJS	=	${LIBOBJS} protected.o

SRCS	=	getcwd.c strerror.c strtod.c strtoul.c waitpid.c \
		opendir.c strstr.c strtol.c tmpnam.c sigaction.c \
		protected.c matherr.c memmove.c setsid.c

ALLOBJS	=	getcwd.o strerror.o strtod.o strtoul.o waitpid.o \
		opendir.o strstr.o strtol.o tmpnam.o sigaction.o \
		protected.o matherr.o memmove.o setsid.c

libcompat.a: ${OBJS}
	${AR} rus libcompat.a ${OBJS}

allobjs: ${ALLOBJS}


clean:
	rm -f ${OBJS} libcompat.a  *~ \#* core

realclean:
	rm -f ${OBJS} libcompat.a Makefile *~ \#* core
	
install:

# It's easiest to generate this part by machine.
# Try gcc -MM -E *.c | perl ../etc/generate-depends

getcwd.o:  ${SRCDIR}/getcwd.c ${SRCDIR}/std-c.h ${SRCDIR}/std-os.h
	${CC} -c ${CFLAGS} ${SRCDIR}/getcwd.c

matherr.o:  ${SRCDIR}/matherr.c ${SRCDIR}/std-c.h ${SRCDIR}/std-os.h
	${CC} -c ${CFLAGS} ${SRCDIR}/matherr.c

memmove.o:  ${SRCDIR}/memmove.c ${SRCDIR}/std-c.h
	${CC} -c ${CFLAGS} ${SRCDIR}/memmove.c

opendir.o:  ${SRCDIR}/opendir.c ${SRCDIR}/std-c.h ${SRCDIR}/std-os.h
	${CC} -c ${CFLAGS} ${SRCDIR}/opendir.c

protected.o:  ${SRCDIR}/protected.c ${SRCDIR}/std-c.h ${SRCDIR}/std-os.h
	${CC} -c ${CFLAGS} ${SRCDIR}/protected.c

rint.o:  ${SRCDIR}/rint.c
	${CC} -c ${CFLAGS} ${SRCDIR}/rint.c

setsid.o:  ${SRCDIR}/setsid.c ${SRCDIR}/std-c.h ${SRCDIR}/std-os.h
	${CC} -c ${CFLAGS} ${SRCDIR}/setsid.c

sigaction.o:  ${SRCDIR}/sigaction.c ${SRCDIR}/std-signal.h
	${CC} -c ${CFLAGS} ${SRCDIR}/sigaction.c

strerror.o:  ${SRCDIR}/strerror.c ${SRCDIR}/std-c.h ${SRCDIR}/std-os.h
	${CC} -c ${CFLAGS} ${SRCDIR}/strerror.c

strstr.o:  ${SRCDIR}/strstr.c
	${CC} -c ${CFLAGS} ${SRCDIR}/strstr.c

strtod.o:  ${SRCDIR}/strtod.c ${SRCDIR}/std-c.h
	${CC} -c ${CFLAGS} ${SRCDIR}/strtod.c

strtol.o:  ${SRCDIR}/strtol.c
	${CC} -c ${CFLAGS} ${SRCDIR}/strtol.c

strtoul.o:  ${SRCDIR}/strtoul.c
	${CC} -c ${CFLAGS} ${SRCDIR}/strtoul.c

tmpnam.o:  ${SRCDIR}/tmpnam.c
	${CC} -c ${CFLAGS} ${SRCDIR}/tmpnam.c

waitpid.o:  ${SRCDIR}/waitpid.c ${SRCDIR}/std-c.h ${SRCDIR}/std-os.h
	${CC} -c ${CFLAGS} ${SRCDIR}/waitpid.c

