hillis: implemented partial prefix sums algorithm
[pub/jan/parprog.git] / openmp / prefix / Makefile
index f29e2ef0e1cbb611c4fef164ca5402c0c4ea4d78..ba9a3a65d0918762c8bcea1ddd10232d2ba2ad31 100644 (file)
@@ -1,20 +1,29 @@
 # GCC Makefile
 
 CC      = gcc
-CFLAGS  = -pedantic -Wall -ggdb -fopenmp --std=c99
+CFLAGS  = -pedantic -Wall -ggdb -fopenmp --std=c99 -O3
 LDFLAGS = -fopenmp
 
-BINARIES = prefix
-OBJECTS  = $(BINARIES).o algorithm_1.o algorithm_2.o algorithm_3.o
+all: build/seq build/recurse build/datapar build/hillis
 
-all: prefix
+build/seq: build/prefix.o build/seq.o
+       $(CC) -o $@ $? $(LDFLAGS)
+
+build/recurse: build/prefix.o build/recurse.o
+       $(CC) -o $@ $? $(LDFLAGS)
 
-prefix: prefix.o algorithm_1.o algorithm_2.o algorithm_3.o
+build/datapar: build/prefix.o build/datapar.o
        $(CC) -o $@ $? $(LDFLAGS)
 
-%.o: %.c
-       $(CC) $(CFLAGS) -c $<
+build/hillis: build/prefix.o build/hillis.o
+       $(CC) -o $@ $? $(LDFLAGS)
+
+build/%.o: %.c mkdir
+       $(CC) $(CFLAGS) -c $< -o $@
+
+mkdir:
+       mkdir -p build
 
 .PHONY: clean
 clean:
-       rm -rf $(OBJECTS) $(BINARIES)
+       rm -rf build