-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unify makefiles for Linux and MacOS #17
base: master
Are you sure you want to change the base?
Conversation
A bit more context beyond the commit description. The difference between Linux and MacOS is not so big to have different build systems. Having separate makefiles means that certain choices as hidden from view. For instance, some compiler flags are passed on Linux but not on MacOS. Having that logic in one file helps see the difference and why it's needed. Apparently it's because gcc on MacOS is actually clang, which doesn't understand some flags. Then the flags can be based on the compiler rather than on the OS. Somebody can install gcc on MacOS and use the flags supported by gcc. |
I tried you changes in general they are working on Linux (Gentoo) without major issue. The only issue which I could found is that the optimized compile flags are not used in-depended of I use clang (version 19.1.4) or gcc (14.2.1):
If I change line 72 in src/Makefile to
|
Good catch! Thank you for testing! Indeed, I hardcoded |
06e625f
to
142ce5f
Compare
Fixed broken compiler detection. |
I tried your recent changes but it is on my Linux system still not working with gcc/g++ and clang/clang++. Even in the log files from the GitHub CI run it is visible that no optimization flags are used. It will use every time the last choice of the condition in line 89 and 90:
If I change line 82 in src/Makefile from
|
Don't pass BITS to the compiler unless bitness is overridden. Don't try to support generic Windows. MSYS has the install command, MSVC doesn't use the Makefile. Use the install command unconditionally. Make mfakto.ini writable when installed. Set the optimization flags based on whether the compiler is clang or gcc, not based on the OS. Compile C++ files with the C++ compiler. Properly mark targets as phony, the syntax was incorrect. The "src/all" file is not created anymore. Don't override CFLAGS and LDFLAGS on MacOS in CI.
142ce5f
to
b7da6f8
Compare
Fixed gcc detection on Ubuntu. Thank you, @henning-gerhardt! |
Your recent changes are now working without any issue on my Linux system for gcc/g++ and clang/clang++. Results from GitHub CI execution looks even correct. |
Don't pass BITS to the compiler unless bitness is overridden.
Don't try to support generic Windows. MSYS has the install command, MSVC
doesn't use the Makefile.
Use the install command unconditionally. Make mfakto.ini writable when
installed.
Set the optimization flags based on whether the compiler is clang or
gcc, not based on the OS.
Compile C++ files with the C++ compiler.
Properly mark targets as phony, the syntax was incorrect. The "src/all"
file is not created anymore.
Don't override CFLAGS and LDFLAGS on MacOS in CI.