Parallel Programming - Make single threaded version
[matches/honours.git] / course / semester2 / pprog / assignment1 / Makefile
index cd6f0fe..b1a9b13 100644 (file)
@@ -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) *~

UCC git Repository :: git.ucc.asn.au