# $Id: Makefile,v 1.4 1995/06/22 19:49:55 stuart Exp $

include $(SRCROOT)/src/Configfile

CFLAGS=$(_CFLAGS) $(_CPPFLAGS) $(NOASM)

# Functions form the posix directory.
CALLS1= _exit access alarm brk chdir chmod chown chroot close closedir \
	creat dup dup2 \
        execl execle execv execve fcntl fork fpathconf fstat getcwd \
        getegid geteuid getgid getgroups getpgrp getpid getppid getuid gtty \
        ioctl isatty kill link lseek mkdir mkfifo mknod mktemp \
        mount open opendir pathconf pause pipe \
	ptrace read readdir reboot rename \
        rewinddir rmdir sbrk seekdir setgid setpgid \
	setsid setuid sigaction sigaddset sigdelset \
        sigemptyset sigfillset sigismember sigpending sigprocmask \
        sigreturn sigsuspend sleep stat stime stty sync time times \
        umask umount uname unlink utime wait waitpid write

# Functions from the other directory.
CALLS2=	endpwent getgroups getpwent getpwnam getpwuid killpg setpwent

all:		DATE-$(CCNAME)

DATE-icc:	Makefile
		for call in $(CALLS1) $(CALLS2) ; do \
		  echo $$call: ; \
		  echo extern '$$'_$$call              >  tmp.s ; \
		  echo '$$'$$call:                     >> tmp.s ; \
		  echo global '$$'$$call               >> tmp.s ; \
		  echo patch 6 j codefix '$$'_$$call 0 >> tmp.s ; \
		  echo blkb  6                         >> tmp.s ; \
		  $(CC) -c tmp.s -o !$$call.o ; \
		done
		rm tmp.s
		date > DATE-icc

DATE-lcc:	Makefile
		for call in $(CALLS1) $(CALLS2); \
		do \
		  echo ' equ _'$$call',__'$$call >tmp.s; \
		  $(AS) -o !$$call.o tmp.s ; \
		done
		rm tmp.s
		date > DATE-lcc

ar:		all
		for i in *.o; do rm -f ../tmp/$$i; ln $$i ../tmp/$$i; done

depend:

clean:
		rm -f *.o *.s DATE-*

clobber:	clean
