-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
70 lines (49 loc) · 1.75 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
CC=gcc
MPICC=mpicc
CFLAGS=-Wall -falign-functions -falign-loops -funroll-all-loops -std=gnu99 -O3
DEBUG=yes
ifeq ($(DEBUG),yes)
CFLAGS= -g -Wall -falign-functions -falign-loops -funroll-all-loops -std=gnu99 -O3
endif
INCPATH=inc
SRCPATH=src
OBJPATH=obj
BINPATH=bin
INCLUDES=-I ./$(INCPATH)
.PHONY: exe clean realclean
#==========
exe: $(BINPATH)/path-omp \
$(BINPATH)/path-mpi \
$(BINPATH)/path-mpi-complex \
$(BINPATH)/floyd_serial \
$(BINPATH)/floyd_omp
$(BINPATH)/path-omp: $(OBJPATH)/path-omp.o $(OBJPATH)/mt19937p.o
$(CC) -fopenmp $(CFLAGS) -o $@ $^
$(BINPATH)/floyd_omp: $(OBJPATH)/floyd_omp.o $(OBJPATH)/mt19937p.o
$(CC) -fopenmp $(CFLAGS) -o $@ $^
$(BINPATH)/floyd_serial: $(OBJPATH)/floyd_serial.o $(OBJPATH)/mt19937p.o
$(CC) $(CFLAGS) -o $@ $^
$(BINPATH)/path-mpi: $(OBJPATH)/path-mpi.o $(OBJPATH)/mt19937p.o
$(MPICC) $(CFLAGS) -o $@ $^
$(BINPATH)/path-mpi-complex: $(OBJPATH)/path-mpi-complex.o $(OBJPATH)/mt19937p.o
$(MPICC) $(CFLAGS) -o $@ $^
$(OBJPATH)/path-omp.o: $(SRCPATH)/path-omp.c
$(CC) -c -fopenmp $(CFLAGS) $(INCLUDES) $< -o $@
$(OBJPATH)/floyd_omp.o: $(SRCPATH)/floyd_omp.c
$(CC) -c -fopenmp $(CFLAGS) $(INCLUDES) $< -o $@
$(OBJPATH)/floyd_serial.o: $(SRCPATH)/floyd_serial.c
$(CC) -c $(CFLAGS) $(INCLUDES) $< -o $@
$(OBJPATH)/path-mpi.o: $(SRCPATH)/path-mpi.c
$(MPICC) -c $(CFLAGS) $(INCLUDES) $< -o $@
$(OBJPATH)/path-mpi-complex.o: $(SRCPATH)/path-mpi-complex.c
$(MPICC) -c $(CFLAGS) $(INCLUDES) $< -o $@
$(OBJPATH)/mt19937p.o: $(SRCPATH)/mt19937p.c
$(CC) -c $(CFLAGS) $(INCLUDES) $< -o $@
$(OBJPATH)/%.o: $(SRCPATH)/%.c
$(CC) $(INCLUDES) -c $(CFLAGS) $< $@
# === Cleanup and tarball
clean:
@echo "Removing all object files."
@rm -rf $(OBJPATH)/*.o
@echo "Removing all executables."
@rm -rf $(BINPATH)/*