Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- os = $(uname -a | awk '{print $2}')
- ifeq(os, "redhat7")
- CC=/opt/rh/devtoolset-7/root/usr/bin/gcc
- CXX=/opt/rh/devtoolset-7/root/usr/bin/g++
- ...
- endif
- include gmtt-master/gmtt-master/gmtt.mk
- # Table with two (indicator "2" as first element) columns. First column is a glob which matches the OS, second is option string
- # Warning! No spaces in either column are allowed - use $(call spc-mask,...options...) if there are.
- define CC_OPTIONS_TBL
- 2
- redhat[!7]* /opt/rh/devtoolset-6/root/usr/bin/gcc
- redhat7 /opt/rh/devtoolset-7/root/usr/bin/gcc
- suse* /opt/bin/rh/devtoolset-7/root/usr/bin/gcc
- endef
- CC_OPT := $(call select,2,$(CC_OPTIONS_TBL),$$(call glob-match,$(MY_OS),$$1))
- $(info CC_OPT = $(CC_OPT))
- define CXX_OPTIONS_TBL
- 2
- redhat[!7]* $(call spc-mask, /opt/rh/devtoolset-6/root/usr/bin/gcc -DREDHAT -O2)
- redhat7 $(call spc-mask, /opt/rh/devtoolset-7/root/usr/bin/gcc -DREDHAT_7 -O3)
- suse* $(call spc-mask, /opt/bin/rh/devtoolset-7/root/usr/bin/gcc -DSUSE -O0)
- suse8 $(call spc-mask, -DFOO -DBAR)
- endef
- CXX_OPT := $(call spc-unmask,$(call select,2,$(CXX_OPTIONS_TBL),$$(call glob-match,$(MY_OS),$$1)))
- $(info CXX_OPT = $(CXX_OPT))
- mark@zws103 ~
- $ make MY_OS=suse
- CC_OPT = /opt/bin/rh/devtoolset-7/root/usr/bin/gcc
- CXX_OPT = /opt/bin/rh/devtoolset-7/root/usr/bin/gcc -DSUSE -O0
- make: *** Keine Ziele. Schluss.
- mark@zws103 ~
- $ make MY_OS=redhat6.1
- CC_OPT = /opt/rh/devtoolset-6/root/usr/bin/gcc
- CXX_OPT = /opt/rh/devtoolset-6/root/usr/bin/gcc -DREDHAT -O2
- make: *** Keine Ziele. Schluss.
- mark@zws103 ~
- $ make MY_OS=redhat7
- CC_OPT = /opt/rh/devtoolset-7/root/usr/bin/gcc
- CXX_OPT = /opt/rh/devtoolset-7/root/usr/bin/gcc -DREDHAT_7 -O3
- make: *** Keine Ziele. Schluss.
- mark@zws103 ~
- $ make MY_OS=redhat7.1
- CC_OPT =
- CXX_OPT =
- make: *** Keine Ziele. Schluss.
- $ make MY_OS=suse8
- CC_OPT = /opt/bin/rh/devtoolset-7/root/usr/bin/gcc
- CXX_OPT = /opt/bin/rh/devtoolset-7/root/usr/bin/gcc -DSUSE -O0 -DFOO -DBAR
- make: *** Keine Ziele. Schluss.
Add Comment
Please, Sign In to add comment