Page 2 of 4

Re: [Patch] New Makefile

PostPosted: Thu Sep 28, 2017 1:54 pm
by Kacperas
I've updated Harry's makefile, to make it compatible with r666.
Tested under MSYS2 environment running on Windows 10 PRO x64.

Re: [Patch] New Makefile

PostPosted: Wed Oct 04, 2017 8:29 am
by Bart
Kacperas wrote:I've updated Harry's makefile, to make it compatible with r666.
Tested under MSYS2 environment running on Windows 10 PRO x64.


Thanks! I've also in the meantime written a more sane Makefile that has proper dependency tracking. Very tricky but compact and clean. It doesn't require using MSYS2, which has the downside of requiring some things to be tweaked, like SDL path, etc. I'll look at Harry's Makefile again this weekend or next week. I'm thinking that I might be able to use the core of my Makefile as an include for a series of smaller Makefiles for MSYS, command prompt, UNIX, Mac OS. There would be no duplication of the compilation rules and source file lists between these, which should prevent them from getting out of sync whenever I add or rename source files (they would all pull in the same common core Makefile).

Re: [Patch] New Makefile

PostPosted: Wed Oct 04, 2017 7:20 pm
by Bart
The Makefiles have been replaced. I haven't tested the UNIX or Mac OS X ones yet but they should work. These Makefiles support parallel compilation. I have to add an Msys Makefile but for now, Makefile.Win32 supports gcc from the ordinary command prompt. The top-level OS-dependent Makefiles still need a little bit of editing to set up SDL include paths and the like but they all include the same core Makefile which has saner rules and auto-generation of dependencies. This means parallel compilation is supported:

Code: Select all
make -f Makefiles/Makefile.Win32 -j6


:)

Oh, Ian: I changed Src/Sound/MPEG/audio.c and .h to amp_audio.*.

Re: [Patch] New Makefile

PostPosted: Thu Oct 05, 2017 7:13 am
by Bart
Some Windows-specific stuff is still in Makefile.inc. I'll fix that tonight.

Re: [Patch] New Makefile

PostPosted: Thu Oct 05, 2017 8:27 am
by Ian
Bart wrote:Oh, Ian: I changed Src/Sound/MPEG/audio.c and .h to amp_audio.*.


Yeah, I saw :) I'll update the windows build when i have a bit of time

Re: [Patch] New Makefile

PostPosted: Thu Oct 05, 2017 2:14 pm
by Kacperas
Bart wrote:The Makefiles have been replaced. I haven't tested the UNIX or Mac OS X ones yet but they should work. These Makefiles support parallel compilation. I have to add an Msys Makefile but for now, Makefile.Win32 supports gcc from the ordinary command prompt. The top-level OS-dependent Makefiles still need a little bit of editing to set up SDL include paths and the like but they all include the same core Makefile which has saner rules and auto-generation of dependencies.
[...]

I've tested new makefile and I wasn't able to build Supermodel using it... After checking the file, I've noticed, that zlib path wasn't declared, so I've added it to Makefile.Win32 and a proper flag to Makefile.inc.
After these changes, svn build in no time. In any case - big thanks. :)

Re: [Patch] New Makefile

PostPosted: Thu Oct 05, 2017 6:06 pm
by Bart
Kacperas wrote:
Bart wrote:The Makefiles have been replaced. I haven't tested the UNIX or Mac OS X ones yet but they should work. These Makefiles support parallel compilation. I have to add an Msys Makefile but for now, Makefile.Win32 supports gcc from the ordinary command prompt. The top-level OS-dependent Makefiles still need a little bit of editing to set up SDL include paths and the like but they all include the same core Makefile which has saner rules and auto-generation of dependencies.
[...]

I've tested new makefile and I wasn't able to build Supermodel using it... After checking the file, I've noticed, that zlib path wasn't declared, so I've added it to Makefile.Win32 and a proper flag to Makefile.inc.
After these changes, svn build in no time. In any case - big thanks. :)


Did you add zlib to PLATFORM_CFLAGS and PLATFORM_LDFLAGS? That's probably where any other additions should go but maybe I should add a specific ZLIB_INCLUDE_DIR and ZLIB_LIB_DIR set of variables to make it more obvious? What do you think?

Re: [Patch] New Makefile

PostPosted: Sat Jan 20, 2018 1:29 pm
by HarryTuttle
I'm planning to make the Net Board emulation available also for MSYS2/GCC users, this is also for me an opportunity to update to the latest makefiles (until now I still used a custom one based on the "legacy version").

I think I've basically done all right but, when trying to compile with the ENABLE_DEBUGGER flag set, all hell breaks loose. In my version I've done some cosmetic change plus some variable renaming (and a bug fix).

I've also fixed (I think) a couple of bugs in Src/Debugger/ConsoleDebugger.cpp and Src/Debugger/IO.h but still the compiler trows out an insane number of errors which go deep down to even some mingw own includes; at this point I'm clueless. I'm attaching here what I've done so far for whoever could be interested in getting his hands "dirty". I hope to get this thing sorted out so I can post a proper patch.

