fix makefile to allow debugging

This commit is contained in:
Simon Wiesend 2025-11-29 21:25:04 +01:00
parent 34e5a59196
commit 07262a1fe0
Signed by: wiesendsi102436
GPG Key ID: C18A833054142CF0

View File

@ -1,5 +1,5 @@
CC = gcc CC = gcc
FLAGS = -g -Wall -lm CFLAGS = -g -Wall -lm
ifeq ($(OS),Windows_NT) ifeq ($(OS),Windows_NT)
include makefile_windows.variables include makefile_windows.variables
@ -27,10 +27,10 @@ doble_initial:
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
doble : main.o $(program_obj_files) doble : main.o $(program_obj_files)
$(CC) $(FLAGS) $^ -o doble $(CC) $(CFLAGS) $^ -o doble
$(program_obj_filesobj_files): %.o: %.c $(program_obj_files): %.o: %.c
$(CC) -c $(FLAGS) $^ -o $@ $(CC) -c $(CFLAGS) $^ -o $@
# -------------------------- # --------------------------
# Unit Tests # Unit Tests
@ -39,11 +39,11 @@ TEST_STACK_SOURCES = stack.c test_stack.c $(unityfolder)/unity.c
TEST_BINTREE_SOURCES = bintree.c test_bintree.c stack.c $(unityfolder)/unity.c TEST_BINTREE_SOURCES = bintree.c test_bintree.c stack.c $(unityfolder)/unity.c
stackTests: $(TEST_STACK_SOURCES) stack.h stackTests: $(TEST_STACK_SOURCES) stack.h
$(CC) $(FLAGS) -I$(unityfolder) $(TEST_STACK_SOURCES) -o runStackTests $(CC) $(CFLAGS) -I$(unityfolder) $(TEST_STACK_SOURCES) -o runStackTests
./runStackTests ./runStackTests
bintreeTests: $(TEST_BINTREE_SOURCES) stack.h bintree.h bintreeTests: $(TEST_BINTREE_SOURCES) stack.h bintree.h
$(CC) $(FLAGS) -I$(unityfolder) $(TEST_BINTREE_SOURCES) -o runBintreeTests $(CC) $(CFLAGS) -I$(unityfolder) $(TEST_BINTREE_SOURCES) -o runBintreeTests
./runBintreeTests ./runBintreeTests
# -------------------------- # --------------------------