-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
39 lines (31 loc) · 1.25 KB
/
Copy pathMakefile
File metadata and controls
39 lines (31 loc) · 1.25 KB
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
CC=gcc
MPI_CC=mpicc
CFLAGS=-std=c90 -W -Wall -ansi -pedantic -O2
LDFLAGS=-lm
OUTPUT_DIR=./buildMakeFile
all:
$(MAKE) mrproper
$(MAKE) FinderSequential
$(MAKE) PrimeNumberFinderParallel
$(MAKE) TwinPrimeNumberFinderParallelV1
$(MAKE) TwinPrimeNumberFinderParallelV2
$(MAKE) clean
FinderSequential:
$(CC) ./finderSeq/main.c -o $(OUTPUT_DIR)/main.o -c $(CFLAGS) $(LDFLAGS)
$(CC) ./finderSeq/commonFunctions.c -o $(OUTPUT_DIR)/commonFunctions.o -c $(CFLAGS) $(LDFLAGS)
$(CC) -o $(OUTPUT_DIR)/finderSequential $(OUTPUT_DIR)/main.o $(OUTPUT_DIR)/commonFunctions.o $(CFLAGS) $(LDFLAGS)
PrimeNumberFinderParallel:
$(MPI_CC) primeNumberFinderMpi/main.c -o $(OUTPUT_DIR)/primeNumberFinderMpi $(CFLAGS) $(LDFLAGS)
TwinPrimeNumberFinderParallelV1:
$(MPI_CC) twinPrimeNumberFinderMpiV1/main.c -o $(OUTPUT_DIR)/twinPrimeNumberFinderMpiV1 $(CFLAGS) $(LDFLAGS)
TwinPrimeNumberFinderParallelV2:
$(MPI_CC) twinPrimeNumberFinderMpiV2/main.c -o $(OUTPUT_DIR)/twinPrimeNumberFinderMpiV2 $(CFLAGS) $(LDFLAGS)
.PHONY: clean mrproper all
mrproper : clean
rm -f $(OUTPUT_DIR)/finderSequential
rm -f $(OUTPUT_DIR)/primeNumberFinderMpi
rm -f $(OUTPUT_DIR)/twinPrimeNumberFinderMpiV1
rm -f $(OUTPUT_DIR)/twinPrimeNumberFinderMpiV2
$(MAKE) clean
clean :
rm -rf $(OUTPUT_DIR)/*.o