# Makefile for "vortex2d", a 2-D vortex flow simulator

# To make a version for debugging or tracing, uncomment this line:
#CFLAGS = -g

# To make a normal version 
CFLAGS = -O

# These two lines should always be uncommented:
OBJS = setup.o writeout.o potflow.o
LIBS = -lm

vortex2d: vortex2d.o $(OBJS)
	cc $(CFLAGS) -o vortex2d vortex2d.o $(OBJS) $(LIBS)
	rm -f *.o
	@echo "vortex2d made"

setup.o: setup.c const.h structs.h
	cc -c $(CFLAGS) setup.c

writeout.o: writeout.c const.h structs.h
	cc -c $(CFLAGS) writeout.c

potflow.o: potflow.c const.h structs.h
	cc -c $(CFLAGS) potflow.c

vortex2d.o: vortex2d.c const.h structs.h
	cc -c $(CFLAGS) vortex2d.c

clean: 
	rm -f *.o 

lint:
	lint -abchp vortex2d.c setup.c writeout.c

