Guest User

Untitled

a guest
Jan 23rd, 2019
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.96 KB | None | 0 0
  1. os = $(uname -a | awk '{print $2}')
  2. ifeq(os, "redhat7")
  3. CC=/opt/rh/devtoolset-7/root/usr/bin/gcc
  4. CXX=/opt/rh/devtoolset-7/root/usr/bin/g++
  5. ...
  6. endif
  7.  
  8. include gmtt-master/gmtt-master/gmtt.mk
  9.  
  10. # Table with two (indicator "2" as first element) columns. First column is a glob which matches the OS, second is option string
  11. # Warning! No spaces in either column are allowed - use $(call spc-mask,...options...) if there are.
  12. define CC_OPTIONS_TBL
  13. 2
  14. redhat[!7]* /opt/rh/devtoolset-6/root/usr/bin/gcc
  15. redhat7 /opt/rh/devtoolset-7/root/usr/bin/gcc
  16. suse* /opt/bin/rh/devtoolset-7/root/usr/bin/gcc
  17. endef
  18.  
  19. CC_OPT := $(call select,2,$(CC_OPTIONS_TBL),$$(call glob-match,$(MY_OS),$$1))
  20.  
  21. $(info CC_OPT = $(CC_OPT))
  22.  
  23. define CXX_OPTIONS_TBL
  24. 2
  25. redhat[!7]* $(call spc-mask, /opt/rh/devtoolset-6/root/usr/bin/gcc -DREDHAT -O2)
  26. redhat7 $(call spc-mask, /opt/rh/devtoolset-7/root/usr/bin/gcc -DREDHAT_7 -O3)
  27. suse* $(call spc-mask, /opt/bin/rh/devtoolset-7/root/usr/bin/gcc -DSUSE -O0)
  28. suse8 $(call spc-mask, -DFOO -DBAR)
  29. endef
  30.  
  31. CXX_OPT := $(call spc-unmask,$(call select,2,$(CXX_OPTIONS_TBL),$$(call glob-match,$(MY_OS),$$1)))
  32.  
  33. $(info CXX_OPT = $(CXX_OPT))
  34.  
  35. mark@zws103 ~
  36. $ make MY_OS=suse
  37. CC_OPT = /opt/bin/rh/devtoolset-7/root/usr/bin/gcc
  38. CXX_OPT = /opt/bin/rh/devtoolset-7/root/usr/bin/gcc -DSUSE -O0
  39. make: *** Keine Ziele. Schluss.
  40.  
  41. mark@zws103 ~
  42. $ make MY_OS=redhat6.1
  43. CC_OPT = /opt/rh/devtoolset-6/root/usr/bin/gcc
  44. CXX_OPT = /opt/rh/devtoolset-6/root/usr/bin/gcc -DREDHAT -O2
  45. make: *** Keine Ziele. Schluss.
  46.  
  47. mark@zws103 ~
  48. $ make MY_OS=redhat7
  49. CC_OPT = /opt/rh/devtoolset-7/root/usr/bin/gcc
  50. CXX_OPT = /opt/rh/devtoolset-7/root/usr/bin/gcc -DREDHAT_7 -O3
  51. make: *** Keine Ziele. Schluss.
  52.  
  53. mark@zws103 ~
  54. $ make MY_OS=redhat7.1
  55. CC_OPT =
  56. CXX_OPT =
  57. make: *** Keine Ziele. Schluss.
  58.  
  59. $ make MY_OS=suse8
  60. CC_OPT = /opt/bin/rh/devtoolset-7/root/usr/bin/gcc
  61. CXX_OPT = /opt/bin/rh/devtoolset-7/root/usr/bin/gcc -DSUSE -O0 -DFOO -DBAR
  62. make: *** Keine Ziele. Schluss.
Add Comment
Please, Sign In to add comment