-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmakefile
More file actions
38 lines (27 loc) · 787 Bytes
/
makefile
File metadata and controls
38 lines (27 loc) · 787 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
# Compiler
CXX = g++
CXXFLAGS = -std=c++11 -Wall -Wextra -g
# Target executable
TARGET = shell
# Source files
SRCS = Shell.cpp Commands.cpp commandUtils.cpp
# Header files
HDRS = Shell.h Commands.h commandUtils.h
# Object files
OBJS = Shell.o Commands.o commandUtils.o
# Default target
all: $(TARGET)
# Link object files to create the executable
$(TARGET): $(OBJS)
$(CXX) $(CXXFLAGS) -o $(TARGET) $(OBJS)
# Compile source files into object files
Shell.o: Shell.cpp Shell.h Commands.h commandUtils.h
$(CXX) $(CXXFLAGS) -c Shell.cpp
Commands.o: Commands.cpp Commands.h
$(CXX) $(CXXFLAGS) -c Commands.cpp
commandUtils.o: commandUtils.cpp commandUtils.h
$(CXX) $(CXXFLAGS) -c commandUtils.cpp
# Clean target to remove compiled files
clean:
rm -f $(TARGET) $(OBJS)