X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=course%2Fsemester2%2Fpprog%2Fassignment1%2FMakefile;h=b1a9b132c63c8c01c4cfa778fbecc38f640063f4;hb=1612d2449b7c9e4fa202adac00cda23700df44c7;hp=cd6f0fee4aa4de29017185e486e58ff2b3fb83b4;hpb=4aead302e9872ec0a42724a61589275569c4e783;p=matches%2Fhonours.git diff --git a/course/semester2/pprog/assignment1/Makefile b/course/semester2/pprog/assignment1/Makefile index cd6f0fee..b1a9b132 100644 --- a/course/semester2/pprog/assignment1/Makefile +++ b/course/semester2/pprog/assignment1/Makefile @@ -1,45 +1,20 @@ -INCLUDE_PATH = -I/usr/include -LIBRARY_PATH = -L/usr/lib64 -CCFLAGS = -std=c99 #-framework GLUT -framework OpenGL -framework Cocoa -LDFLAGS = -lglut -lGL -lGLU -lpthread -lm +#Makefile for nbody program -# the directories containing the OpenGL libraries, f90gl libraries, GLUT -# libraries, and f90gl GLUT libraries -OGLLIBDIR = -L/usr/X11/lib +CXX = gcc --std=c99 -Wall -pedantic -g -lm -lGL -lglut -lGLU -lpthread -fopenmp +LINK_OBJ = main.o nbody.o graphics.o -# the fortran 90 libraries for OpenGL, including GLUT, GLU and OpenGL -F90GLUTLIB = -lf90glut -lf90GLU -lf90GL +BIN = nbody -# the X11 libraries -X11LIB = -framework GLUT -framework OpenGL -framework Cocoa +$(BIN) : $(OBJ) + $(CXX) -o $(BIN) $(OBJ) -# the f90 compiler flag for specifying the location of MOD files -MODS = -I/usr/X11/include/GL +%.o : %.c + $(CXX) -c $< -# the directory containing the X11 libraries -X11LIBDIR = - -# fortran 90 compiler and compiler flags -F95 = g95 -F90 = /usr/local/gfortran/bin/gfortran -F90FLAGS = -O -F90FLAGS2 = -fopenmp -O -GCC = gcc - -APP = nbody - -all: $(APP) - @echo Make done - -#%: %.c -# gcc $^ -o $@ $(INCLUDE_PATH) $(CCFLAGS) $(LIBRARY_PATH) $(LDFLAGS) - -clean: - @rm -f *.o $(APP) - -nbodyf: nbodyf.f90 - $(F90) nbodyf.f90 -o nbodyf $(F90FLAGS) $(MODS) $(OGLLIBDIR) $(F90GLUTLIB) $(X11LIBDIR) $(X11LIB) - -nbody: nbody.c - $(GCC) -o nbody nbody.c $(INCLUDE_PATH) $(CCFLAGS) $(LIBRARY_PATH) $(LDFLAGS) +clean : + $(RM) $(BIN) $(OBJ) $(LINKOBJ) +clean_full: #cleans up all backup files + $(RM) $(BIN) $(OBJ) $(LINKOBJ) + $(RM) *.*~ + $(RM) *~