kompellierung fertig
This commit is contained in:
parent
ecd873b47c
commit
74e2421312
BIN
--library=m.exe
Normal file
BIN
--library=m.exe
Normal file
Binary file not shown.
BIN
highscore.o
BIN
highscore.o
Binary file not shown.
72
makefile
72
makefile
@ -1,8 +1,11 @@
|
||||
CC = gcc
|
||||
FLAGS = -g -Wall -lm
|
||||
CFLAGS = -g -Wall
|
||||
LIBS = -lm
|
||||
|
||||
ifeq ($(OS),Windows_NT)
|
||||
include makefile_windows.variables
|
||||
RM_CMD = del /f
|
||||
EXT = .exe
|
||||
else
|
||||
UNAME = $(shell uname)
|
||||
ifeq ($(UNAME),Linux)
|
||||
@ -10,56 +13,67 @@ else
|
||||
else
|
||||
include makefile_mac.variables
|
||||
endif
|
||||
RM_CMD = rm -f
|
||||
EXT =
|
||||
endif
|
||||
|
||||
raylibfolder = ./raylib
|
||||
unityfolder = ./unity
|
||||
|
||||
# --------------------------
|
||||
# Initiales Programm bauen (zum ausprobieren)
|
||||
# --------------------------
|
||||
doble_initial:
|
||||
$(CC) -o doble_initial $(BINARIES)/libdoble_complete.a
|
||||
|
||||
# --------------------------
|
||||
# Selbst implementiertes Programm bauen
|
||||
# Objekt-Dateien Definition
|
||||
# --------------------------
|
||||
program_obj_files = stack.o bintree.o numbers.o timer.o highscore.o
|
||||
# main.o separat oder hier hinzufügen
|
||||
OBJ = main.o $(program_obj_files)
|
||||
|
||||
doble : main.o $(program_obj_files)
|
||||
$(CC) $(FLAGS) $^ -o doble
|
||||
# --------------------------
|
||||
# Initiales Programm
|
||||
# --------------------------
|
||||
doble_initial:
|
||||
# Hinweis: $(BINARIES) muss in den include-Dateien definiert sein!
|
||||
$(CC) -o doble_initial$(EXT) $(BINARIES)/libdoble_complete.a $(LIBS)
|
||||
|
||||
# HINWEIS: Hier war ein Tippfehler im Original (obj_filesobj_files), ich habe ihn korrigiert:
|
||||
$(program_obj_files): %.o: %.c
|
||||
$(CC) -c $(FLAGS) $^ -o $@
|
||||
# --------------------------
|
||||
# Hauptprogramm (doble)
|
||||
# --------------------------
|
||||
doble: $(OBJ)
|
||||
# WICHTIG: $(LIBS) ganz am Ende!
|
||||
$(CC) $(CFLAGS) $^ -o doble$(EXT) $(LIBS)
|
||||
|
||||
%.o: %.c
|
||||
$(CC) -c $(CFLAGS) $< -o $@
|
||||
|
||||
# --------------------------
|
||||
# Unit Tests
|
||||
# --------------------------
|
||||
# Name des Test-Programms
|
||||
TEST_BIN = test_runner
|
||||
TEST_BIN = test_runner$(EXT)
|
||||
|
||||
# Das Target 'unitTests' baut das Test-Programm und führt es aus
|
||||
unitTests: unittest.o unittestTree.o stack.o numbers.o
|
||||
@echo "--- Erstelle Test-Executable ---"
|
||||
$(CC) $(FLAGS) unittest.o unittestTree.o stack.o numbers.o -o $(TEST_BIN)
|
||||
@echo "--- Starte Tests ---"
|
||||
./$(TEST_BIN)
|
||||
TEST_STACK_BIN = test_stack$(EXT)
|
||||
TEST_NUMBERS_BIN = test_numbers$(EXT)
|
||||
|
||||
testStack: unittest.o stack.o unity/unity.o
|
||||
@echo "--- Baue und starte Stack Tests ---"
|
||||
$(CC) $(CFLAGS) unittest.o stack.o unity/unity.o -o $(TEST_STACK_BIN) $(LIBS)
|
||||
./$(TEST_STACK_BIN)
|
||||
|
||||
testNumbers: unittestTree.o numbers.o bintree.o stack.o unity/unity.o
|
||||
@echo "--- Baue und starte Numbers Tests ---"
|
||||
$(CC) $(CFLAGS) unittestTree.o numbers.o bintree.o stack.o unity/unity.o -o $(TEST_NUMBERS_BIN) $(LIBS)
|
||||
./$(TEST_NUMBERS_BIN)
|
||||
|
||||
# Regel, um unittest.c zu kompilieren
|
||||
unittest.o: test_stack.c
|
||||
$(CC) -c $(FLAGS) test_stack.c -o unittest.o
|
||||
$(CC) -c $(CFLAGS) test_stack.c -o unittest.o
|
||||
|
||||
unittestTree.o: test_numbers.c
|
||||
$(CC) -c $(FLAGS) test_numbers.c -o unittestTree.o
|
||||
$(CC) -c $(CFLAGS) test_numbers.c -o unittestTree.o
|
||||
|
||||
unity/unity.o: unity/unity.c
|
||||
$(CC) -c $(CFLAGS) unity/unity.c -o unity/unity.o
|
||||
|
||||
|
||||
# --------------------------
|
||||
# Clean
|
||||
# --------------------------
|
||||
clean:
|
||||
ifeq ($(OS),Windows_NT)
|
||||
del /f *.o doble $(TEST_BIN)
|
||||
else
|
||||
rm -f *.o doble $(TEST_BIN)
|
||||
endif
|
||||
$(RM_CMD) *.o doble$(EXT) doble_initial$(EXT) $(TEST_BIN)
|
||||
@ -3,7 +3,7 @@
|
||||
#include <stdlib.h>
|
||||
#include "numbers.h"
|
||||
#include "bintree.h"
|
||||
#include "unity.h"
|
||||
#include "unity/unity.h"
|
||||
|
||||
|
||||
void test_getDuplicateLogic()
|
||||
|
||||
BIN
test_numbers.exe
Normal file
BIN
test_numbers.exe
Normal file
Binary file not shown.
@ -2,6 +2,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "stack.h"
|
||||
#include "unity/unity.h"
|
||||
|
||||
void test_pushFailsOnNullPointer(StackNode *stack, void *data) {
|
||||
|
||||
@ -44,6 +45,13 @@ void test_topFailsOnNullPointer() {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
void setUp(void) {
|
||||
}
|
||||
|
||||
void tearDown(void) {
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
|
||||
|
||||
BIN
test_stack.exe
Normal file
BIN
test_stack.exe
Normal file
Binary file not shown.
BIN
unittest.o
BIN
unittest.o
Binary file not shown.
BIN
unittestTree.o
Normal file
BIN
unittestTree.o
Normal file
Binary file not shown.
BIN
unity/unity.o
Normal file
BIN
unity/unity.o
Normal file
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user