JacobiHPC/Makefile

91 lines
1.7 KiB
Makefile
Raw Normal View History

2016-11-19 18:57:05 +01:00
CC=gcc
CC_OMP=gcc -fopenmp
CC_MPI=mpicc
2017-01-22 01:02:17 +01:00
CC_CUDA=nvcc
2016-11-19 14:04:05 +01:00
CFLAGS=-Wall -lm -std=c99
SRC=src
BUILD=build
2017-01-22 01:02:17 +01:00
BUILD_CUDA=build_cuda
2016-11-19 14:04:05 +01:00
BIN=bin
2017-01-22 01:02:17 +01:00
all: sequential mpi omp sse cuda
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
2017-01-22 01:02:17 +01:00
cuda: config_cuda utils_cuda main_cuda
${CC_CUDA} \
${BUILD_CUDA}/config.o \
${BUILD_CUDA}/utils.o \
${BUILD_CUDA}/main.o \
${SRC}/impl/cuda.cu \
-o ${BIN}/jacobi_cuda
2016-12-13 18:13:22 +01:00
sse: config utils main
2017-01-22 01:02:17 +01:00
${CC} ${CFLAGS} \
2016-12-13 18:13:22 +01:00
${BUILD}/config.o \
${BUILD}/utils.o \
${BUILD}/main.o \
${SRC}/impl/sse.c \
-o ${BIN}/jacobi_sse
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
2017-01-22 01:02:17 +01:00
mpi: 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 \
2017-01-22 01:02:17 +01:00
${SRC}/impl/mpi.c \
-o ${BIN}/jacobi_mpi
2016-11-19 15:15:28 +01:00
2016-12-01 19:44:37 +01:00
main: ${SRC}/main/main.c
2016-11-19 18:57:05 +01:00
${CC_MPI} -c ${CFLAGS} \
2016-12-01 19:44:37 +01:00
${SRC}/main/main.c \
2016-11-19 15:19:37 +01:00
-o ${BUILD}/main.o
2016-11-19 14:04:05 +01:00
2016-12-01 19:44:37 +01:00
main_mpi: ${SRC}/main/main_mpi.c
2016-11-19 18:57:05 +01:00
${CC_MPI} -c ${CFLAGS} \
2016-12-01 19:44:37 +01:00
${SRC}/main/main_mpi.c \
2016-11-19 15:19:37 +01:00
-o ${BUILD}/main_mpi.o
2016-11-19 14:49:50 +01:00
2017-01-22 01:02:17 +01:00
main_cuda: ${SRC}/main/main.cu
${CC_CUDA} -c \
${SRC}/main/main.cu \
-o ${BUILD_CUDA}/main.o
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
2017-01-22 01:02:17 +01:00
config_cuda: ${SRC}/config.cu
${CC_CUDA} -c \
${SRC}/config.cu \
-o ${BUILD_CUDA}/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
2017-01-22 01:02:17 +01:00
utils_cuda: ${SRC}/utils.cu
${CC_CUDA} -c \
${SRC}/utils.cu \
-o ${BUILD_CUDA}/utils.o
2016-11-19 14:04:05 +01:00
.PHONY: clean
clean:
2017-01-22 01:02:17 +01:00
rm build/[^.]* build_cuda/[^.]* bin/[^.]*