![]() ![]() When you need automatic dependency resolution (ie. ![]() Read the Make manual (seriously!) to find the built-in rules and how they work. Don't invent your own names for this, they won't work with the built-in rules. For linker flags you add LDFLAGS and LDLIBS. That's it! A single line! Nothing else is required.įor compiler arguments, you add CFLAGS. To compile and link a program consisting of a single C file (test.c), this is what your initial Makefile should look like: test: test.o People see these clunky ad-hoc Makefile tutorials and think that make is a bad tool. Make is all about using the implicit rules to build object files and using the dependency resolution rules that make things click. Sorry to put this bluntly but: oh no, yet another Makefile tutorial that teaches the wrong way to do it. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |