-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
52 lines (40 loc) · 1.55 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# path macros
BIN_PATH := bin
OBJ_PATH := obj
SRC_PATH := src
DBG_PATH := debug
#tool macros
CC := gcc
CC_MPI := mpicc
OMP_FLAGS := -fopenmp -std=gnu99
MPI_FLAGS := -std=gnu99
LDLIBS := -lm
DBG_FLAGS := -g
.PHONY: clean serial debug
all: kdtree_omp kdtree_mpi
kdtree_omp: kdtree_omp.o
${CC} ${OMP_FLAGS} -o ${BIN_PATH}/kdtree_omp.out ${OBJ_PATH}/kdtree_omp.o
kdtree_mpi: kdtree_mpi.o
${CC_MPI} -o ${BIN_PATH}/kdtree_mpi.out ${OBJ_PATH}/kdtree_mpi.o ${LDLIBS}
kdtree_omp.o: ${SRC_PATH}/kdtree_omp.c
${CC} ${OMP_FLAGS} -o ${OBJ_PATH}/kdtree_omp.o -c ${SRC_PATH}/kdtree_omp.c
kdtree_mpi.o: ${SRC_PATH}/kdtree_mpi.c
${CC_MPI} ${MPI_FLAGS} -o ${OBJ_PATH}/kdtree_mpi.o -c ${SRC_PATH}/kdtree_mpi.c
serial: kdtree_serial.o
${CC} ${OMP_FLAGS} -o ${BIN_PATH}/kdtree_serial.out ${OBJ_PATH}/kdtree_serial.o
kdtree_serial.o: ${SRC_PATH}/kdtree.c
${CC} -o ${OBJ_PATH}/kdtree_serial.o -c ${SRC_PATH}/kdtree.c
debug:
${CC} ${DBG_FLAGS} ${OMP_FLAGS} -o ${DBG_PATH}/kdtree_omp.out ${SRC_PATH}/kdtree_omp.c
${CC_MPI} ${DBG_FLAGS} ${MPI_FLAGS} -o ${DBG_PATH}/kdtree_mpi.out ${SRC_PATH}/kdtree_mpi.c ${LDLIBS}
view:
${CC} ${OMP_FLAGS} -D DEBUG -o ${OBJ_PATH}/kdtree_omp.o -c ${SRC_PATH}/kdtree_omp.c
${CC} ${OMP_FLAGS} -o ${BIN_PATH}/kdtree_omp.out ${OBJ_PATH}/kdtree_omp.o
${CC_MPI} ${MPI_FLAGS} -D DEBUG -o ${OBJ_PATH}/kdtree_mpi.o -c ${SRC_PATH}/kdtree_mpi.c
${CC_MPI} -o ${BIN_PATH}/kdtree_mpi.out ${OBJ_PATH}/kdtree_mpi.o ${LDLIBS}
clean:
@echo "Removing all the objects and binaries..."
rm -f ${BIN_PATH}/*.out
rm -f ${OBJ_PATH}/*.o
rm -f ${DBG_PATH}/*.out
@echo "Done!"