diff --git a/makefile b/makefile index 46cf394..0b04991 100644 --- a/makefile +++ b/makefile @@ -1,71 +1,66 @@ 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 + +FLAGS = -g -Wall -I$(unityfolder) + + +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 + # -------------------------- -# Initiales Programm bauen (zum ausprobieren) +# Objektdateien # -------------------------- +program_obj_files := stack.o bintree.o numbers.o timer.o highscore.o + + +%.o: %.c + $(CC) $(FLAGS) -c $< -o $@ + + +doble: main.o $(program_obj_files) + $(CC) $(FLAGS) $^ -o doble + + 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: - echo "needs to be implemented" + @echo "needs to be implemented" -bintree: bintree.c - $(CC) $(FLAGS) -c bintree bintree.c -bintreeTests: stack.o bintree.o bintreeTests.c $(unityfolder)/unity.c - $(CC) $(FLAGS) -o runbintreeTests bintreeTests.c bintree.o stack.o $(unityfolder)/unity.c +binTreeTest: stack.o bintree.o binTreeTest.c $(unityfolder)/unity.c + $(CC) $(FLAGS) -o runbinTreeTest binTreeTest.c bintree.o stack.o $(unityfolder)/unity.c -highscore: highscore.c - $(CC) $(FLAGS) -c highscore highscore.c -numbers: numbers.c - $(CC) $(FLAGS) -c numbers numbers.c +test_numbers: numbers_no_tree.o bintree.o stack.o test_numbers.c $(unityfolder)/unity.c + $(CC) $(FLAGS) -o run_numbersTests test_numbers.c numbers_no_tree.o bintree.o stack.o $(unityfolder)/unity.c -test_numbers: numbers.o bintree.o stack.o test_numbers.c $(unityfolder)/unity.c - $(CC) $(FLAGS) -o run_numbersTests test_numbers.c numbers.o bintree.o stack.o $(unityfolder)/unity.c - -stack: stack.c - $(CC) $(FLAGS) -c stack stack.c test_stack: stack.o test_stack.c $(unityfolder)/unity.c - $(CC) $(FLAGS) -o runstackTests test_stack.c stack.o $(unityfolder)/unity.c + $(CC) $(FLAGS) -o runtest_stack test_stack.c stack.o $(unityfolder)/unity.c -timer: timer.c - $(CC) $(FLAGS) -c timer timer.c # -------------------------- -# Clean +# Cleaning # -------------------------- clean: ifeq ($(OS),Windows_NT) - del /f *.o doble + del /f *.o doble runstackTests run_numbersTests runbintreeTests else - rm -f *.o doble -endif \ No newline at end of file + rm -f *.o doble runstackTests run_numbersTests runbintreeTests +endif diff --git a/runtest_stack.exe b/runtest_stack.exe new file mode 100644 index 0000000..572cf36 Binary files /dev/null and b/runtest_stack.exe differ diff --git a/test_stack.c b/test_stack.c index 3b47817..50a09b9 100644 --- a/test_stack.c +++ b/test_stack.c @@ -4,6 +4,14 @@ //Testfunkionen zu push, pull, top & clearStack schreiben +void setUp() + { + } + +void tearDown() + { + } + void test(char *name, int condition) { if (condition) { printf("[OK] %s\n", name);