I've been using gmake since 2002. To feel its power, try this -- https://mxe.cc/gmsl.htmlChange my mind...
It's lang/mono all the way for me![]()
Of those, I'll always opt for CMake. Meson has its own set of dependency hell(s).CMake or Meson simply because homegrown configure scripts and makefiles are a pita and prone to break on various platforms when packaging but to answer if you can do with (b)make compatibility that's great.
Indeed. The trick is to avoid i.e pattern rules, then your POSIX-compliant Makefile can run in most places.As for Embedded programming, as an example, NXP's Smart Card Composer (the SDK/IDE for develop OS on microcontrollers) uses GNU Make.
And as for cross-platforms, I use GNU Make on FreeBSD, Linux, Windows, and makefiles are (almost) the same for all these platforms.
With BSD make I can get the preferred CFLAGS, LDFLAGS, etc used by the system. No need to specify rules at all for simple programs. And the BSD's don't diverge a lot in this regard when including `bsd.*.mk`, which takes me to the next point:As for Embedded programming, as an example, NXP's Smart Card Composer (the SDK/IDE for develop OS on microcontrollers) uses GNU Make.
And as for cross-platforms, I use GNU Make on FreeBSD, Linux, Windows, and makefiles are (almost) the same for all these platforms.
Sorry for the grumbling old raving GNU Make zealot.![]()
Yes, otherwise you have to create files with pattern rules for each platform, in which you specify something like this:Indeed. The trick is to avoid i.e pattern rules, then your POSIX-compliant Makefile can run in most places.
# *.c -> *.obj
$(_TMP_DIR)/%.obj: %.c $(_PCH_NAME)
$(call _MakeDir,$@)
@$(_ECHO_CMD) $(_COMPILER) $(C_OPT) $(_PCH_OPT) -Fo$@ $<
# *.c -> *.o
$(_TMP_DIR)/%.o: %.c
$(call _MakeDir,$@)
$(_COMPILER) $(C_OPT) -o $@ $<
This is not mandatory, but overall, yes, this is 'vision' and 'common practice' of writing gnu makefiles. The general logic ( and default values for variables) is defined in a single file (main.mak), and the specifics for the current project/library in the project makefile. The latter includes the former. Inclusion of main.mak in project makefile is performed after all the specifics of the project have been defined.When you have common stuff that you want to reuse in Makefiles, the `.include`directive in BSD Make behaves just like C's `#include`. With GNU Make I have to move the `include` to the bottom I don't know why.
... ... ...
export PLATFORM ?= WINDOWS
ifeq ($(PLATFORM),WINDOWS)
LIB_TESTS_LOG ?= nul
else
LIB_TESTS_LOG ?= /dev/null
endif
ifeq ($(MAKELEVEL),10)
$(error Too deep recursion level)
endif
ifeq ($(PLATFORM),WINDOWS)
_MAKEDEP_UTIL:=perl.exe $(ROOT_DIR)/env/bin/makedep_win.pl
else
_MAKEDEP_UTIL:=$(ROOT_DIR)/env/bin/makedep_lin.pl
endif
.PHONY: all always
all: build
_MAKE_DIR := $(ROOT_DIR)/make
include $(_MAKE_DIR)/gmsl
include $(_MAKE_DIR)/Lib.mak
... ... ...
ROOT_DIR := ../../..
SUB_ROOT_DIR := env
ifeq ($(PLATFORM),UNIX)
TARGET := libcryptLib.a
else
TARGET := cryptlib.lib
endif
include $(ROOT_DIR)/make/openssl.mak
include $(ROOT_DIR)/make/main.mak