## Copyright (C) 1996 DIMACS Center, Rutgers, The State University of New Jersey
## Author(s): Jonathan Berry
## This software is copyrighted by the DIMACS Center at Rutgers, The State
## University of New Jersey.  IT IS PROVIDED AS IS, AND THE AUTHORS, DIMACS, AND
## RUTGERS, THE STATE UNIVERSITY OF NEW JERSEY  DISCLAIM
## ALL LIABILITY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL
## DAMAGES ARISING OUT OF THE USE OF THIS SOFTWARE, ITS DOCUMENTATION, OR ANY
## DERIVATIVES THEREOF, EVEN IF THE AUTHORS HAVE BEEN ADVISED OF THE
## POSSIBILITY OF SUCH DAMAGE.
## THE AUTHORS AND DISTRIBUTORS SPECIFICALLY DISCLAIM ANY WARRANTIES,
## INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY,
## FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT.  THIS SOFTWARE
## IS PROVIDED ON AN "AS IS" BASIS, AND THE AUTHORS AND DISTRIBUTORS HAVE
## NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR
## MODIFICATIONS.
## The authors hereby grant permission to use, copy, modify, distribute,
## and license this software and its documentation for any purpose, provided
## that existing copyright notices are retained in all copies and that this
## notice is included verbatim in any distributions. No written agreement,
## license, or royalty fee is required for any of the authorized uses.
## Modifications to this software may be copyrighted by their authors
## and need not follow the licensing terms described here, provided that
## the new terms are clearly indicated on the first page of each file where
## they apply.
// Last File Update: 21-Jul-1997
## 
# Parameters.
LINK_LINK.cpp = $(LINK_COMPILE.cpp:-c=)
UI = 
PROGRAM = Link
# Compiler flags.
#LINK_LIBS = libwrappers.a liblayoutstk.a liblayout.a libgenstk.a libgen.a libalgstk.a libalg.a libuserobjstk.a libuserobj.a libgraphstk.a libgraph.a libbasicstk.a libbasic.a libstkWrapper.a 
LINK_LIBS = libLINKgui.a libLINKalganim.a libLINKgraph.a libLINKbasic.a
LDLIBS += $(LINK_LIBS) $(LIBS) 
# Standard targets.
all:	 objects $(PROGRAM)
objects:
	cd layout;$(MAKE) LINK_COMPILE.cpp="$(LINK_COMPILE.cpp)" -f \
                                          Make.layout ../libLINKgui.a
	cd layout;$(MAKE) LINK_COMPILE.cpp="$(LINK_COMPILE.cpp)" -f \
                                          Make.layout ../libLINKalganim.a
	cd generator;$(MAKE) LINK_COMPILE.cpp="$(LINK_COMPILE.cpp)" -f \
                                          Make.generator ../libLINKgui.a
	cd generator;$(MAKE) LINK_COMPILE.cpp="$(LINK_COMPILE.cpp)" -f \
                                          Make.generator ../libLINKalganim.a
	cd algorithm;$(MAKE) LINK_COMPILE.cpp="$(LINK_COMPILE.cpp)" -f \
                                          Make.algorithm ../libLINKgui.a
	cd algorithm;$(MAKE) LINK_COMPILE.cpp="$(LINK_COMPILE.cpp)" -f \
                                          Make.algorithm ../libLINKalganim.a
	cd userobj; $(MAKE) LINK_COMPILE.cpp="$(LINK_COMPILE.cpp)" \
					-f Make.userobj ../libLINKgui.a
	cd userobj; $(MAKE) LINK_COMPILE.cpp="$(LINK_COMPILE.cpp)" \
					-f Make.userobj ../libLINKgraph.a
	cd graph; $(MAKE) LINK_COMPILE.cpp="$(LINK_COMPILE.cpp)" -f Make.graph \
						../libLINKgui.a
	cd graph; $(MAKE) LINK_COMPILE.cpp="$(LINK_COMPILE.cpp)" \
			  LINK_COMPILE.c="$(LINK_COMPILE.c)" -f Make.graph \
						../libLINKgraph.a
	cd basic; $(MAKE) LINK_COMPILE.cpp="$(LINK_COMPILE.cpp)" -f Make.basic \
						../libLINKgui.a
	cd basic; $(MAKE) LINK_COMPILE.cpp="$(LINK_COMPILE.cpp)" -f Make.basic \
						../libLINKbasic.a
	$(LINK_BASE)/bin/genInitFiles basic
	$(LINK_BASE)/bin/genInitFiles graph
	$(LINK_BASE)/bin/genInitFiles userobj
	cd wrappers; $(MAKE) LINK_COMPILE.cpp="$(LINK_COMPILE.cpp)" \
					-f Make.wrappers ../libLINKgui.a
	cd stkWrapper; $(MAKE) LINK_COMPILE.cpp="$(LINK_COMPILE.cpp)" \
					-f Make.stkWrapper ../libLINKgui.a

libalg:
	cd layout;$(MAKE) LINK_COMPILE.cpp="$(LINK_COMPILE.cpp)" -f \
                                                Make.layout ../libLINKalg.a
	cd generator;$(MAKE) LINK_COMPILE.cpp="$(LINK_COMPILE.cpp)" -f \
                                                Make.generator ../libLINKalg.a
	cd algorithm;$(MAKE) LINK_COMPILE.cpp="$(LINK_COMPILE.cpp)" -f \
                                                Make.algorithm ../libLINKalg.a

depend:
	cd basic; $(MAKE) -f Make.basic depend
	cd graph; $(MAKE) -f Make.graph depend
	cd stkWrapper; $(MAKE) -f Make.stkWrapper depend
	cd wrappers; $(MAKE) -f Make.wrappers depend
	cd userobj; $(MAKE) -f Make.userobj depend
	cd algorithm; $(MAKE) -f Make.algorithm depend
	cd generator; $(MAKE) -f Make.generator depend
	cd layout; $(MAKE) -f Make.layout depend
$(PROGRAM): stkWrapper/userinit.o  $(LINK_LIBS)
	$(LINK_LINK.cpp) -o $@ stkWrapper/userinit.o $(LDLIBS)

win32-init:
	cd basic; $(MAKE) LINK_COMPILE.cpp="$(LINK_COMPILE.cpp)" -f Make.basic \
						win32-init
	cd graph; $(MAKE) LINK_COMPILE.cpp="$(LINK_COMPILE.cpp)" -f Make.graph \
						win32-init
	cd userobj; $(MAKE) LINK_COMPILE.cpp="$(LINK_COMPILE.cpp)" -f Make.userobj \
						win32-init

clean:
	cd basic; make -f Make.basic clean
	cd graph;  make -f Make.graph clean
	cd stkWrapper;  make -f Make.stkWrapper clean
	cd wrappers;  make -f Make.wrappers clean
	cd userobj;  make -f Make.userobj clean
	cd algorithm;  make -f Make.algorithm clean
	cd generator;  make -f Make.generator clean
	cd layout;  make -f Make.layout clean
	-rm -rf Link ptrepository
	-rm -f *.a 
