-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
38 lines (28 loc) · 704 Bytes
/
Copy pathMakefile
File metadata and controls
38 lines (28 loc) · 704 Bytes
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
# Makefile for Poisson Solver Project
# Compiler and flags
CC = gcc
CFLAGS = -O2 -fopenmp -Wall -std=c99
# Executable name
BIN = main
# Output directory for CSV files
RESULTS_DIR = results
# Source files
SRC = main.c PSolver.c
# Object files (optional)
OBJ = $(SRC:.c=.o)
# Default target: build the executable
all: $(BIN)
# Compile the program
$(BIN): $(SRC)
$(CC) $(CFLAGS) -o $(BIN) $(SRC) -lm
# Run the program and ensure the results directory exists
run: $(BIN)
mkdir -p $(RESULTS_DIR) # Create the results directory if missing
./$(BIN)
# Run unit tests using a Bash script
test:
bash test.sh
# Clean up build artifacts and output files
clean:
rm -f $(BIN)
rm -rf $(RESULTS_DIR)