###############################################################################
#
# GISH Shared Function Library
#
# getopt.c is (C) Copyright by the Regents of the University of California.
# See that file for specific copyright information.
#
# Curator:  Warren Gish, gish *AT* ncbi.nlm.nih.gov
###############################################################################
#
# This software depends on the NCBI coretool library.  Make sure a proper
# ncbilcl.h file has been installed for your platform in the coretool library
# before attempting to make this library.

# Point NCBI to the directory containing the ncbi libraries
NCBI = ../ncbi
RANLIB = bin/ranlib
ARFLAGS = cru
GISHLIB = lib/libgish.a
CC = cc
CCOPT = -O
#MKDEPFLAG = -M
# Solaris is different
MKDEPFLAG = -xM
INCLUDE = -I../include -I../ncbi/include
LINKS = ncbi

all: comp/str comp/mem comp/misc comp/sys comp/fct always

str: comp/str always
mem: comp/mem always
misc: comp/misc always
sys: comp/sys always
fct: comp/fct always

always:
	$(RANLIB) $(GISHLIB)

ncbi:
	ln -s $(NCBI) .

comp/str comp/mem comp/misc comp/sys comp/fct: $(LINKS)
	cd $(@F); $(MAKE) $(MFLAGS) CC="$(CC)" CCOPT="$(CCOPT)" INCLUDE="$(INCLUDE)" GISHLIB="../$(GISHLIB)" ARFLAGS="$(ARFLAGS)"

depend: dep/str dep/mem dep/misc dep/sys dep/fct

dep/str dep/mem dep/misc dep/sys dep/fct: $(LINKS)
	cd $(@F); $(MAKE) $(MFLAGS) depend CC="$(CC)" MKDEPFLAG="$(MKDEPFLAG)" INCLUDE="$(INCLUDE)"

clean: clean/str clean/mem clean/misc clean/sys clean/fct
	- rm -f $(LINKS) $(GISHLIB)

clean/str clean/mem clean/misc clean/sys clean/fct:
	cd $(@F); $(MAKE) $(MFLAGS) clean

