You are here: Home / Teaching Materials / 2015 MESA Summer School / external_code_tutorial

external_code_tutorial

example_makefile

makefile — Makefile, 950 bytes

File contents

# This is the makefile for testing the mesa eos library

#MESA_DIR = ../../..

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

# STEP 1: get the standard compiler setup

include $(MESA_DIR)/utils/makefile_header

ifeq ($(EOS_OFFLOAD),YES)
CC += -Doffload
FC += -Doffload
endif

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

# STEP 2: info about the libraries

#LOAD_LOCAL = -L$(LOCAL_LIB_DIR) -leos
#LOAD_OTHER = -L$(MESA_LIB_DIR) -lchem $(LOAD_MESA_NUMERICS)

LOAD_MESA = $(LOAD_MESA_STAR) $(LOAD_EXTRAS)

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

# STEP 3: build

SAMPLE = sample
SAMPLE_OBJS = sample_eos.o
TEST_DIR = .
	
$(SAMPLE) : $(SAMPLE_OBJS)
	$(LOADER) $(FCopenmp) -o $(TEST_DIR)/$(SAMPLE) $(SAMPLE_OBJS) $(LOAD_MESA)
	
#################################################################

SRC_DIR = .

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