57 lines
1.4 KiB
Makefile
57 lines
1.4 KiB
Makefile
CC = gcc
|
|
CFLAGS = -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) $(CFLAGS) $^ -o doble
|
|
|
|
$(program_obj_files): %.o: %.c
|
|
$(CC) -c $(CFLAGS) $^ -o $@
|
|
|
|
# --------------------------
|
|
# Unit Tests
|
|
# --------------------------
|
|
TEST_STACK_SOURCES = stack.c test_stack.c $(unityfolder)/unity.c
|
|
TEST_BINTREE_SOURCES = bintree.c test_bintree.c stack.c $(unityfolder)/unity.c
|
|
|
|
stackTests: $(TEST_STACK_SOURCES) stack.h
|
|
$(CC) $(CFLAGS) -I$(unityfolder) $(TEST_STACK_SOURCES) -o runStackTests
|
|
./runStackTests
|
|
|
|
bintreeTests: $(TEST_BINTREE_SOURCES) stack.h bintree.h
|
|
$(CC) $(CFLAGS) -I$(unityfolder) $(TEST_BINTREE_SOURCES) -o runBintreeTests
|
|
./runBintreeTests
|
|
|
|
# --------------------------
|
|
# Clean
|
|
# --------------------------
|
|
clean:
|
|
ifeq ($(OS),Windows_NT)
|
|
del /f *.o doble
|
|
else
|
|
rm -f *.o doble
|
|
endif |