Commit e993f46a authored by malenov's avatar malenov
Browse files

turn on extended globing to allow !(pattern*) matching

parent a17f8a35
Loading
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -84,13 +84,15 @@ if [ $? -ne 0 ]; then
    exit -1
fi

# strip switches, to remove the macros
# strip switches, to remove the macros (turn on extended globing to allow !(pattern*) matching)
shopt -s extglob
if coan_exists; then
    coan source --replace --no-transients -E -K --file $ifdef_list "$targetdir/lib_{com,dec,enc,rend,util,debug}/(?!wmc_auto)*.[hc]"
    coan source --replace --no-transients -E -K --file $ifdef_list "$targetdir/apps/*.[hc]"
    coan source --replace --no-transients -E -K --file $ifdef_list $targetdir/lib_{com,dec,enc,rend,util,debug}/!(wmc_auto*).[hc]
    coan source --replace --no-transients -E -K --file $ifdef_list $targetdir/apps/*.[hc]
else
    ./strip_defines_cppp.sh $targetdir $ifdef_list
fi
shopt -u extglob

# patch code before wmc_tool: replace hexadecimal unsigned long constants (0x...UL) by regular integer constant + cast to unsigned long
find $targetdir -name "*.[ch]" -exec sed -i.bak -e "s/\(0x[0-9a-fA-F]*\)UL/\(\(unsigned long\)\1\)/" \{\} \;