#
# This is the unix makefile for the planet creator
# It uses a small portion of the GIF library v1.2 
# written by Gershon Elber, 1989
#
# I have tested it using xlc on a RS6000 and gcc on HP700, should work.
#
# Go ahead using other systems and please send me lots of comments
# and fixes.
#
#	Jouni Aro <jaro@hut.fi>, Dec 1993


# Where are all the include files and libraries:
INC = -I.

# These are the flags for gcc, in BSD4.3 or Sun O.S. 4.0.3
#
# If your system has all function prototypes for gcc, replace all
# the -Wxxx with -Wall. I can not add -Wimplicit as my system uses old cc
# h files.
#
#
CC = gcc
#
CFLAGS = -O -c -Wall
# CFLAGS = -g -pg -c -W -Wreturn-type -Wcomment

# These are the flags for xlc, ansi compiler for IBM R6000
#
# CC = xlc
#
# CFLAGS = -O -c -qnoro -D_POSIX_SOURCE -D_ALL_SOURCE -DR6000
# CFLAGS = -g -pg -c -qnoro -D_POSIX_SOURCE -D_ALL_SOURCE -DR6000
# MORELIBS =

#
# These are to be made
#
GIF_OBJS = egif_lib.o dgif_lib.o gif_hash.o gif_err.o
GIF_LIB = libgif_.a
OBJS = planet2d.o pla2gifd.o alt_code.o
EXEC  = planet pla2gif

.c.o:
	$(CC) $(CFLAGS) $(INC) $<

all: $(GIF_OBJS) $(GIF_LIB) $(OBJS) $(EXEC)

$(GIF_LIB): $(GIF_OBJS)
	rm -f libgif_.a
	ar rcv libgif_.a *.o
	-ranlib libgif_.a

egif_lib.o: gif_lib.h gif_hash.h
dgif_lib.o: gif_lib.h gif_hash.h
gif_hash.o: gif_lib.h gif_hash.h
gif_err.o: gif_lib.h

planet:	planet2d.c alt_code.c
	$(CC) planet2d.o alt_code.o -o planet -lm

pla2gif: pla2gifd.c alt_code.c gif_lib.h $(GIF_LIB)
	$(CC) pla2gifd.o alt_code.o -o pla2gif $(GIF_LIB)



