forked from julman99/eatmemory
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
33 lines (27 loc) · 855 Bytes
/
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
CC := gcc
CFLAGS := -Wall -Wextra -std=c99 -O3 --pedantic -Wno-unused-parameter
LDFLAGS :=
SRC := ./eatmemory.c ./args/src/args.c
EXE := eatmemory
PREFIX := /usr/local
INSTALL_DIR := $(PREFIX)/bin
# Default target: Build the eatmemory program
all: $(EXE)
$(EXE): $(SRC)
$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS)
# Install the executable to the specified PREFIX directory
install: $(EXE)
mkdir -p $(INSTALL_DIR)
install -m 755 $< $(INSTALL_DIR)
# Clean generated files
clean:
rm -f $(EXE)
# Display help message
help:
@echo "Usage: make [target] [PREFIX=/your/installation/path]"
@echo "Targets:"
@echo " all (default) - Build the eatmemory program"
@echo " install - Install the executable to PREFIX/bin"
@echo " clean - Remove generated files"
@echo " help - Display this help message"
.PHONY: all install clean help