fix: apply build FLAGS correctly #4

Merged
schroederen merged 1 commits from wiesendsi102436/info2Praktikum-DobleSpiel:bugfix/makefile into main 2025-12-15 14:20:07 +00:00
Contributor

A typo in the dependency variable program_obj_files caused make to fall back to implicit/default rules.
Without fix:

$ make doble
gcc    -c -o main.o main.c
gcc    -c -o stack.o stack.c
gcc    -c -o bintree.o bintree.c
gcc    -c -o numbers.o numbers.c
gcc    -c -o timer.o timer.c
gcc    -c -o highscore.o highscore.c
gcc -g -Wall -lm main.o stack.o bintree.o numbers.o timer.o highscore.o -o doble

With fix:

$ make doble
gcc    -c -o main.o main.c
gcc -c -g -Wall -lm stack.c -o stack.o
gcc -c -g -Wall -lm bintree.c -o bintree.o
gcc -c -g -Wall -lm numbers.c -o numbers.o
gcc -c -g -Wall -lm timer.c -o timer.o
gcc -c -g -Wall -lm highscore.c -o highscore.o
gcc -g -Wall -lm main.o stack.o bintree.o numbers.o timer.o highscore.o -o doble
A typo in the dependency variable program_obj_files caused make to fall back to implicit/default rules. Without fix: ``` $ make doble gcc -c -o main.o main.c gcc -c -o stack.o stack.c gcc -c -o bintree.o bintree.c gcc -c -o numbers.o numbers.c gcc -c -o timer.o timer.c gcc -c -o highscore.o highscore.c gcc -g -Wall -lm main.o stack.o bintree.o numbers.o timer.o highscore.o -o doble ``` With fix: ``` $ make doble gcc -c -o main.o main.c gcc -c -g -Wall -lm stack.c -o stack.o gcc -c -g -Wall -lm bintree.c -o bintree.o gcc -c -g -Wall -lm numbers.c -o numbers.o gcc -c -g -Wall -lm timer.c -o timer.o gcc -c -g -Wall -lm highscore.c -o highscore.o gcc -g -Wall -lm main.o stack.o bintree.o numbers.o timer.o highscore.o -o doble ```
wiesendsi102436 added 1 commit 2025-11-30 10:20:31 +00:00
A typo in the dependency variable program_obj_files caused make to fall back to implicit/default rules. FLAGS was ignored because the default behavior is to use CFLAGS.
Collaborator

Danke für den Hinweis!

Danke für den Hinweis!
schroederen merged commit 746b9b7219 into main 2025-12-15 14:20:07 +00:00
Sign in to join this conversation.
No Reviewers
No Label
No Milestone
No project
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: freudenreichan/info2Praktikum-DobleSpiel#4
No description provided.