# Makefile for cslib/simplified directory
# Last modified on Tue Aug  2 10:18:12 1994 by eroberts
#****************************************************************

CONTENTS = \
    Makefile README genlib.c genlib.h graphics.c graphics.h \
    random.c random.h simpio.c simpio.h strlib.c strlib.h

OBJECTS = \
    genlib.o \
    strlib.o \
    simpio.o \
    random.o \
    graphics.o

CSLIB = cslib.a

SHAR = ../shar/simplified.shar

CC = gcc
CFLAGS = -g -I. $(CCFLAGS)

# ***************************************************************
# Entry to bring the package up to date
#    The "make all" entry should be the first real entry

all: $(CSLIB)

# ***************************************************************
# Standard entries to remove files from the directories
#    tidy    -- eliminate unwanted files
#    scratch -- delete derived files in preparation for rebuild

tidy:
	rm -f ,* .,* *~ core a.out *.err

scratch: tidy
	rm -f *.o *.a

# ***************************************************************
# C compilations

genlib.o: genlib.c genlib.h
	$(CC) $(CFLAGS) -c genlib.c

strlib.o: strlib.c strlib.h genlib.h
	$(CC) $(CFLAGS) -c strlib.c

simpio.o: simpio.c simpio.h strlib.h genlib.h
	$(CC) $(CFLAGS) -c simpio.c

graphics.o: graphics.c graphics.h genlib.h
	$(CC) $(CFLAGS) -c graphics.c

random.o: random.c random.h genlib.h
	$(CC) $(CFLAGS) -c random.c

# ***************************************************************
# Entry to reconstruct the library archive

$(CSLIB): $(OBJECTS)
	-rm -f $(CSLIB)
	ar cr $(CSLIB) $(OBJECTS)
	ranlib $(CSLIB)

# ***************************************************************
# Entries to construct a shar file of the entire contents

shar: $(SHAR)

$(SHAR): $(CONTENTS)
	shar $(CONTENTS) > $(SHAR)
