#
# Makefile template for a Yorick-based code
#
# $Id: Makefile,v 1.1 1993/09/02 22:48:38 munro Exp munro $

# ---------------------------------------------------------------------------

# The Yorick/include/make.i library file contains interpreted code that can
# find the Maketmpl file at this site, and which can generate portions
# of this Makefile automatically.
MAKE_TEMPLATE = ../yorick/Maketmpl

C_OPTIMIZE=-O
LD_OPTIMIZE=$(C_OPTIMIZE)

CODE_NAME=drat
NON_SHARABLE=unused

OBJS=bound.o track.o trans.o drat.o ydrat.o

CODE_LIBRARY=libdrat.a

PKG_LIBS=-ldrat
PKG_OBJS=

Y_INCLUDE=drat.i
Y_OTHERS=fft.i matrix.i

# Use
# Y_OTHERS=drat.i
# PKG_LIBS=-ldrat
# to put the drat routines into another custom version of Yorick

YWRAP_O=

#SYS_LIBS=/home/munro/efenc205/libefence.a
SYS_LIBS=

CLEAN_UP=$(CODE_NAME)
TIDY_UP=

# ---------------------------------------------------------------------------

# all: $(NON_SHARABLE)
all: $(CODE_LIBRARY) $(CODE_NAME)

libyor: yorpkg $(CODE_LIBRARY)

yorpkg: ../i0/drat.i
	echo "-L../drat $(PKG_LIBS)" >>../yorick/pkg-lib
	echo "../i0/drat.i" >>../yorick/pkg-i

../i0/drat.i: drat.i
	cp drat.i ../i0/drat.i

ZAP_DOTI=../i0/drat.i
yorclean:
	rm -f *~ '#'* *.o *.a core a.out ycode.c $(ZAP_DOTI)

check: all
	./drat -batch check.i
	rm -f junk*

# Note: indirectly included headers separated by three spaces

bound.o: bound.h
track.o: track.h   bound.h
trans.o: trans.h   track.h bound.h
drat.o: drat.h   trans.h track.h bound.h
ydrat.o: drat.h   trans.h track.h bound.h

# my_code2.o: my_code2.c my_code.h
# 	$(CC) $(CFLAGS) -DSPECIAL_SWITCH -c my_code2.c

# ---------------------------------------------------------------------------

include $(MAKE_TEMPLATE)
