Skip to content

Conversation

@feiyunw
Copy link

@feiyunw feiyunw commented Oct 4, 2022

Common changes:

  • CXX, CXXFLAGS, LDFLAGS, RM, LDFLAGS and LDLIBS are common variables used in GNU make built-in rules.
    CXX defaults to 'g++", which will be OK usually.
    see GNU Make manual 10.3 Variables Used by Implicit Rules.
  • Add -I../include, so the ugly #include statements can be rectified in the future.

src/Makefiles/Makefile_mingw:

  • Add common macros for Windows DLLs.
  • THREADING & THREAD_LINK: replace boost w/ winapi
    Boost may not be installed, while winapi is essential on MinGW.
  • Add MINGW32 support.
  • Add -flto -fwhole-program
    FYI:
    w/o -flto: DLL size 387,584 bytes
    w/ -flto (-fuse-linker-plugin): DLL size 409,088 bytes
    w/ -flto -fwhole-program: DLL size 296,960 bytes

test/Makefiles/Makefile_mingw:

  • Add common macros for Windows exe.
  • $(THREAD_LINK): replace boost w/ winapi
  • Use .exe suffix for executales.
    MinGW is for building Windows app.
  • Add -flto
  • Add missing ThreadMgr.cpp to dds_sources.txt

examples/Makefiles/Makefile_mingw:

  • Add common macros for Windows exe.
  • Add missing .cpp suffix in $(ALL_EXAMPLE_FILES).
  • Replace -Wl,--subsystem,windows w/ -mconsole.
  • Optimize rules for executables.
  • Use .PRECIOUS to preserve .o files.
    See GNU Make manual 10.4 Chains of Implicit Rules.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant