-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
39 lines (30 loc) · 754 Bytes
/
Copy pathMakefile
File metadata and controls
39 lines (30 loc) · 754 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
39
# Compiler and compiler flags
CXX = g++
CXXFLAGS = -std=c++11
# Project name
TARGET = image_processing
# Source files
SRCS = main.cpp image.cpp filters.cpp
# Object files (replace .cpp with .o in SRCS)
OBJS = $(SRCS:.cpp=.o)
# Headers
HEADERS = image.h filters.h stb_image.h stb_image_write.h
# Default target
all: $(TARGET)
# Link the target executable
$(TARGET): $(OBJS)
@echo "Linking..."
$(CXX) $(CXXFLAGS) -o $@ $^
@echo "Build completed successfully."
# Compile .cpp files to .o files
%.o: %.cpp $(HEADERS)
@echo "Compiling $<..."
$(CXX) $(CXXFLAGS) -c -o $@ $<
@echo "$< compiled successfully."
# Clean up build files
clean:
@echo "Cleaning up..."
del $(OBJS) $(TARGET)
@echo "Clean completed."
# Phony targets
.PHONY: all clean