[Swan-dev] "not rocket science" -- master that doesn't fail

Andrew Cagney andrew.cagney at gmail.com
Wed Jan 21 20:12:03 EET 2015


>> (and due to the *(!&$)(!@&# querks of the make system I have to
>> redefine everything to add it)
>
>
> I don't understand why that is. I do understand our make system is
> "*(!&$)(!@&#"

WERROR is set with:
   WERROR?=-Wall -Wextra -Wformat -Wformat-nonliteral
-Wformat-security -Wundef -Wmissing-declarations -Wredundant-decls
-Wnested-externs #-pedantic
so:
    WERROR=-Werror
wipes out all the other flags re-listing everything:
    WERROR=-Werror -Wall -Wextra ...
leaves me open to missing a change to the original definition.

It's as much about !@(*&$)( make as about this make system.  For instance:
   WERROR=-Werror
   WERROR+= -Wall -Wextra -Wformat ...
doesn't help as I can't remove one of the appended flags.  This leads
to conventions such as:
  WERROR_CFLAGS = -Wall -Wextra -Wformat ... $(WERROR)
  CFLAGS = ... $(WERROR_CFLAGS) ...
or, more like automake, define a separate LSW_CFLAGS and .c.o rule,
and leave CFLAGS free for appending options:
LSW_CFLAGS = $(WERROR_CFLAGS) ... $(CFLAGS)
.c.o:
    $(CC) $(LSW_CFLAGS) ...

Andrew


More information about the Swan-dev mailing list