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
|
CC = gcc
|
||||||
FLAGS = -g -Wall -lm
|
CFLAGS = -g -Wall
|
||||||
|
LIBS = -lm
|
||||||
|
|
||||||
ifeq ($(OS),Windows_NT)
|
ifeq ($(OS),Windows_NT)
|
||||||
include makefile_windows.variables
|
include makefile_windows.variables
|
||||||
|
RM_CMD = del /f
|
||||||
|
EXT = .exe
|
||||||
else
|
else
|
||||||
UNAME = $(shell uname)
|
UNAME = $(shell uname)
|
||||||
ifeq ($(UNAME),Linux)
|
ifeq ($(UNAME),Linux)
|
||||||
@ -10,56 +13,67 @@ else
|
|||||||
else
|
else
|
||||||
include makefile_mac.variables
|
include makefile_mac.variables
|
||||||
endif
|
endif
|
||||||
|
RM_CMD = rm -f
|
||||||
|
EXT =
|
||||||
endif
|
endif
|
||||||
|
|
||||||
raylibfolder = ./raylib
|
raylibfolder = ./raylib
|
||||||
unityfolder = ./unity
|
unityfolder = ./unity
|
||||||
|
|
||||||
# --------------------------
|
# --------------------------
|
||||||
# Initiales Programm bauen (zum ausprobieren)
|
# Objekt-Dateien Definition
|
||||||
# --------------------------
|
|
||||||
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
|
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
|
# Hauptprogramm (doble)
|
||||||
$(CC) -c $(FLAGS) $^ -o $@
|
# --------------------------
|
||||||
|
doble: $(OBJ)
|
||||||
|
# WICHTIG: $(LIBS) ganz am Ende!
|
||||||
|
$(CC) $(CFLAGS) $^ -o doble$(EXT) $(LIBS)
|
||||||
|
|
||||||
|
%.o: %.c
|
||||||
|
$(CC) -c $(CFLAGS) $< -o $@
|
||||||
|
|
||||||
# --------------------------
|
# --------------------------
|
||||||
# Unit Tests
|
# Unit Tests
|
||||||
# --------------------------
|
# --------------------------
|
||||||
# Name des Test-Programms
|
TEST_BIN = test_runner$(EXT)
|
||||||
TEST_BIN = test_runner
|
|
||||||
|
|
||||||
# Das Target 'unitTests' baut das Test-Programm und führt es aus
|
TEST_STACK_BIN = test_stack$(EXT)
|
||||||
unitTests: unittest.o unittestTree.o stack.o numbers.o
|
TEST_NUMBERS_BIN = test_numbers$(EXT)
|
||||||
@echo "--- Erstelle Test-Executable ---"
|
|
||||||
$(CC) $(FLAGS) unittest.o unittestTree.o stack.o numbers.o -o $(TEST_BIN)
|
testStack: unittest.o stack.o unity/unity.o
|
||||||
@echo "--- Starte Tests ---"
|
@echo "--- Baue und starte Stack Tests ---"
|
||||||
./$(TEST_BIN)
|
$(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
|
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
|
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
|
||||||
# --------------------------
|
# --------------------------
|
||||||
clean:
|
clean:
|
||||||
ifeq ($(OS),Windows_NT)
|
$(RM_CMD) *.o doble$(EXT) doble_initial$(EXT) $(TEST_BIN)
|
||||||
del /f *.o doble $(TEST_BIN)
|
|
||||||
else
|
|
||||||
rm -f *.o doble $(TEST_BIN)
|
|
||||||
endif
|
|
||||||
@ -3,7 +3,7 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include "numbers.h"
|
#include "numbers.h"
|
||||||
#include "bintree.h"
|
#include "bintree.h"
|
||||||
#include "unity.h"
|
#include "unity/unity.h"
|
||||||
|
|
||||||
|
|
||||||
void test_getDuplicateLogic()
|
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 <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include "stack.h"
|
#include "stack.h"
|
||||||
|
#include "unity/unity.h"
|
||||||
|
|
||||||
void test_pushFailsOnNullPointer(StackNode *stack, void *data) {
|
void test_pushFailsOnNullPointer(StackNode *stack, void *data) {
|
||||||
|
|
||||||
@ -44,6 +45,13 @@ void test_topFailsOnNullPointer() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void setUp(void) {
|
||||||
|
}
|
||||||
|
|
||||||
|
void tearDown(void) {
|
||||||
|
}
|
||||||
|
|
||||||
int main()
|
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