# --------------------------------- # # This is the Makefile for EZRide. # # --------------------------------- # # NX, NY defined? # ------------------- # If you wish to specify NX, NY (the number of grid points in each direction) # at compile time, then uncomment the following and set the values to what you # want. They need not all be set. Those that are set will be ignored in # task.dat. # NOPTION = -DNX=61 -DNY=61 # --------------------- # Choose Graphics mode # --------------------- # If you want graphics, define this to 1, otherwise define it to 0: GRAPHICS=1 #--------------------- # Choose Kinetics #--------------------- KINETICS=Barkley #KINETICS=FHN # ------------------- # Choose the compiler # ------------------- # EZRide follows the style of EZSpiral so hopefully # conforms to the ANSI C standard and *should* compile with any C # compiler. # Note however this was mostly tested on Macs # Use at least the -O2 compiler option, the others are optional # options. If you use warning options such as -Wall (which you should use if # you modify the code), then you may get some warnings. These are probably OK. # Compiler flags appropriate for the GNU C compiler # ------------------------------------------------- CC = gcc CFLAGS = -g -O0 -Wall -I/usr/X11R6/include -DFHN=$(KIN) -DGRAPHICS=$(GRAPH) # ------------------------ # Set the linked libraries # ------------------------ # OpenGL with X # ------------- LD_LIBRARY_PATH=/usr/X11R6/lib # The next line is for MacOSX; in normal unix it probably should be something simpler LDFLAGS = -L/usr/X11R6/lib -lGL -lX11 -Wl,-dylib_file,/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib # ----------------------------------------------- # Probably you wont need to change anything below. # ------------------------------------------------ ifeq ($(KINETICS),Barkley) KIN=0 else KIN=1 endif ifeq ($(GRAPHICS),1) GRAPH=1 OBJ=ezride.o ezstep.o ezgraphGL.o eztip.o ezadvec.o ezdrift.o else GRAPH=0 LDFLAGS = -lm OBJ=ezride.o ezstep.o eztip.o ezadvec.o ezdrift.o endif %.o: %.c $(CC) -c $(CFLAGS) $(NOPTION) $< # --------------------- # make the main program # --------------------- # Recompile all in case existing objects were done with different options ezride: tidy $(OBJ) $(CC) $(CFLAGS) $(OBJ) -o $@ $(LDFLAGS) bklride: Makefile $(OBJ) $(MAKE) KINETICS=Barkley ezride cp ezride $@ fhnride: Makefile $(OBJ) $(MAKE) KINETICS=FHN ezride cp ezride $@ # Dependencies # ------------ ezride.o :ezride.h ezstep.o :ezride.h ezstep.h ezgraphGL.o :ezride.h ezgraphGL.h eztip.o :ezride.h ezdrift.o :ezride.h ezadvec.o :ezride.h # --------------------------------------------------- # Various other uses - mainly to clean the program up # --------------------------------------------------- .PHONY: clean tidy man select upload clean: tidy rm -f *.png rm -f core *~ .*~ tidy: rm -f ezride bklride fhnride *.o