Build GNU make yourself

I used the following work-flow to build GNU make on Cygwin from the CVS checkout
'''You may want to know why one would want to do this. See below.'''

## Build gnu make from CVS source for Cygwin (with Windows pathnames support) # Choose &quot;CCVERSION&quot; = &quot;4&quot; for building make with gcc-4 experimental release on cygwin. : ${ CCVERSION :? &quot; ERROR - You do not have CCVERSION defined in your env. It is whatever comes after the -. Try again &quot; } : ${ YELLOWFIN :? &quot; ERROR - You do not have YELLOWFIN defined in your env. It is whatever cpu you want to tuna for. <font color="#87ceeb">&quot; <font color="#ee799f">} <font color="#87ceeb">sleep <font color="#fa8072">6 <font color="#87ceeb">mkdir <font color="#76eec6">-vp /tmp/StaffProjects/gnumake-cvs <font color="#87ceeb">cd /tmp/StaffProjects <font color="#87ceeb">mkdir <font color="#76eec6">-vp ./gnumake-build cvs <font color="#76eec6">-d :pserver:anonymous@cvs.savannah.gnu.org:/sources/make <font color="#87ceeb">\ co <font color="#76eec6">-P <font color="#76eec6">-d gnumake-cvs make <font color="#87ceeb">cd gnumake-cvs <font color="#87ceeb">find <font color="#87ceeb">. - <font color="#87ceeb">! <font color="#76eec6">\( <font color="#76eec6">-path <font color="#87ceeb">' <font color="#fa8072">*/CVS* <font color="#87ceeb">' <font color="#76eec6">-o <font color="#76eec6">-name <font color="#87ceeb">' <font color="#fa8072">.cvsignore <font color="#87ceeb">' <font color="#76eec6">-o <font color="#76eec6">-name <font color="#87ceeb">\  <font color="#87ceeb">' <font color="#fa8072">.purify <font color="#87ceeb">' <font color="#76eec6">-o <font color="#76eec6">-name <font color="#87ceeb">' <font color="#fa8072">make_msvc* <font color="#87ceeb">' <font color="#76eec6">\) <font color="#76eec6">-a <font color="#76eec6">-print0 <font color="#87ceeb">| cpio <font color="#76eec6">-pv0d ../gnumake-build <font color="#87ceeb">cd ../gnumake-build <font color="#7ccd7c"># less README.cvs autoreconf <font color="#76eec6">-i ./configure <font color="#76eec6">--help <font color="#87ceeb">| <font color="#87ceeb">less ./configure <font color="#76eec6">--prefix=/usr <font color="#76eec6">--exec-prefix=/usr <font color="#76eec6">--program-prefix=cyg <font color="#87ceeb">\ <font color="#76eec6">--program-suffix=-038190 <font color="#76eec6">--datarootdir=/usr/share <font color="#76eec6">--cache-file=cygwinbuild.cache <font color="#87ceeb">\ <font color="#76eec6">--disable-dependency-tracking <font color="#76eec6">--disable-nls <font color="#76eec6">--disable-rpath <font color="#76eec6">--with-gnu-ld <font color="#87ceeb">\ <font color="#87ceeb">&quot; <font color="#fa8072">LDFLAGS=-Wl,-S,-O3 <font color="#87ceeb">&quot; <font color="#87ceeb">&quot; <font color="#fa8072">CFLAGS=-pipe -O1 -mtune= <font color="#ee799f">${ <font color="#ee799f">YELLOWFIN <font color="#ee799f">} <font color="#87ceeb">&quot; <font color="#87ceeb">\ <font color="#87ceeb">&quot; <font color="#fa8072">CC=gcc- <font color="#ee799f">${ <font color="#ee799f">CCVERSION <font color="#ee799f">} <font color="#87ceeb">&quot; <font color="#87ceeb">&quot; <font color="#fa8072">CXX=g++- <font color="#ee799f">${ <font color="#ee799f">CCVERSION <font color="#ee799f">} <font color="#87ceeb">&quot; make update ./configure <font color="#76eec6">--prefix=/usr <font color="#76eec6">--exec-prefix=/usr <font color="#76eec6">--program-prefix=cyg <font color="#87ceeb">\ <font color="#76eec6">--program-suffix=-038190 <font color="#76eec6">--datarootdir=/usr/share <font color="#76eec6">--cache-file=cygwinbuild.cache <font color="#87ceeb">\ <font color="#76eec6">--disable-dependency-tracking <font color="#76eec6">--disable-nls <font color="#76eec6">--disable-rpath <font color="#76eec6">--with-gnu-ld <font color="#87ceeb">\ <font color="#87ceeb">&quot; <font color="#fa8072">LDFLAGS=-Wl,-S,-O3 <font color="#87ceeb">&quot; <font color="#87ceeb">&quot; <font color="#fa8072">CFLAGS=-pipe -O1 -mtune= <font color="#ee799f">${ <font color="#ee799f">YELLOWFIN <font color="#ee799f">} <font color="#87ceeb">&quot; <font color="#87ceeb">\ <font color="#87ceeb">&quot; <font color="#fa8072">CC=gcc- <font color="#ee799f">${ <font color="#ee799f">CCVERSION <font color="#ee799f">} <font color="#87ceeb">&quot; <font color="#87ceeb">&quot; <font color="#fa8072">CXX=g++- <font color="#ee799f">${ <font color="#ee799f">CCVERSION <font color="#ee799f">} <font color="#87ceeb">&quot; <font color="#87ceeb">2&gt;&amp;1 <font color="#87ceeb">| tee /tmp/build_cvs_make_configury.log <font color="#87ceeb">( <font color="#87ceeb">cd glob <font color="#87ceeb">&amp;&amp; make<font color="#87ceeb">) <font color="#87ceeb">&amp;&amp; make <font color="#87ceeb">install -binPROGRAMS <font color="#87ceeb">install -man1 <font color="#87ceeb">2&gt;&amp;1 <font color="#87ceeb">| tee /tmp/build_cvs_make_install.log <font color="#87ceeb">export <font color="#4682b4">MAKE <font color="#87ceeb">= cygmake<font color="#fa8072">-038190

Background

make 3.81 that is supplied by Cygwin (in the Setup.exe packages collection) is a fine build of that tool but it does not allow the use of a filename spec as a target in Makefiles that looks like  ... that is, a mixed-mode file pathname with canonical forward slashes but a MS Windows volume letter and a colon.

Building from the CVS make code at gnu.org is not very difficult. Developers' tools like Autoconf and Gettext will, of course, need to be be present however.

No special  switches are used to get Windows pathname support in the make program built; it happens by default.

Rationale

For certain projects I mix the MinGW build tools with the Cygwin bash environment. In this case, sometimes automatically generated makefile commands such as the *.d dependency files that some projects will cause to be generated are involved. These are not handled by Cygwin's default make. Avoidance of these makefiles is impossible because they are not hand-written and are generated on-the-fly using output from the MinGW tools (which don't specify or understand POSIX Cygwin pathnames).

Disclaimer

Remember to read and understand all applicable README files included in any source kit that conforms to modern standards, and modify the above script to meet your specific needs. It should go without saying that the results of using the script above are in no way guaranteed; the user is entirely responsible for the burden of any outcome.

Perlsomian 08:03, 11 December 2008 (UTC)