-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
33 lines (24 loc) · 673 Bytes
/
Makefile
File metadata and controls
33 lines (24 loc) · 673 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
# Compilation flags
CFLAGS = -Wall -Wextra -ansi -pedantic
# Source files directory
SRCDIR = src
# Output directory
OUTDIR = bin
# Source files
SOURCES = $(wildcard $(SRCDIR)/*.c)
# Executable name
EXECUTABLE = minesweeper
# Home directory
MINESWEEPER_FOLDER := $(shell cd ~; pwd)
all: $(OUTDIR)/$(EXECUTABLE)
$(OUTDIR)/$(EXECUTABLE): $(SOURCES)
@echo "Building executable: $@"
@mkdir -p $(OUTDIR) # Create output directory if it doesn't exist
@echo "Creating minesweeper folder at $(MINESWEEPER_FOLDER)" # Add this line
gcc $(CFLAGS) -o $@ $^
@echo "Build complete :)"
.PHONY: clean
clean:
@echo "Cleaning up"
@rm -rf $(OUTDIR)
@echo "Cleanup complete"