Cygwin Wiki

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


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 F:/Builds/my-app/zonko.exe : ... 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 is not very difficult. Developers' tools like Autoconf and Gettext will, of course, need to be be present however.

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


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).


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)