#
#  Note: TWODSSM depends on two libraries: 
#  the Gnu Scientific Library (for random numbers) and
#  fftw3 (for Fourier transforms in the potential solver
#  and in the initial conditions.
#
#
CFLAGS = -Ofast -Wall -I/opt/local/include
LDFLAGS = -lgsl -lfftw3 -lm 
CC = gcc
# gcc49 and gcc5 are quite a bit faster.
# CC = gcc49

SRCS = \
main.c bounds.c diag.c dump.c fixup.c image.c init.c \
opac.c perturb_fftw3.c potsolv_fftw3.c remap.c restart.c scaling.c \
set_arrays.c step_cool.c step_ie.c step_pg.c step_trans.c step_visc.c \
stepvar.c sweepx.c sweepy.c sweepym.c timestep.c unroll.c util.c \
zero_arrays.c

OBJS = \
main.o bounds.o diag.o dump.o fixup.o image.o init.o \
opac.o perturb_fftw3.o potsolv_fftw3.o remap.o restart.o scaling.o \
set_arrays.o step_cool.o step_ie.o step_pg.o step_trans.o step_visc.o \
stepvar.o sweepx.o sweepy.o sweepym.o timestep.o unroll.o util.o \
zero_arrays.o

twodssm: $(OBJS) $(SRCS) makefile
	$(CC) $(CFLAGS) -o twodssm $(OBJS) $(LDFLAGS)

# dependencies
$(OBJS) : defs.h decs.h makefile

clean:
	rm *.o 

clear:
	rm imrho????.ppm twodssm dump??? ener.out 

