kometbomb / prototracker-modular

A modular synth tracker
MIT License
46 stars 5 forks source link

Improve Makefile.mingw #29

Closed Teteros closed 5 years ago

Teteros commented 5 years ago

Adds conditionals and more env vars to accomodate the different mingw environments out there.

For example, to cross-compile a debug build on Arch Linux you could execute:

CXX=/usr/bin/x86_64-w64-mingw32-g++ \
PKGCONFIG=x86_64-w64-mingw32-pkg-config \
DEBUG=1 make -e mingw

While on msys2 mingw-w64 you could just do: make mingw STATIC=1

Switching to pkg-config makes static linking very easy here. Defaults to release build (without DEBUG=1 set) strips the binary like the linux makefile does.

Also fixed build, at least msys2 mingw needs the math define.

kometbomb commented 5 years ago

Hmm was there something useful in this? I just got back to look at this PR but you closed it.

Teteros commented 5 years ago

Hm, yeah this had all the changes needed to build the project on msys2 distro of mingw on windows at the time. (would need to recompile to see if -D_USE_MATH_DEFINES flag is still needed.)

I've closed it since it wasn't merged for a while so it would need to be rebased on the new script, also for consistency you'd probably want to adapt all the other makefiles to use pkgconfig and the variables this has too.

It's a lot more adaptable for users wanting to build this imo since you don't have to patch the makefile just to change g++ to something else.

kometbomb commented 5 years ago

I made some fixes to the build process so that the mingw cross compilation works, namely fabsf() was not defined when running on the CI box. Similarly the makefile has a change so that I can switch the compiler(s) without a modification. Maybe those fixes do the same thing as your changes?

to 22. elok. 2019 klo 23.25 Teteros (notifications@github.com) kirjoitti:

Hm, yeah this had all the changes needed to build the project on msys2 distro of mingw on windows at the time. (would need to recompile to see if -D_USE_MATH_DEFINES flag is still needed.)

I've closed it since it wasn't merged for a while so it would need to be rebased on the new script, also for consistency you'd probably want to adapt all the other makefiles to use pkgconfig and the variables this has too.

It's a lot more adaptable for users wanting to build this imo since you don't have to patch the makefile just to change g++ to something else.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/kometbomb/prototracker-modular/pull/29?email_source=notifications&email_token=AAIIV2K6ITGNXZFYLCPCOZ3QF3YZHA5CNFSM4G44FCDKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD46JFZQ#issuecomment-524063462, or mute the thread https://github.com/notifications/unsubscribe-auth/AAIIV2PJG6S7LV6HZYBF5ADQF3YZHANCNFSM4G44FCDA .