-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
36 lines (32 loc) · 1.08 KB
/
Makefile
File metadata and controls
36 lines (32 loc) · 1.08 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
##############################################################
# Make file for Distributed Wireless Sensor Network simulation
# instructions in README
##############################################################
all: build
build: main.c basestation.c sensor.c
# Checks if outputStation.txt file exists, else creates file
ifeq (,$(wildcard "outputStation.txt" ))
@true
else
echo " " >>outputStation.txt endif
endif
# Checks if inputStation.txt file exists, else creates file
ifeq (,$(wildcard "inputStation.txt"))
@true
else
echo " " >>inputStation.txt endif
endif
# Compiles program
mpicc -fopenmp main.c basestation.c sensor.c -o DWSN.o -lm
run:
# prompts the user for the neccesary inputs then runs the program
@read -p "Enter number of processors:" p; \
read -p "Enter length of matrix:" n; \
read -p "Enter height of matrix:" m;\
read -p "Enter number of iterations, -1 for infinite iterations:" i; \
mpirun -np $$p ./DWSN.o $$n $$m $$i
clean:
# removes all output files and creates an empty inputStation file
rm -f *.o
rm -f inputStation.txt
echo " " >>inputStation.txt