inf2Projekt_3/makefile

60 lines
1.5 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_files): %.o: %.c
$(CC) -c $(FLAGS) $^ -o $@
# --------------------------
# Unit Tests
# --------------------------
# Test Stack (JETZT MIT UNITY)
# Wir müssen unity/unity.c mitkompilieren und -Iunity nutzen
test_stack: test_stack.c stack.o $(unityfolder)/unity.c
$(CC) $(FLAGS) -Iunity test_stack.c stack.o $(unityfolder)/unity.c -o test_stack$(EXT)
unitTests_stack: test_stack
./test_stack$(EXT)
test_numbers: test_numbers.c numbers.c bintree.c stack.c unity/unity.c
gcc -Wall -Wextra -std=c99 -Iunity \
-o test_numbers \
test_numbers.c numbers.c bintree.c stack.c unity/unity.c
unitTests_number: test_numbers
./test_numbers
#-------------------------
# Clean
# --------------------------
clean:
ifeq ($(OS),Windows_NT)
del /f *.o doble.exe test_stack.exe test_numbers.exe
else
rm -f *.o doble
endif