# This is the makefile for creating the program that builds the FreeEOS tables

PACKAGE_DIR = ../..
MESA_DIR = ../../..
FREE_EOS_DIR = /opt/mesasdk

#################################################################

# STEP 1: get the standard compiler setup

include $(MESA_DIR)/utils/makefile_header

#################################################################

# STEP 2: info about the libraries

LOAD_OTHER_LIBS = -Wl,--rpath -Wl,$(FREE_EOS_DIR)/lib -L$(FREE_EOS_DIR)/lib -lfree_eos

#################################################################

# STEP 3: build it

OBJS = free_eos_table.o

TABLE = free_eos_table

all : $(TABLE)

$(TABLE) : $(OBJS)
	$(FC) $(FCwarn) $(FCopt) -o ../$(TABLE) $(OBJS) $(LOAD_OTHER_LIBS)


#################################################################

SRC_DIR = ../src

COMPILE = $(FC) $(FCwarn) $(FCopt) -c

free_eos_table.o: $(SRC_DIR)/free_eos_table.f
	$(COMPILE) $(FCfree) $(SRC_DIR)/free_eos_table.f

clean:
	-@rm -f *.o *.f90 *.mod ../$(TABLE)
