Using a build system to build tools.
Once the ROSE library has been configured, built, and installed it can be used. Any program that uses ROSE will likely need to be compiled with the same switches and software components as ROSE itself. The easiest way to get this information is by running "rose-config --help".
1# Sample makefile for programs that use the ROSE library.
3# ROSE has a number of configuration details that must be present when
4# compiling and linking a user program with ROSE, and some of these
5# details are difficult to get right. The most foolproof way to get
6# these details into your own makefile is to use the "rose-config"
10# This makefile assumes:
11# 1. The ROSE library has been properly installed (refer to the
12# documentation for configuring, building, and installing ROSE).
14# 2. The top of the installation directory is $(ROSE_HOME). This
15# is the same directory you specified for the "--prefix" argument
16# of the "configure" script, or the "CMAKE_INSTALL_PREFIX" if using
17# cmake. E.g., "/usr/local".
19# The "rose-config" tool currently only works for ROSE configured with
20# GNU auto tools (e.g., you ran "configure" when you built and
21# installed ROSE). The "cmake" configuration is not currently
22# supported by "rose-config" [September 2015].
23##############################################################################
25#If the ROSE bin directory is in your path, rose-config can be found automatically
27ROSE_HOME = $(shell rose-config prefix)
30include $(ROSE_HOME)/lib/rose-config.cfg
32# Standard C++ compiler stuff (see rose-config --help)
33ROSE_CXX = $(shell $(ROSE_HOME)/bin/rose-config ROSE_CXX)
34ROSE_CPPFLAGS = $(shell $(ROSE_HOME)/bin/rose-config ROSE_CPPFLAGS)
35ROSE_CXXFLAGS = $(shell $(ROSE_HOME)/bin/rose-config ROSE_CXXFLAGS)
36ROSE_LDFLAGS = $(shell $(ROSE_HOME)/bin/rose-config ROSE_LDFLAGS)
37ROSE_LIBDIRS = $(shell $(ROSE_HOME)/bin/rose-config ROSE_LIBDIRS)
38ROSE_RPATHS = $(shell $(ROSE_HOME)/bin/rose-config ROSE_RPATHS)
39ROSE_LINK_RPATHS = $(shell $(ROSE_HOME)/bin/rose-config ROSE_LINK_RPATHS)
43##############################################################################
44# Assuming your source code is "demo.C" to build an executable named "demo".
49 $(ROSE_CXX) $(ROSE_CPPFLAGS) $(ROSE_CXXFLAGS) -o $@ -c $^
52 $(ROSE_CXX) $(ROSE_CXXFLAGS) -o $@ $^ $(ROSE_LDFLAGS) $(ROSE_LINK_RPATHS) -Wl,-rpath=$(ROSE_HOME)/lib
54MOSTLYCLEANFILES += demo demo.o
56##############################################################################
61 rm -f $(MOSTLYCLEANFILES)