#
# Makefile	15 May 1990 David G. Grubbs (-dgg-)
#
# Create a unix support library and copy up a few important files.
#
# "cd" to this directory below the main PERL directory, then type
# "make".  It will build the library and copy the needed files up to the
# "perl" working directory.  If that fails (which it will if you are not
# using the ARP "copy" command), copy all the files listed in the "copyup"
# step to the Main PERL directory.
#
# Then "cd" to the main PERL directory and type "make".
#

CC = cc
CFLAGS = -O

ulibh = dir.h stat.h

# The order of these is designed to allow a single pass through the library.
ulibc = utime.c mypopen.c pipe.c getlogin.c wildexpand.c \
	dup.c dir.c stat.c mkdir.c \
	amigaizepath.c chmod.c close.c cmdexists.c getenv.c \
	getopt.c kill.c mktemp.c pid.c rmdir.c send_packet.c setenv.c \
	sleep.c stamp.c stubs.c syscall.c umask.c

ulibo = utime.o mypopen.o pipe.o getlogin.o wildexpand.o \
	dup.o dir.o stat.o mkdir.o \
	amigaizepath.o chmod.o close.o cmdexists.o getenv.o \
	getopt.o kill.o mktemp.o pid.o rmdir.o send_packet.o setenv.o \
	sleep.o stamp.o stubs.o syscall.o umask.o wildexpand.o

.c.o:
	$(CC) -c $(CFLAGS) $*.c

all: unix.lib copyup

# If you want to make a library
unix.lib: $(ulibo)
	-delete unix.lib
	lb unix.lib $(ulibo)

# Copy files to "Parent dir" ('/' on the Amiga").
copyup:
	-copy Makefile.perl /Makefile
	-copy config.sh /
	-copy spawn.c /

clean:
	-delete AztecC.err
	-delete $(ulibo)
	-delete unix.lib
