vibe coding an orbital mechanics simulation to try out claude code
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

42 lines
1001 B

CXX = g++
CXXFLAGS = -Wall -Wextra -g -ggdb3 -std=c++14 \
-I./src \
-I../src \
-isystem./ext/raylib/src \
-isystem./ext/raygui/src \
-isystem./ext/raygui/styles
LDFLAGS = -L./ext/raylib/src -lraylib -lm -lpthread -ldl -lrt -lX11
SRC_DIR = src
BUILD_DIR ?= build
RAYLIB_DIR = ext/raylib/src
CPP_SOURCES := $(wildcard $(SRC_DIR)/*.cpp)
CPP_OBJECTS = $(CPP_SOURCES:$(SRC_DIR)/%.cpp=$(BUILD_DIR)/%.o)
TARGET = ${BUILD_DIR}/orbit_sim
raylib:
@if [ ! -f $(RAYLIB_DIR)/libraylib.a ]; then \
cd $(RAYLIB_DIR) && $(MAKE) PLATFORM=PLATFORM_DESKTOP; \
fi
$(BUILD_DIR):
mkdir -p $(BUILD_DIR)
$(TARGET): $(CPP_OBJECTS) raylib
$(CXX) $(CPP_OBJECTS) -o $(TARGET) -L$(BUILD_DIR) -lorbit $(LDFLAGS)
$(CPP_OBJECTS): $(BUILD_DIR)/%.o : $(SRC_DIR)/%.cpp
$(CXX) $(CXXFLAGS) -c $< -o $@
clean:
rm -f $(TARGET)
@for f in $(CPP_SOURCES); do rm -f $(BUILD_DIR)/$$(basename $${f%.cpp}.o); done
rebuild: clean all
all: raylib $(BUILD_DIR) $(TARGET)
.PHONY: all clean raylib rebuild