Skip to content
Snippets Groups Projects
Commit 2ce3c2d2 authored by Paul McCarthy's avatar Paul McCarthy :mountain_bicyclist:
Browse files

RF: Honour compilation flags defined in the environment

parent f14bd2c4
No related branches found
No related tags found
No related merge requests found
......@@ -12,14 +12,14 @@ SYSTYPE := $(shell uname -s)
# Standard commands
#
#####################################################################
SHELL = /bin/sh
RM = /bin/rm
CP = /bin/cp
MV = /bin/mv
CHMOD = /bin/chmod
MKDIR = /bin/mkdir
INSTALL = install -p
TCLSH = ${FSLDIR}/bin/fsltclsh
SHELL ?= /bin/sh
RM ?= /bin/rm
CP ?= /bin/cp
MV ?= /bin/mv
CHMOD ?= /bin/chmod
MKDIR ?= /bin/mkdir
INSTALL ?= install -p
TCLSH ?= ${FSLDIR}/bin/fsltclsh
#####################################################################
#
......@@ -53,10 +53,10 @@ ARCHLIBS =
ifeq ($(SYSTYPE), Darwin)
# Commands
CC = cc
CXX = c++
CXX11 = clang++
RANLIB = ranlib
CC ?= cc
CXX ?= c++
CXX11 ?= clang++
RANLIB ?= ranlib
# Compiler flags
ARCHCXXFLAGS += -arch x86_64 -O3 -ansi -Wall -pedantic
......@@ -87,10 +87,10 @@ endif # if Darwin
ifeq ($(SYSTYPE), Linux)
# Commands
CC = gcc
CXX = c++
CXX11 = c++
RANLIB = echo
CC ?= gcc
CXX ?= c++
CXX11 ?= c++
RANLIB ?= echo
# Compiler flags
ARCHCFLAGS += -m64 -fPIC -O3 -fexpensive-optimizations \
......
......@@ -7,38 +7,38 @@ PROJNAME =
# Project-specific compiler/linker flags - these
# can be overridden in the project Makefile
USRLDFLAGS =
USRLDFLAGS =
USRINCFLAGS =
USRCFLAGS =
USRCFLAGS =
USRCXXFLAGS =
LIBS =
LIBS =
# Project outputs - these variables control
# what gets installed from a project. May
# be customised/overridden in project
# Makefiles
HFILES = *.h
AFILES = *.a
SOFILES = *.so
XFILES =
SCRIPTS =
TCLFILES = *.tcl
MANFILES = man/*
HFILES = *.h
AFILES = *.a
SOFILES = *.so
XFILES =
SCRIPTS =
TCLFILES = *.tcl
MANFILES = man/*
TESTXILES =
# Final install destinations for project outputs
DESTDIR = ${FSLDEVDIR}
dest_INCDIR = ${DESTDIR}/include
dest_LIBDIR = ${DESTDIR}/lib
dest_BINDIR = ${DESTDIR}/bin
dest_MANDIR = ${DESTDIR}/man
dest_TCLDIR = ${DESTDIR}/tcl
dest_DOCDIR = ${DESTDIR}/doc
DESTDIR = ${FSLDEVDIR}
dest_INCDIR = ${DESTDIR}/include
dest_LIBDIR = ${DESTDIR}/lib
dest_BINDIR = ${DESTDIR}/bin
dest_MANDIR = ${DESTDIR}/man
dest_TCLDIR = ${DESTDIR}/tcl
dest_DOCDIR = ${DESTDIR}/doc
dest_REFDOCDIR = ${DESTDIR}/refdoc
# Standard header/library locations for compiling/linking
INCDIR = ${FSLDIR}/include
LIBDIR = ${FSLDIR}/lib
INCDIR = ${FSLDIR}/include
LIBDIR = ${FSLDIR}/lib
DEVINCDIR = ${FSLDEVDIR}/include
DEVLIBDIR = ${FSLDEVDIR}/lib
......@@ -49,6 +49,11 @@ INCFLAGS = ${USRINCFLAGS} -I. -I${DEVINCDIR} -I${INCDIR}
# Final compiler/linker flags
#############################
# Honour any flags provided by the environment
CFLAGS ?=
CXXFLAGS ?=
LDFLAGS ?=
# All projects must use these flags for
# compilation/linking, using the form:
#
......@@ -57,9 +62,8 @@ INCFLAGS = ${USRINCFLAGS} -I. -I${DEVINCDIR} -I${INCDIR}
#
# LDFLAGS *must* come at the end, to ensure proper linking.
LDFLAGS = ${ARCHLDFLAGS} ${USRLDFLAGS} \
-L. -L${DEVLIBDIR} -L${LIBDIR} \
${LIBS} ${ARCHLIBS}
CFLAGS = ${ARCHCFLAGS} ${USRCFLAGS} ${USRINCFLAGS} ${INCFLAGS}
CXXFLAGS = ${ARCHCXXFLAGS} ${USRCXXFLAGS} ${USRINCFLAGS} ${INCFLAGS}
LDFLAGS += ${ARCHLDFLAGS} ${USRLDFLAGS} \
-L. -L${DEVLIBDIR} -L${LIBDIR} \
${LIBS} ${ARCHLIBS}
CFLAGS += ${ARCHCFLAGS} ${USRCFLAGS} ${INCFLAGS}
CXXFLAGS += ${ARCHCXXFLAGS} ${USRCXXFLAGS} ${INCFLAGS}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment