2025-12-15 23:48:33 +01:00

75 lines
1.7 KiB
Makefile

CC = gcc
FLAGS = -g -Wall -lm
ifeq ($(OS),Windows_NT)
include makefile_windows.variables
else
UNAME = $(shell uname)
ifeq ($(UNAME),Linux)
include makefile_linux.variables
else
include makefile_mac.variables
endif
endif
raylibfolder = ./raylib
unityfolder = ./unity
# --------------------------
# Initiales Programm bauen (zum ausprobieren)
# --------------------------
doble_initial:
$(CC) -o doble_initial $(BINARIES)/libdoble_complete.a
# --------------------------
# Selbst implementiertes Programm bauen
# --------------------------
program_obj_files = stack.o bintree.o numbers.o timer.o highscore.o
doble : main.o $(program_obj_files)
$(CC) $(FLAGS) $^ -o doble
$(program_obj_filesobj_files): %.o: %.c
$(CC) -c $(FLAGS) $^ -o $@
# --------------------------
# Unit Tests
# --------------------------
unitTests: test_stack test_tree test_numbers
test_stack: test_stack.o stack.o unity/unity.c
$(CC) $(FLAGS) -I$(unityfolder) $^ -o test_stack
test_tree: test_tree.o bintree.o stack.o unity/unity.c
$(CC) $(FLAGS) -I$(unityfolder) $^ -o test_tree
test_numbers: test_numbers.o numbers.o bintree.o stack.o unity/unity.c
$(CC) $(FLAGS) -I$(unityfolder) $^ -o test_numbers
test_stack.o: test_stack.c
$(CC) -c $(FLAGS) -I$(unityfolder) $< -o $@
stack.o: stack.c
$(CC) -c $(FLAGS) $< -o $@
test_tree.o: test_tree.c
$(CC) -c $(FLAGS) -I$(unityfolder) $< -o $@
test_numbers.o: test_numbers.c
$(CC) -c $(FLAGS) -I$(unityfolder) $< -o $@
bintree.o: bintree.c
$(CC) -c $(FLAGS) $< -o $@
numbers.o: numbers.c
$(CC) -c $(FLAGS) $< -o $@
# --------------------------
# Clean
# --------------------------
clean:
ifeq ($(OS),Windows_NT)
del /f *.o doble $(TEST_BIN).exe
else
rm -f *.o doble $(TEST_BIN)
endif