# Makefile for compiling and running the potentials project

# Compiler and flags
CXX = g++
CXXFLAGS = -std=c++17 -Wall -O2

current_dir = $(shell pwd)

# Include directories
#INCLUDES = -I$(current_dir)/include

# Libraries
# LIBS = -lautodiff

# Source files
# SRCS = SIEP_CLI.v1.0cpp  CLI11.v2.6.2.hpp
SRCS = SIEP_CLI.v1.0.cpp

# Object files
OBJS = $(SRCS:.cpp=.o)

# Executable
#EXEC = gravlensMZLU
EXEC = isit4or2or1

# Default target
all: $(EXEC)

# Rule to build the executable
$(EXEC): $(OBJS)
	$(CXX) $(CXXFLAGS) $(INCLUDES) -o $@ $^ $(LIBS)

# Rule to build object files
%.o: %.cpp
	$(CXX) $(CXXFLAGS) $(INCLUDES) -c $< -o $@

# Clean up build files
clean:
	rm -f $(OBJS) $(EXEC)

# Run the executable with default arguments
run: $(EXEC)
	./$(EXEC) -o output.csv -d input.csv

# Help message
help:
	@echo "Usage:"
	@echo "  make          - Build the executable"
	@echo "  make clean    - Clean up build files"
	@echo "  make run      - Run the executable with default arguments"
	@echo "  make help     - Display this help message"


# Phony targets
.PHONY: all clean run help
