-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
48 lines (35 loc) · 1.36 KB
/
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# Define the compiler
CC = gcc-13
# Define any compile-time flags
CFLAGS = -Wall -g
# -Wall flag tells the compiler to enable all standard warning messages.
# It's a way to tell the compiler to be verbose about potential issues in your code.
# Warnings can include things like uninitialized variables, usage of deprecated functions, and other potential problems
# that aren't strictly errors but could lead to bugs.
# -g flag adds debugging information to the generated output.
# This information is used by debugging tools, like gdb, to help you debug your program.
# With -g, the debugger can provide more detailed information about the state of your program,
# such as variable values, function call stacks, and more.
# Define any directories containing header files
INCLUDES = -Iheaders
# Define any libraries to link into executable
LIBS =
# Define the source files
SRCS = src/dash.c src/helper.c src/execute.c src/alias.c
# Define the object files
OBJS = $(SRCS:.c=.o)
# Define the executable file
MAIN = myshell
.PHONY: depend clean
all: $(MAIN)
@echo Compiled $(MAIN) successfully.
$(MAIN): $(OBJS)
$(CC) $(CFLAGS) $(INCLUDES) -o $(MAIN) $(OBJS) $(LIBS)
rm -f $(OBJS)
# This is a suffix replacement rule for building .o's from .c's
.c.o:
$(CC) $(CFLAGS) $(INCLUDES) -c $< -o $@
clean:
$(RM) src/*.o *~ $(MAIN)
depend: $(SRCS)
makedepend $(INCLUDES) $^