#------------------------------------------------------------------------------
# Copyright 1996-2016 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#------------------------------------------------------------------------------
#
#  NSSDC/CDF						zlib makefile.
#
#  Version 1.0, 27-Mar-12, GSFC/SPDF.
#
#  Modification history:
#
#   V1.0  27-Mar-12, M Liu	Original version.
#------------------------------------------------------------------------------

.SILENT:

SHELL=/bin/sh
NULL=true

SRCDIR=
BUILDDIR=
PIC=
CCx=
COPTIONS=
MAKE=make

#INCLUDEzlib=$(SRCDIR)

CC=$(CCx)

CFLAGS=$(COPTIONS) $(PIC) -I$(SRCDIR) -DZ_PREFIX

OBJs= adler32.o inffast.o trees.o crc32.o inflate.o infback.o zutil.o \
deflate.o inftrees.o

ZLIB1h= $(SRCDIR)/zutil.h $(SRCDIR)/zlib.h $(SRCDIR)/zconf.h
ZLIB2h= $(SRCDIR)/inftrees.h $(SRCDIR)/inflate.h $(SRCDIR)/inffast.h

#------------------------------------------------------------------------------
# Compile/link.
#------------------------------------------------------------------------------

all:	$(OBJs)

#.c.o:
#	@echo $(CC) $(CFLAGS) -c $<
#	      $(CC) $(CFLAGS) -c $<

adler32.o: $(SRCDIR)/adler32.c $(ZLIB1h)
	@echo $(CC) $(CFLAGS) -c $(SRCDIR)/adler32.c
	      $(CC) $(CFLAGS) -c $(SRCDIR)/adler32.c
crc32.o: $(SRCDIR)/crc32.c $(ZLIB1h) $(SRCDIR)/crc32.h
	@echo $(CC) $(CFLAGS) -c $(SRCDIR)/crc32.c
	      $(CC) $(CFLAGS) -c $(SRCDIR)/crc32.c
deflate.o: $(SRCDIR)/deflate.c $(ZLIB1h) $(SRCDIR)/deflate.h
	@echo $(CC) $(CFLAGS) -c $(SRCDIR)/deflate.c
	      $(CC) $(CFLAGS) -c $(SRCDIR)/deflate.c
inffast.o: $(SRCDIR)/inffast.c $(ZLIB1h) $(ZLIB2h)
	@echo $(CC) $(CFLAGS) -c $(SRCDIR)/inffast.c
	      $(CC) $(CFLAGS) -c $(SRCDIR)/inffast.c
inflate.o: $(SRCDIR)/inflate.c $(ZLIB1h) $(ZLIB2h)
	@echo $(CC) $(CFLAGS) -c $(SRCDIR)/inflate.c
	      $(CC) $(CFLAGS) -c $(SRCDIR)/inflate.c
infback.o: $(SRCDIR)/infback.c $(ZLIB1h) $(ZLIB2h)
	@echo $(CC) $(CFLAGS) -c $(SRCDIR)/infback.c
	      $(CC) $(CFLAGS) -c $(SRCDIR)/infback.c
inftrees.o: $(SRCDIR)/inftrees.c $(ZLIB1h) $(SRCDIR)/inftrees.h
	@echo $(CC) $(CFLAGS) -c $(SRCDIR)/inftrees.c
	      $(CC) $(CFLAGS) -c $(SRCDIR)/inftrees.c
trees.o: $(SRCDIR)/trees.c $(SRCDIR)/deflate.h $(SRCDIR)/trees.h $(ZLIB1h)
	@echo $(CC) $(CFLAGS) -c $(SRCDIR)/trees.c
	      $(CC) $(CFLAGS) -c $(SRCDIR)/trees.c
zutil.o: $(SRCDIR)/zutil.c $(ZLIB1h)
	@echo $(CC) $(CFLAGS) -c $(SRCDIR)/zutil.c
	      $(CC) $(CFLAGS) -c $(SRCDIR)/zutil.c

#------------------------------------------------------------------------------
# Clean/purge.
#------------------------------------------------------------------------------

clean:
	@-rm -f *.o
	@-rm -f core

purge:
	@-rm -f *~
	@-rm -f *#
