# This is the sample makefile for using a mesa module


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

# STEP 1: get the mesa makefile_header

# define MESA_DIR to be the path to the mesa directory

MESA_DIR = ../..

include $(MESA_DIR)/utils/makefile_header


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

# STEP 2: build the test

TEST = test
TEST_OBJS = sample.o

EOS_CORR = eoscorr
EOS_CORR_OBJS = eos_correction.o

TEST_DIR = ..


all: $(EOS_CORR) $(TEST)

$(EOS_CORR) : $(EOS_CORR_OBJS)
	$(LOADER) $(FCopenmp) -o $(TEST_DIR)/$(EOS_CORR) $(EOS_CORR_OBJS) \
	-L$(MESA_LIB_DIR) $(LOAD_MESA_MICRO)

$(TEST) : $(TEST_OBJS)
	$(LOADER) $(FCopenmp) -o $(TEST_DIR)/$(TEST) $(TEST_OBJS) \
	-L$(MESA_LIB_DIR) $(LOAD_MESA_MICRO)


# for more options, see utils/makefile_header

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

MY_FC_FLAGS = $(FCfree)
SRC_DIR = ../src

%.o: $(SRC_DIR)/%.f
	$(FC) $(FCbasic) $(MY_FC_FLAGS) -I$(MESA_INCLUDE_DIR) -c $<

clean:
	-@rm -f *.o *.mod $(TEST_DIR)/$(TEST)
