# Makefile for Tim Tuttle's C library routines
# Be sure to put the file nrutil.c first in the OBJS
# list so that all of the other functions which use
# numerical-recipies' subroutines will have access to
# the functions in nrutil.c.
#
# Copyright 1993 Massachusetts Institute of Technology
#

CFLAGS	=	-O

# Library Files
LIBS	=	-lm

# Compiler to use (cc or gcc)
CC	=	gcc

# Directories that contain include files
INCLUDEDIR = 	-I/usr/include/X11 \
		-I/usr/local/include \
		-I/usr/local/include/X11 \
		-I/usr/local/include/X11/Xaw

# Alias for pathname of numerical recipies library
NRLIBPATH = 	/com/ftp/pub/users/tut/hdsim/nrlib

OBJS = hd_model.o nrutil.o fft_functions.o ${MYLIBPATH}/generic_functions.o
SRCS = example.c nrutil.c fft_functions.c ${MYLIBPATH}/generic_functions.c

OBJS1 = hd_model.o \
	${NRLIBPATH}/nrutil.o \
	${NRLIBPATH}/odeint.o \
	${NRLIBPATH}/rkqc.o \
	${NRLIBPATH}/rk4.o \
	${NRLIBPATH}/generic_functions.o
SRCS1 = hd_model.c \
	${NRLIBPATH}/nrutil.c \
	${NRLIBPATH}/odeint.o \
	${NRLIBPATH}/rkqc.c \
	${NRLIBPATH}/rk4.c \
	${NRLIBPATH}/generic_functions.c

# Default make command
all: hd_model

# Make command to compile hd_model with dependencies
hd_model: ${OBJS1}
	${CC} -o hd_model ${OBJS1} ${LIBS}

# Make command to compile all .c files into .o files
.c.o:
	${CC} -c -o $*.o $*.c ${CFLAGS} ${INCLUDEDIR}

# Make command to clean up directory
clean:
	rm -f core  *.o *~ #* *.~?~

