3 ms·
Many other programs use make, and so I use make for compiling those programs. For my own programs I do something different (unless it is a modified version of a
by zzo38computer 8y ago
Many other programs use make, and so I use make for compiling those programs. For my own programs I do something different (unless it is a modified version of another program that already uses make).
For programs with a single file, I might add something like this at the top:
#if 0
gcc -o ~/bin/program program.c
exit
#endif
For programs with multiple files, I will write a shell script to figure out and compile everything (but use stuff like the above to compile each individual file). Although, I should probably make a better way, later.
- palunon 8y ago> For programs with multiple files, I will write a shell script to figure out and compile everything (but use stuff like the above to compile each individual file). Although, I should probably make a better way, later. Yeah, you should probably `make` a better way... ;)
- mikekchar 8y agoI recommend you spend some time learning how to use make before you spend a great deal of time with your plan. If you do so, once you start trying to rewrite it in a shell script, you will discover pretty quickly why you don't want to. If you don't spend that time, it will take you a lot longer to discover why you shouldn't rewrite it. Either way is likely to have the same result, but one will take less time ;-) To be fair, there are other dependency tools around, but make is a really good starting place to learn what it's about and why you want to use something quite robust. Many people dislike make, but personally I haven't used anything that was substantially better.