Skip to content

Instantly share code, notes, and snippets.

@exaos
Created January 17, 2013 08:34
Show Gist options
  • Save exaos/4554563 to your computer and use it in GitHub Desktop.
Save exaos/4554563 to your computer and use it in GitHub Desktop.
Better way to find installed ROOT (CERN) in Makefile.
# Find ROOT
ifndef ROOTSYS
ROOT_CONFIG := $(shell which root-config 2> /dev/null)
ifdef ROOT_CONFIG
ROOTSYS := $(shell root-config --prefix)
else
missroot::
@echo "ROOT system is not found!"
endif
else
ROOT_CONFIG := ${ROOTSYS}/bin/root-config
endif
CPPFLAGS += $(shell ${ROOT_CONFIG} --cflags)
EXTRALIBS += $(shell ${ROOT_CONFIG} --glibs)
LDLIBS += $(shell ${ROOT_CONFIG} --glibs)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment