Skip to content
Snippets Groups Projects
Commit 264ed98d authored by Florian Burgener's avatar Florian Burgener
Browse files

Rename Window and Update Makefile

parent fb14af2f
Branches
No related tags found
No related merge requests found
*.o
main
main.exe
planetary_system
planetary_system.exe
.vscode
TARGET = main
# CCFLAGS
TARGET = planetary_system
LIBS = -lm
CC = gcc
# CFLAGS:=-g -Ofast -Wall -Wextra -fsanitize=address -fsanitize=leak -std=gnu11
# CFLAGS:=-fsanitize=address
CFLAGS = -g -O3 -Wall -Wextra -std=gnu11
LDFLAGS = -lm
CFLAGS = -g -O3 -std=gnu11
ifeq ($(OS),Windows_NT)
LDFLAGS += -lopengl32 -lglu32 -lfreeglut
LIBS += -lopengl32 -lglu32 -lfreeglut
else
LDFLAGS += -lGL -lGLU -lglut
LIBS += -lGL -lGLU -lglut
endif
.PHONY: default all clean
default: $(TARGET)
all: default
OBJECTS = $(patsubst %.c, %.o, $(wildcard *.c))
HEADERS = $(wildcard *.h)
%.o: %.c $(HEADERS)
$(CC) $(CFLAGS) -c $< -o $@
$(TARGET): main.o Vector2.o CelestialObject.o PlanetarySystem.o drawing.o
$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS)
.PRECIOUS: $(TARGET) $(OBJECTS)
$(TARGET): $(OBJECTS)
$(CC) $(OBJECTS) -Wall -Wextra $(LIBS) -o $@
clean:
-rm -f *.o $(TARGET) $(TARGET).exe
-rm -f *.o
-rm -f $(TARGET)
......@@ -19,7 +19,7 @@
#include "drawing.h"
// Name of the window.
const char WINDOW_NAME[] = "Solar System";
const char WINDOW_NAME[] = "Planetary System";
// Refresh rate in Hz.
const int32_t REFRESH_RATE = 200;
// Number of microseconds in 1 second.
......@@ -108,7 +108,7 @@ void draw() {
char title[100];
double elapsed_time = (double)(get_current_time() - start_time) / ONE_SECOND_IN_MICROSECONDS;
sprintf(title, "Solar System (%.2lf)", elapsed_time);
sprintf(title, "%s (%.2lf)", WINDOW_NAME, elapsed_time);
glutSetWindowTitle(title);
planetary_system_draw(planetary_system);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment