# Makefile for C++ programming

###################################################
# COMPILER
###################################################

CC = gcc

###################################################
# TARGETS:

TARGETS = fig1.exe fig2.exe

###################################################
# TARGETS
###################################################

all: ${TARGETS}

fig1.exe: fig1.cpp 
	$(CC) $< -std=c++11 -lstdc++ -lmpfr -o $@ 

fig2.exe: fig2.cpp
	$(CC) $< -std=c++11 -lstdc++ -o $@ 
	
###################################################
# Run executable files
###################################################

run:
	# "WE RUN THE PROGRAM TO OBTAIN FIGURE 1"
	./fig1.exe
	# "WE RUN THE PROGRAM TO OBTAIN FIGURE 2"
	./fig2.exe

###################################################
# Clean executable files
###################################################

clean: 
	# remove all executables and text files
	rm -f *.exe
	rm -f *.txt

###################################################
# Phony targets
###################################################

.PHONY: run clean


###################################################
# END
###################################################