Here are some console snippets from the compiler output
Code: Select all
[...]
In file included from D:/.dev/msys64/mingw64/include/c++/7.2.0/bits/stl_algo.h:60:0,
                 from D:/.dev/msys64/mingw64/include/c++/7.2.0/algorithm:62,
                 from Src/Debugger/AddressTable.h:33,
                 from Src/Debugger/io.h:32,
                 from D:/.dev/msys64/mingw64/x86_64-w64-mingw32/include/unistd.h:10,
                 from D:/.dev/msys64/mingw64/include/zconf.h:475,
                 from D:/.dev/msys64/mingw64/include/zlib.h:34,
                 from Src/Pkgs/unzip.h:51,
                 from Src/GameLoader.h:5,
                 from Src/GameLoader.cpp:1:
D:/.dev/msys64/mingw64/include/c++/7.2.0/bits/algorithmfwd.h:195:3: error: template with C linkage
   template<typename _IIter, typename _Predicate>
   ^~~~~~~~
D:/.dev/msys64/mingw64/include/c++/7.2.0/bits/algorithmfwd.h:199:3: error: template with C linkage
   template<typename _IIter, typename _Predicate>
   ^~~~~~~~
D:/.dev/msys64/mingw64/include/c++/7.2.0/bits/algorithmfwd.h:204:3: error: template with C linkage
   template<typename _FIter, typename _Tp>
   ^~~~~~~~
D:/.dev/msys64/mingw64/include/c++/7.2.0/bits/algorithmfwd.h:208:3: error: template with C linkage
   template<typename _FIter, typename _Tp, typename _Compare>

[...]

In file included from D:/.dev/msys64/mingw64/include/c++/7.2.0/bits/stl_algo.h:66:0,
                 from D:/.dev/msys64/mingw64/include/c++/7.2.0/algorithm:62,
                 from Src/Debugger/AddressTable.h:33,
                 from Src/Debugger/io.h:32,
                 from D:/.dev/msys64/mingw64/x86_64-w64-mingw32/include/unistd.h:10,
                 from D:/.dev/msys64/mingw64/include/zconf.h:475,
                 from D:/.dev/msys64/mingw64/include/zlib.h:34,
                 from Src/Pkgs/unzip.h:51,
                 from Src/GameLoader.h:5,
                 from Src/GameLoader.cpp:1:
D:/.dev/msys64/mingw64/include/c++/7.2.0/bits/uniform_int_dist.h:44:5: error: template with C linkage
     template<typename _Tp>
     ^~~~~~~~
D:/.dev/msys64/mingw64/include/c++/7.2.0/bits/uniform_int_dist.h:60:3: error: template with C linkage
   template<typename _IntType = int>
   ^~~~~~~~
D:/.dev/msys64/mingw64/include/c++/7.2.0/bits/uniform_int_dist.h:218:3: error: template with C linkage
   template<typename _IntType>
   ^~~~~~~~
D:/.dev/msys64/mingw64/include/c++/7.2.0/bits/uniform_int_dist.h:284:3: error: template with C linkage
   template<typename _IntType>
   ^~~~~~~~
In file included from D:/.dev/msys64/mingw64/include/c++/7.2.0/algorithm:62:0,
                 from Src/Debugger/AddressTable.h:33,
                 from Src/Debugger/io.h:32,
                 from D:/.dev/msys64/mingw64/x86_64-w64-mingw32/include/unistd.h:10,
                 from D:/.dev/msys64/mingw64/include/zconf.h:475,
                 from D:/.dev/msys64/mingw64/include/zlib.h:34,
                 from Src/Pkgs/unzip.h:51,
                 from Src/GameLoader.h:5,
                 from Src/GameLoader.cpp:1:
D:/.dev/msys64/mingw64/include/c++/7.2.0/bits/stl_algo.h:76:3: error: template with C linkage
   template<typename _Iterator, typename _Compare>
   ^~~~~~~~
D:/.dev/msys64/mingw64/include/c++/7.2.0/bits/stl_algo.h:99:3: error: template with C linkage
   template<typename _InputIterator, typename _Predicate>
   ^~~~~~~~
D:/.dev/msys64/mingw64/include/c++/7.2.0/bits/stl_algo.h:110:3: error: template with C linkage
   template<typename _RandomAccessIterator, typename _Predicate>

[...]

In file included from D:/.dev/msys64/mingw64/include/zconf.h:475:0,
                 from D:/.dev/msys64/mingw64/include/zlib.h:34,
                 from Src/Pkgs/unzip.h:51,
                 from Src/GameLoader.h:5,
                 from Src/GameLoader.cpp:1:
D:/.dev/msys64/mingw64/x86_64-w64-mingw32/include/unistd.h: In function 'int ftruncate(int, off32_t)':
D:/.dev/msys64/mingw64/x86_64-w64-mingw32/include/unistd.h:67:10: error: '_chsize' was not declared in this scope
   return _chsize (__fd, __length);
          ^~~~~~~
D:/.dev/msys64/mingw64/x86_64-w64-mingw32/include/unistd.h:67:10: note: suggested alternative: '_msize'
   return _chsize (__fd, __length);
          ^~~~~~~
          _msize
