#
# This is the Borland makefile for the planet creator
# It uses a portion of the GIF library v1.2 
# written by Gershon Elber, 1989
#
# Go ahead using other compilers and please send me lots of comments
# and fixes.
#
#	Jouni Aro <jaro@hut.fi>, Dec 1993

# Usage: "make [-DMDL=model]" where model can be l (large) or c (compact) etc.
# Note the MDL is optional with large model as default.

# Works only on TC++ 1.0 make and up - swap out make before invoking command.
#.SWAP

# Your C compiler
CC = bcc

# MDL set?
!if !$d(MDL)
MDL=l
!endif

# Where all the include files are:
INC = -I.

CFLAGS = -m$(MDL) -a- -f- -G -O -r -c -d -w -v- -y- -k- -N-

#
# These are to be made
#
GIF_OBJS  = egif_lib.obj dgif_lib.obj gif_hash.obj gif_err.obj
#   Show me better way if you know one to prepare this line for TLIB:
GIF_POBJS = +egif_lib.obj +dgif_lib.obj +gif_hash.obj +gif_err.obj
GIF_LIB   = giflib_$(MDL).lib
GIF_LIST  = giflib_$(MDL).lst
#This looks weird, right? See explanation below
#OBJS = planet2d.obj pla2gifd.obj getopt.obj alt_code.obj
OBJS = getopt.obj alt_code.obj
EXES = planet.exe pla2gif.exe

# The {$< } is also new to TC++ 1.0 make - remove the { } pair if your make
# choke on them (the { } signals batch mode that combines few operation at the
# same time - very nice feature!).
.c.obj:
	$(CC) $(INC) $(CFLAGS) $<

all: $(GIF_OBJS) $(GIF_LIB) $(OBJS) $(EXES)

$(GIF_LIB): $(GIF_OBJS)
	del $(GIF_LIB)
	tlib $(GIF_LIB) @&&!
$(GIF_POBJS), $(GIF_LIST)
!

egif_lib.obj: gif_lib.h gif_hash.h

dgif_lib.obj: gif_lib.h gif_hash.h

gif_hash.obj: gif_lib.h gif_hash.h

gif_err.obj: gif_lib.h

# For some weird reason I can't make these using all object files
# (Therefore planet2d.c and pla2gifd.c) // The explanation //
planet.exe: planet2d.c alt_code.c getopt.c
	$(CC) -m$(MDL) -eplanet.exe planet2d.c alt_code.obj getopt.obj

pla2gif.exe: pla2gifd.c alt_code.c getopt.c gif_lib.h $(GIF_LIB)
	$(CC) -m$(MDL) -epla2gif.exe pla2gifd.c alt_code.obj getopt.obj $(GIF_LIB)



