Merge branch 'master' of git.ucc.asn.au:/matches/honours
[matches/honours.git] / course / semester2 / pprog / assignment1 / Makefile
index c164624..c66787e 100644 (file)
@@ -1,23 +1,18 @@
-#Makefile for nbody program
+# Makefile to build all programs
 
-CXX = gcc
-LIBRARIES = -lm -lGL -lglut -lGLU -lpthread
-FLAGS = --std=c99 -Wall -pedantic -g
-PREPROCESSOR_FLAGS = -fopenmp
-LINK_OBJ = main.o nbody.o graphics.o
+all : single-thread/nbody mthread/nbody openmp/nbody
 
-BIN = nbody
+single-thread/nbody :
+       make -C single-thread
 
-$(BIN) : $(LINK_OBJ) 
-       $(CXX) -o $(BIN) $(LINK_OBJ) $(LIBRARIES)
+mthread/nbody :
+       make -C mthread
 
-%.o : %.c
-       $(CXX) $(FLAGS) $(PREPROCESSOR_FLAGS) -c $<
+openmp/nbody : 
+       make -C openmp
 
 clean :
-       $(RM) $(BIN) $(OBJ) $(LINK_OBJ)
-
-clean_full: #cleans up all backup files
-       $(RM) $(BIN) $(OBJ) $(LINK_OBJ)
-       $(RM) *.*~
-       $(RM) *~
+       make -C single-thread clean_full
+       make -C mthread clean_full
+       make -C openmp clean_full
+       rm *~

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