Generating dependencies: Src/Graphics/Legacy3D/TextureRefs.cpp -> _obj/TextureRefs.d
Compiling              : Src/Graphics/Legacy3D/TextureRefs.cpp -> _obj/TextureRefs.o
make: *** [Makefiles/Makefile.inc:324: _obj/GameLoader.o] Error 1

[...]

In file included from D:/.dev/msys64/mingw64/include/zconf.h:475:0,
                 from D:/.dev/msys64/mingw64/include/zlib.h:34,
                 from Src/Pkgs/unzip.h:51,
                 from Src/GameLoader.h:5,
                 from Src/OSD/SDL/Main.cpp:71:
D:/.dev/msys64/mingw64/x86_64-w64-mingw32/include/unistd.h: In function 'int ftruncate(int, off32_t)':
D:/.dev/msys64/mingw64/x86_64-w64-mingw32/include/unistd.h:67:10: error: '_chsize' was not declared in this scope
   return _chsize (__fd, __length);
          ^~~~~~~
D:/.dev/msys64/mingw64/x86_64-w64-mingw32/include/unistd.h:67:10: note: suggested alternative: '_msize'
   return _chsize (__fd, __length);
          ^~~~~~~
          _msize
Generating dependencies: Src/Pkgs/unzip.c -> _obj/unzip.d
Compiling              : Src/Pkgs/unzip.c -> _obj/unzip.o
Generating dependencies: Src/ROMSet.cpp -> _obj/ROMSet.d
Compiling              : Src/ROMSet.cpp -> _obj/ROMSet.o
make: *** [Makefiles/Makefile.inc:322: _obj/Main.o] Error 1



Main.cpp and GameLoader.cpp seem to fail to compile.

Re: [Patch] New Makefile

PostPosted: Sat Jan 20, 2018 1:53 pm
by Ian
It builds with visual studio .. so I don't know what the error is :(
Probably something include related. I can't figure out why it's complaining about templates with C linkage, because almost no templates are used in the project

Re: [Patch] New Makefile

PostPosted: Sat Jan 20, 2018 8:52 pm
by HarryTuttle
I've narrowed down the issues, but still...
Code: Select all
Generating dependencies: Src/GameLoader.cpp -> _obj/GameLoader.d
Compiling              : Src/GameLoader.cpp -> _obj/GameLoader.o
Generating dependencies: Src/OSD/SDL/Main.cpp -> _obj/Main.d
Compiling              : Src/OSD/SDL/Main.cpp -> _obj/Main.o
In file included from D:/.dev/msys64/mingw64/x86_64-w64-mingw32/include/unistd.h:10:0,
                 from D:/.dev/msys64/mingw64/include/zconf.h:475,
                 from D:/.dev/msys64/mingw64/include/zlib.h:34,
                 from Src/Pkgs/unzip.h:51,
                 from Src/GameLoader.h:5,
                 from Src/GameLoader.cpp:1:
Src/Debugger/io.h:126:2: error: expected class-name before '{' token
  {
  ^
In file included from D:/.dev/msys64/mingw64/include/zconf.h:475:0,
                 from D:/.dev/msys64/mingw64/include/zlib.h:34,
                 from Src/Pkgs/unzip.h:51,
                 from Src/GameLoader.h:5,
                 from Src/GameLoader.cpp:1:
D:/.dev/msys64/mingw64/x86_64-w64-mingw32/include/unistd.h: In function 'int ftruncate(int, off32_t)':
D:/.dev/msys64/mingw64/x86_64-w64-mingw32/include/unistd.h:67:10: error: '_chsize' was not declared in this scope
   return _chsize (__fd, __length);
          ^~~~~~~
D:/.dev/msys64/mingw64/x86_64-w64-mingw32/include/unistd.h:67:10: note: suggested alternative: '_msize'
   return _chsize (__fd, __length);
          ^~~~~~~
          _msize
make: *** [Makefiles/Makefile.inc:324: _obj/GameLoader.o] Error 1
In file included from D:/.dev/msys64/mingw64/include/zconf.h:475:0,
                 from D:/.dev/msys64/mingw64/include/zlib.h:34,
                 from Src/Pkgs/unzip.h:51,
                 from Src/GameLoader.h:5,
                 from Src/OSD/SDL/Main.cpp:71:
D:/.dev/msys64/mingw64/x86_64-w64-mingw32/include/unistd.h: In function 'int ftruncate(int, off32_t)':
D:/.dev/msys64/mingw64/x86_64-w64-mingw32/include/unistd.h:67:10: error: '_chsize' was not declared in this scope
   return _chsize (__fd, __length);
          ^~~~~~~
D:/.dev/msys64/mingw64/x86_64-w64-mingw32/include/unistd.h:67:10: note: suggested alternative: '_msize'
   return _chsize (__fd, __length);
          ^~~~~~~
          _msize
make: *** [Makefiles/Makefile.inc:324: _obj/Main.o] Error 1
make: Target 'all' not remade because of errors.