42 lines
894 B
Makefile

CC=g++
CFLAGS= -std=c++23
INCLUDE_DIR= include
SRC_DIR= src
BUILD_DIR= build
SRCS := $(wildcard $(SRC_DIR)/*.cpp)
OBJS := $(patsubst $(SRC_DIR)/%.cpp,$(BUILD_DIR)/%.o,$(SRCS))
all: directories main run
directories:
mkdir -p $(BUILD_DIR)
# Rule to compile each source file into an object file
$(BUILD_DIR)/%.o: $(SRC_DIR)/%.cpp $(INCLUDE_DIR)/*.h
$(CC) $(CFLAGS) -O3 -I$(INCLUDE_DIR) -c $< -o $@
# Rule to link the object files into the main executable
main: main.cpp $(OBJS)
$(CC) $(CFLAGS) -O3 -I$(INCLUDE_DIR) $(OBJS) main.cpp -o main -lcurl
debug: main.cpp $(SRCS)
$(CC) $(CFLAGS) -I$(INCLUDE_DIR) $(SRCS) -g main.cpp -o main -lcurl
dec: dec.cpp $(OBJS)
$(CC) $(CFLAGS) -I$(INCLUDE_DIR) $(OBJS) -g dec.cpp -o dec
run: main
./main
zip:
zip -r main.zip main.cpp $(INCLUDE_DIR) $(SRC_DIR) makefile dec.cpp cameras.csv porocilo.pptx
clean:
rm main out.bmp dec build/*.o