Doblespiel V1

This commit is contained in:
2025-12-03 13:25:27 +01:00
parent 7714634f58
commit 4515fc0b8d
22 changed files with 714 additions and 92 deletions
+18 -26
View File
@@ -1,6 +1,7 @@
CC = gcc
FLAGS = -g -Wall -lm
# Betriebssystem erkennen und Variablen laden (hier stehen die Flags drin)
ifeq ($(OS),Windows_NT)
include makefile_windows.variables
else
@@ -12,38 +13,29 @@ else
endif
endif
raylibfolder = ./raylib
unityfolder = ./unity
# Objekt-Dateien, die wir für das Spiel brauchen
OBJ = stack.o bintree.o numbers.o timer.o highscore.o
# --------------------------
# Initiales Programm bauen (zum ausprobieren)
# --------------------------
doble_initial:
$(CC) -o doble_initial $(BINARIES)/libdoble_complete.a
# --- Hauptziel: Das Spiel bauen ---
# Hier fügen wir $(LDFLAGS) am Ende hinzu, damit -lopengl32 etc. genutzt werden
doble: main.o $(OBJ)
$(CC) $(FLAGS) main.o $(OBJ) -o doble $(LDFLAGS)
# --------------------------
# Selbst implementiertes Programm bauen
# --------------------------
program_obj_files = stack.o bintree.o numbers.o timer.o highscore.o
# --- Hilfsregel: Aus .c mach .o ---
%.o: %.c
$(CC) -c $(FLAGS) $< -o $@
doble : main.o $(program_obj_files)
$(CC) $(FLAGS) $^ -o doble
# --- Tests ---
test_stack: test_stack.c stack.o
$(CC) $(FLAGS) test_stack.c stack.o -o test_stack
$(program_obj_filesobj_files): %.o: %.c
$(CC) -c $(FLAGS) $^ -o $@
test_numbers: test_numbers.c numbers.o bintree.o stack.o
$(CC) $(FLAGS) test_numbers.c numbers.o bintree.o stack.o -o test_numbers
# --------------------------
# Unit Tests
# --------------------------
unitTests:
echo "needs to be implemented"
# --------------------------
# Clean
# --------------------------
# --- Aufräumen ---
clean:
ifeq ($(OS),Windows_NT)
del /f *.o doble
del /f *.o doble.exe test_stack.exe test_numbers.exe
else
rm -f *.o doble
rm -f *.o doble test_stack test_numbers
endif