Re: [hackers] [scc][PATCH] Add total compability to the Makefiles

From: Evan Gates <evan.gates_AT_gmail.com>
Date: Thu, 16 Jul 2015 11:32:33 -0700

A few notes on using sh.

The x$var notation is unnecessary and a holdover from very old
prePOSIX shells that had difficulty handling certain arguments or
argument orders with test/[. In this instance, as you are trying to
explicitly match against an empty/unset variable within a case
statement I would write it as:

case "$cc" in
    c99)
        ;;
    ''|gcc)
        ...

I also highly recommend against using backticks for command
substitution. "$(cmd)" follows the convention of using $ to introduce
a substitution and is easier to correctly nest and quote (that being
said the case word in is one of the very few places in which
quoting is not necessary as word splitting and glob expansion do not
happen, but it doesn't hurt either...). As such I would write the
first case as

case "$(uname)" in

Both of those are technically style related, but are IMO good
practice. Feel free to take it or leave it.


In build.sh you have an sh shebang but use source which is a bashism.
For sh it should be . not source.

-emg
Received on Thu Jul 16 2015 - 20:32:33 CEST

This archive was generated by hypermail 2.3.0 : Thu Jul 16 2015 - 20:36:09 CEST