Looking for introduction of nmake & makefile structure [closed]
We don’t allow questions seeking recommendat开发者_如何学运维ions for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this questionI am looking for some basic information regarding makefile structure. Any pointers will be highly appreciated. Thanks.
Official NMAKE documentation.
There are several other types of build systems that use "makefiles". Several of the other answers here are pointing you to these other systems. They all implement the same basic ideas, but the capabilities and syntax vary, sometimes in subtle ways. If you need to learn how to use NMAKE (which is the one you mentioned in the title), and you read GNU make documentation, you're likely to get confused.
The best help I think I can give anyone desiring to learn how to write their own makefiles is:
DON'T DO IT!!!
Use a makefile generator. There's a lot out there. One of the best I've seen is CMake but there's also automake/autoconf/all that.
You can also use a totally different build system like Ant (but that's by far the only option in this category).
Make actually kind of sucks. I haven't touched one in 10 years. Put your development effort where it will do the most good, in your code.
For very quick start (if you haven't yet tried) - read this, very simple.
If you want start writing makefiles in couple hours - this one.
To be a monster in makefiles use official, commonly you need this as reference book.
You may want to have a look at the Autobook
I agree with most earlier responders: don't continue to be dependent on NMake, use newer tools. Ant, MSBuild, Maven, Scons, GNU/autotools, etc. But, if you really want to learn more about NMake, check out the Microsoft Rotor (SSCLI) source distro, it includes the source to NMake, at least a hacked-up snapshot needed to bootstrap Rotor's build. And for better examples of Nmakefiles, look in early Win32 SDKs, and later OS/2 SDKs, that was the heydey of complex Nmakefiles.
精彩评论