Makefile.m32: reintroduce CROSSPREFIX and -W -Wall [ci skip]

- Reintroduce `CROSSPREFIX`:

  If set, we add it to the `CC` and `AR` values, and to the _default_
  value of `RC`, which is `windres`. This allows to control each of
  these individidually, while also allowing to simplify configuration
  via `CROSSPREFIX`.

  This variable worked differently earlier. Hopefully this new solution
  hits a better compromise in usefulness/complexity/flexibility.

  Follow-up to: aa970c4c08

- Enable warnings again:

  This time with an option to override it via `CFLAGS`. Warnings are
  also enabled by default in CMake, `makefile.dj` and `makefile.amiga`
  builds (not in autotools though).

  Follow-up to 10fbd8b4e3

Closes #9784
This commit is contained in:
Viktor Szakats 2022-10-22 23:21:03 +00:00
parent 9b63dda16e
commit a0d8a1aa91
No known key found for this signature in database
GPG Key ID: B5ABD165E2AEF201

View File

@ -29,7 +29,7 @@
#
# Set component roots via envvar <feature>_PATH. Also available for
# customization: CC, RC, AR, CPPFLAGS, LDFLAGS, LIBS, CFLAGS, RCFLAGS,
# ARCH[=custom], CURL_LDFLAGS_BIN, CURL_LDFLAGS_LIB, CURL_DLL_SUFFIX,
# ARCH[=custom], CROSSPREFIX, CURL_LDFLAGS_BIN, CURL_LDFLAGS_LIB, CURL_DLL_SUFFIX,
# and more for individual components (see below).
# This script is reused by 'src' and 'docs/examples' Makefile.m32 scripts.
@ -76,6 +76,10 @@ endif
CPPFLAGS += -I. -I$(PROOT)/include
RCFLAGS += -I$(PROOT)/include
CC := $(CROSSPREFIX)$(CC)
AR := $(CROSSPREFIX)$(AR)
RC ?= $(CROSSPREFIX)windres
ifneq ($(ARCH),custom)
# Set environment var ARCH to your architecture to override auto-detection.
ifndef ARCH
@ -302,8 +306,6 @@ endif
### Global rules
RC ?= windres
ifneq ($(findstring /sh,$(SHELL)),)
DEL = rm -f $1
COPY = -cp -afv $1 $2
@ -315,7 +317,7 @@ endif
all: $(TARGETS)
%.o: %.c
$(CC) $(CFLAGS) $(CPPFLAGS) -c $<
$(CC) -W -Wall $(CFLAGS) $(CPPFLAGS) -c $<
%.res: %.rc
$(RC) -O coff $(RCFLAGS) -i $< -o $@