# makefile for gifscn - GIF scanner and characteristic display

#================> config here
# compile and link options
#  CC - compiler to use
#  BIND - loader (normally cc)
#  CFLAGS - compile flags
#  LFLAGS - loader flags
#  MODEL - flags needed for both compile and load
#
CC		= cc
BIND		= cc
CFLAGS		= -O
LFLAGS		=
MODEL		=

# UNIX object files, and DOS source files
# if your UNIX(r) doesn't have getopt, uncomment it and use this one
UNIXOBJ		= gifscn.o # getopt.o
HDRLST		= defs.h sysexits.h
DOSSRC		= gifscn.c getopt.c
DOCS		= gifscn.doc

# zip archiver and shar programs
ZIP		= zip
SHAR		= shar2 -v
#================> config ends

# things to backup and send out
BKUPLST		= makefile s.gifscn.c getopt.c $(HDRLST) $(DOCS)
SHARLST		= makefile gifscn.c getopt.c $(HDRLST)

# things to make
gifscn:		$(UNIXOBJ)
	$(BIND) -o gifscn $(LFLAGS) $(MODEL) $(UNIXOBJ)

.c~.c:
	get $<

.c.o:
	$(CC) -c $(CFLAGS) $(MODEL) gifscn.c

dos:		gifscn.exe

doszip:		gifscn.exe
	$(ZIP) -u msgifscn gifscn.exe $(DOSSRC) $(HDRLST) makefile $(DOCS)

gifscn.exe:	$(DOSSRC)
	$(CC) -o gifscn.exe -dos $(LFLAGS) $(MODEL) $(CFLAGS) $(DOSSRC)
	rm *.o

# backups and exports
backup:		clean
	$(ZIP) -um gifscn $(BKUPLST)

shar:		clean gifscn.shar

gifscn.shar:	$(SHARLST)
	$(SHAR) $(SHARLST) > gifscn.shar

# file cleanup
clean:
	if [ -f p.gifscn.c ]; then \
	 echo "SCCS source still open"; \
	 exit 1; \
	fi
	rm -f gifscn.c gifscn.exe *.o
