Files
davinci-video-converter-fork/Makefile
2024-10-19 10:37:33 +02:00

53 lines
1015 B
Makefile

#
# 'make' build executable file 'davinci-convert'
# 'make clean' removes all .o and executable files
#
# define the Cpp compiler to use
CXX = g++
# define any compile-time flags
CXXFLAGS = -std=c++17 -Wall -Wextra -g
# define output directory
OUTPUT = output
# define source directory
SRC = src
# define the main executable name
MAIN = davinci-convert
# define the C source files
SOURCES = $(wildcard $(SRC)/*.cpp)
# define the C object files
OBJECTS = $(SOURCES:.cpp=.o)
OUTPUTMAIN = $(OUTPUT)/$(MAIN)
all: $(OUTPUT) $(OUTPUTMAIN)
@echo "Building executable: $(MAIN)"
@echo Executing 'all' complete!
$(OUTPUT):
mkdir -p $(OUTPUT)
$(OUTPUTMAIN): $(OBJECTS)
$(CXX) $(CXXFLAGS) -o $(OUTPUTMAIN) $(OBJECTS)
.PHONY: clean
clean:
@echo "Cleaning up..."
rm -f $(OUTPUTMAIN)
rm -f $(OBJECTS)
@echo Cleanup complete!
run: all
@echo "Running executable: $(OUTPUTMAIN)"
./$(OUTPUTMAIN)
@echo Executing 'run: all' complete!
install: all
install -Dm755 $(OUTPUTMAIN) /usr/bin/davinci-convert