Improve Makefile #15

Merged
xamidev merged 5 commits from furtest/pepperOS:makefile into main 2026-03-15 21:17:44 +01:00
Contributor

Extract the hard-coded names to variables to allow them to be changed on the command line (changing the CC for example).
Dynamically find all the c files to compile instead of having to maintain a list by hand.
Use implicit / dynamic rules to be able to only recompile the files that need it.
Move the PHONY annotations for better readability.

Extract the hard-coded names to variables to allow them to be changed on the command line (changing the CC for example). Dynamically find all the c files to compile instead of having to maintain a list by hand. Use implicit / dynamic rules to be able to only recompile the files that need it. Move the PHONY annotations for better readability.
furtest added 5 commits 2026-03-15 18:21:51 +01:00
This allows to change the name of the compiler or linker when calling
make.
Instead of hardcoding the names set them using a variable.
Also rename the target build to the name of the file it builds which is
in the ELFFILE variable.
Previously the build process removed everything and did all the build
again on each make invocation.
This fixes this behaviour with two changes.
First dynamically find the list of files to build using find instead of
a manually written list.
Then use implicit rules to only build files that need to be built again
instead of recompiling everything.
Move the PHONY tags to make them clearer to read.
Fix the clean rule so it deletes the build directory.
xamidev merged commit ccc8985d4c into main 2026-03-15 21:17:44 +01:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: xamidev/pepperOS#15