#
# Makefile for OpenMP versions of Mandelbrot program
#
# "make -f Makefile.mandelbrot" or "make  -f Makefile.mandelbrot all" 
#    to make all executables
# "make -f Makefile.mandelbrot clean" to remove executables
#

CSTD=-std=c99
# uncomment if using more-recent gcc
#CSTD=-std=c11

OPT = -O3
CC = gcc
CFLAGS = $(OPT) -Wall -pedantic -fopenmp $(CSTD)

LDFLAGS  = -lm -lX11 -L/usr/X11R6/lib 

ALL = mandelbrot-seq \
	mandelbrot-omp-by-points \
	mandelbrot-omp-by-rows 
HFILES = mandelbrot-gui.h

.PHONY:  all
all:  $(ALL)

%: %.c $(HFILES)
	$(CC) -o $@ $(CFLAGS) $< $(LDFLAGS) 

.PHONY:  clean
clean:
	-rm $(ALL)