JacobiHPC/Makefile

66 lines
1.2 KiB
Makefile
Raw Normal View History

2016-11-19 18:57:05 +01:00
CC=gcc
CC_OMP=gcc -fopenmp
CC_MPI=mpicc
2016-11-19 14:04:05 +01:00
CFLAGS=-Wall -lm -std=c99
SRC=src
BUILD=build
BIN=bin
2016-11-19 18:57:05 +01:00
all: sequential mpi_line mpi_line_async omp
2016-11-19 14:04:05 +01:00
sequential: config utils main
2016-11-19 15:15:28 +01:00
${CC} ${CFLAGS} \
${BUILD}/config.o \
${BUILD}/utils.o \
${BUILD}/main.o \
${SRC}/impl/sequential.c \
2016-11-19 15:19:37 +01:00
-o ${BIN}/jacobi_sequential
2016-11-19 14:04:05 +01:00
2016-11-19 18:57:05 +01:00
omp: config utils main
${CC_OMP} ${CFLAGS} \
${BUILD}/config.o \
${BUILD}/utils.o \
${BUILD}/main.o \
${SRC}/impl/omp.c \
-o ${BIN}/jacobi_omp
2016-11-19 14:49:50 +01:00
mpi_line: config utils main_mpi
2016-11-19 18:57:05 +01:00
${CC_MPI} ${CFLAGS} \
2016-11-19 15:19:37 +01:00
${BUILD}/config.o \
${BUILD}/utils.o \
${BUILD}/main_mpi.o \
${SRC}/impl/mpi_line.c \
-o ${BIN}/jacobi_mpi_line
2016-11-19 14:04:05 +01:00
2016-11-19 15:15:28 +01:00
mpi_line_async: config utils main_mpi
2016-11-19 18:57:05 +01:00
${CC_MPI} ${CFLAGS} \
2016-11-19 15:19:37 +01:00
${BUILD}/config.o \
${BUILD}/utils.o \
${BUILD}/main_mpi.o \
${SRC}/impl/mpi_line_async.c \
2016-11-19 15:15:28 +01:00
-o ${BIN}/jacobi_mpi_line_async
2016-11-19 14:04:05 +01:00
main: ${SRC}/main.c
2016-11-19 18:57:05 +01:00
${CC_MPI} -c ${CFLAGS} \
2016-11-19 15:19:37 +01:00
${SRC}/main.c \
-o ${BUILD}/main.o
2016-11-19 14:04:05 +01:00
2016-11-19 14:49:50 +01:00
main_mpi: ${SRC}/main_mpi.c
2016-11-19 18:57:05 +01:00
${CC_MPI} -c ${CFLAGS} \
2016-11-19 15:19:37 +01:00
${SRC}/main_mpi.c \
-o ${BUILD}/main_mpi.o
2016-11-19 14:49:50 +01:00
2016-11-19 14:04:05 +01:00
config: ${SRC}/config.c
2016-11-19 18:57:05 +01:00
${CC_MPI} -c ${CFLAGS} \
2016-11-19 15:19:37 +01:00
${SRC}/config.c \
-o ${BUILD}/config.o
2016-11-19 14:04:05 +01:00
utils: ${SRC}/utils.c
2016-11-19 18:57:05 +01:00
${CC_MPI} -c ${CFLAGS} \
2016-11-19 15:19:37 +01:00
${SRC}/utils.c \
-o ${BUILD}/utils.o
2016-11-19 14:04:05 +01:00
.PHONY: clean
clean:
2016-12-01 19:28:54 +01:00
rm build/[^.]* bin/[^.]*