fixed 'install' target
[k8jam.git] / defaults / misc / opts / Jambase.misc.opts
blob6447370b3b1a4ec74413973a45ad217c47acf52d
1 # VAR = [ RemoveOptWild regexp-options-to-remove : options-list : flags ] ;
2 # remove options from list with egrep-like regexps
3 rule RemoveOptWild oname : str : flags {
4   local res = ;
5   local _f _t ;
6   #Echo "removing " $(oname) " from " $(str) ;
7   for _f in $(str) {
8     _t = [ Match $(oname) : $(_f) : $(flags) ] ;
9     #Echo $(f) ": " $(t) ;
10     if $(_t[1]) = "" {
11       #Echo "include: " $(f) ;
12       res += $(_f) ;
13     }
14   }
15   return $(res) ;
19 rule remove-std99-flags optlist {
20   optlist -= "-std=c99" "-std=gnu99" ;
21   return $(optlist) ;
25 # remove-opt-flags $(var)
26 # remove optimization flags from compiler options
27 rule remove-opt-flags {
28   local orm = "-march=*" "-mtune=*" "-mfpmath=*" "-O[0-9s]" ;
29   local ormff = "-f[^n][^o]*" ;
30   local res = [ RemoveOptWild $(orm) $(ormff) : $(<) : glob ] ;
31   return $(res) ;
35 rule remove-opt-flags-for-all-compilers {
36   OPTIM = [ remove-opt-flags $(OPTIM) ] ;
37   C++OPTIM = [ remove-opt-flags $(C++OPTIM) ] ;
38   OBJCOPTIM = [ remove-opt-flags $(OBJCOPTIM) ] ;
39   OPTIM.all = [ remove-opt-flags $(OPTIM.all) ] ;
43 rule gcc-suggest-attrs {
44   if $(SUGGEST) {
45     CFLAGS.all += -Wsuggest-attribute=const ;
46     CFLAGS.all += -Wsuggest-attribute=pure ;
47     CFLAGS.all += -Wsuggest-attribute=noreturn ;
48   }