Hey On Mon, Mar 9, 2015 at 11:23 PM, Andy Falanga (afalanga) <afala...@micron.com> wrote: > Hi, > > The project I'm working on builds in both Windows and Linux. As you may > imagine, there are some conditional compilations and, in fact, sometimes full > files are left out. There are also some header files, and a python script > for auto-building a header file, which must be distributed too. It seemed > that EXTRA_DIST was the ticket for me. > > I started adding this to the Makefile.am > > EXTRA_DIST = path/to/prebuild.py path/to/header1.hpp path/to/header2.hpp \ > path/to/header3.hpp path/to/header4.hpp > > This worked just fine when I did "make dist". Then, when attempting another > build, I ran into the next scenario: headers not used on Linux but still part > of the distribution. "No problem," I think, and add it to the EXTRA_DIST > variable along with its companion code file. Well, I did so like this: > > EXTRA_DIST = path/to/prebuild.py path/to/header1.hpp path/to/header2.hpp \ > path/to/header3.hpp path/to/header4.hpp path/to/WindowsHeader.h \ > path/to/WindowsSource.cpp > > Then I do "autoreconf", "./configure" and finally, "make dist". Only this > time, I'm greeted with this: > > make[1]: *** No rule to make target `path/to/WindowsHeader.cpp', needed by > `distdir'. Stop.
just be sure that path/to/WindowsHeader.cpp exists. There should ne problem (I've already did that) > I try taking out the *.cpp file and try again with the same error but with > the *.h. If I take out the *.h file, all is well again and "make dist" is > happy and fine. Why is it picky with files ending with *.cpp and *.h if > these things are extra to the distribution and have nothing to do with the > build anyway? usually, when trying to build a program / library on Windows and Linux, I try to also compile the Windows part with gcc (MSYS or MSYS2 for the shell (like a Linux terminal), mingw-w64 for the gcc compiler). So I add the Windows file conditionally to the _SOURCE variable. The side effect is that these Windows files are always added to the dist tarball. Another advantage : even if you are on Linux, you can cross-compile your project for Windows, without switching to Windows. Vincent