Commit 70323f40 authored by Ben Avison's avatar Ben Avison
Browse files

Fixes to shared makefiles

Detail:
  The change which permitted top-level makefiles to include only CApp,
  CModule etc accidentally broke makefiles which included HostTools (StdTools
  got included instead and overwrote the HostTools settings). Amazingly, we
  seem to have got away with this so far - but fixed now. Also, brought the
  GNUmakefiles versions in line with updates to the amu Makefiles in this
  and other respects.
Admin:
  Tested in a RISC OS ROM build, and for building cross-compiling versions
  of the tools.

Version 5.21. Tagged as 'BuildSys-5_21'
parent bec13e4f
# Makefile fragment for libraries linked against RAM applications
#
INCLUDED_APPLIBS = YES
ANSILIB = ${LIBDIR}/CLib/ansilib.a
# Can't use ifeq (GNU,${TOOLCHAIN}) here, since we need to allow for host tools being built with GCC even on builds that otherwise use Norcroft
......
# Makefile fragment for defining standard rules for various tools
# when building RAM applications
INCLUDED_APPSTDRULE = YES
# Get the generic rules first
ifeq ("${INCLUDED_STDRULES}","")
include StdRules
endif
# No further application specific standard rules
# EOF
# Makefile fragment for C and C++ applications
INCLUDED_CAPP = YES
#
# This makefile provides the following phony targets:
#
......@@ -27,6 +30,7 @@
# INSTTYPE (opt) (use "tool" or "app" to install executable vs application - defaults to "tool")
# INSTALLAPPFILES (opt) (list of files to be installed in application directory - use InstRes specification rules)
# INSTALLAPP_DEPEND (opt) (list of dependencies to be satisfied before doing application install - ${TARGET} assumed if in INSTALLAPPFILES)
# CUSTOMLINK (opt) (set to "custom" to override the link rule)
# CUSTOMINSTALLAPP (opt) (set to "custom" to override the install rule for resource files)
# CUSTOMINSTALLTOOL (opt) (set to "custom" to override the install rule for target binary)
# SOURCES_TO_LINK (opt) (files which need be linked to by the link farm, in addition to contents of c and h directories)
......@@ -67,13 +71,14 @@ INSTDIR ?= ${INSTALLDIR}/${TARGET}
DIRS ?= _dirs
OBJS ?= ${TARGET}
DBG_OBJS ?= ${OBJS}
APP_LIBS ?= ${LIBS}
DBG_LIBS ?= ${LIBS}
DBG_LIBS += ${DEBUGLIBS}
ifeq (C++,${LINK_TYPE})
LIBS += ${C++LIB}
APP_LIBS += ${C++LIB}
DBG_LIBS += ${C++LIB}
endif
LIBS += ${CLIB}
APP_LIBS += ${CLIB}
DBG_LIBS += ${CLIB}
APP_OBJS ?= $(addsuffix .o,${OBJS})
APP_DBG_OBJS ?= $(addsuffix .od,${DBG_OBJS})
......@@ -92,13 +97,13 @@ ifneq (clean,${MAKECMDGOALS})
linkdest=`echo ${linksource} | sed -e 's,\([^/]*\)/\([^/]*\)$$,\2.\1,' -e 's,^,objs/,'`; \
linkdestdir=`echo $$linkdest | sed -e 's,/[^/]*$$,,'`; \
linkbackpath=`echo $$linkdestdir | sed -e 's,[^/]*,..,g'`; \
[ -d ${linksource} ] || [ -L $$linkdest ] || ${MKDIR} $$linkdestdir; \
[ -d ${linksource} ] || [ -L $$linkdest ] || mkdir -p $$linkdestdir; \
[ -d ${linksource} ] || [ -L $$linkdest ] || ln -s $$linkbackpath/${linksource} $$linkdest; \
) \
)
@[ -L objs/Resources ] || ln -s ../Resources objs/Resources
endif
@[ -d objs ] || ${MKDIR} objs
@mkdir -p objs
ifneq (links,${MAKECMDGOALS})
@${MAKE} -C objs -f ../$(firstword ${MAKEFILE_LIST}) ${MAKECMDGOALS}
endif
......@@ -107,6 +112,22 @@ else
# Makefile invoked from objs subdirectory
ifeq ("${INCLUDED_STDTOOLS}","")
ifeq ("${INCLUDED_HOSTTOOLS}","")
include StdTools
endif
endif
ifeq ("${INCLUDED_APPLIBS}","")
include AppLibs
endif
ifeq ("${INCLUDED_APPSTDRULE}","")
include AppStdRule
endif
ifeq ("${INCLUDED_DBGRULES}","")
include DbgRules
endif
all: ${TARGET}${SUFFIX_ABSOLUTE}
@${ECHO} ${COMPONENT}: application built
......@@ -142,12 +163,12 @@ install_tool${CUSTOMINSTALLTOOL}: ${TARGET}${SUFFIX_ABSOLUTE}
debug: ${DBG_TARGET}${SUFFIX_DEBIMAGE}
@${ECHO} ${COMPONENT}: debug application built
${TARGET}${SUFFIX_ABSOLUTE}: ${DIRS} ${APP_OBJS} ${LIBS}
${LD} ${LDFLAGS} -o $@ ${APP_OBJS} ${LIBS}
${TARGET}${SUFFIX_ABSOLUTE}${CUSTOMLINK}: ${DIRS} ${APP_OBJS} ${APP_LIBS}
${LD} ${LDFLAGS} -o $@ ${APP_OBJS} ${APP_LIBS}
${STRIP} $@
${SQZ} ${SQZFLAGS} $@
${DBG_TARGET}${SUFFIX_DEBIMAGE}: ${DIRS} ${APP_DBG_OBJS} ${DBG_LIBS}
${DBG_TARGET}${SUFFIX_DEBIMAGE}${CUSTOMLINK}: ${DIRS} ${APP_DBG_OBJS} ${DBG_LIBS}
${LD} ${LDFLAGS} ${LDDFLAGS} -o $@ ${APP_DBG_OBJS} ${DBG_LIBS}
include $(wildcard *.d)
......
# Makefile fragment for C and C++ libraries for applications and modules
INCLUDED_CLIBRARY = YES
#
# This makefile provides the following phony targets:
#
......@@ -106,12 +109,12 @@ ifneq (clean,${MAKECMDGOALS})
linkdest=`echo ${linksource} | sed -e 's,\([^/]*\)/\([^/]*\)$$,\2.\1,' -e 's,^,objs/,'`; \
linkdestdir=`echo $$linkdest | sed -e 's,/[^/]*$$,,'`; \
linkbackpath=`echo $$linkdestdir | sed -e 's,[^/]*,..,g'`; \
[ -d ${linksource} ] || [ -L $$linkdest ] || ${MKDIR} $$linkdestdir; \
[ -d ${linksource} ] || [ -L $$linkdest ] || mkdir -p $$linkdestdir; \
[ -d ${linksource} ] || [ -L $$linkdest ] || ln -s $$linkbackpath/${linksource} $$linkdest; \
) \
)
endif
@[ -d objs ] || ${MKDIR} objs
@mkdir -p objs
ifneq (links,${MAKECMDGOALS})
@${MAKE} -C objs -f ../$(firstword ${MAKEFILE_LIST}) ${MAKECMDGOALS}
endif
......@@ -120,6 +123,17 @@ else
# Makefile invoked from objs subdirectory
ifeq ("${INCLUDED_STDTOOLS}","")
include StdTools
endif
ifeq ("${INCLUDED_STDRULES}","")
include StdRules
endif
ifeq ("${INCLUDED_DBGRULES}","")
include DbgRules
endif
all_libs: ${TARGET_LIBS}
@${ECHO} ${COMPONENT}: library built
......
# Makefile fragment for defining standard debug rules for various tools
#
INCLUDED_DBGRULES = YES
ifeq (GNU,${TOOLCHAIN})
CDFLAGS += -g -O0
......
# Makefile fragment for C applications that run on the build host but which
# are built during the main build
INCLUDED_HOSTTOOLS = YES
#
#
# These are the tool definitions for Posix hosted builds.
#
# These are the tool definitions for the GNU toolchain in a POSIX environment, targetting the build host.
#
#
......
# Makefile fragment for defining standard rules for various tools
#
INCLUDED_STDRULES = YES
# $(call make-depend,source,object,depend)
define make-depend
......
# Makefile fragment for defining the various tools and their options
INCLUDED_STDTOOLS = YES
#
# These are the tool definitions for builds using the GNU toolchain in a POSIX environment.
# These are the tool definitions for builds using either the Norcroft or GNU toolchain in a POSIX environment, targetting RISC OS.
#
ifneq (Host,${APCS})
......
......@@ -100,8 +100,10 @@ APP_OBJS ?= $(addprefix o.,${OBJS})
APP_DBG_OBJS ?= $(addprefix od.,${DBG_OBJS})
ifeq ("${INCLUDED_STDTOOLS}","")
ifeq ("${INCLUDED_HOSTTOOLS}","")
include StdTools
endif
endif
ifeq ("${INCLUDED_APPLIBS}","")
include AppLibs
endif
......
/* (5.20)
/* (5.21)
*
* This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.1.
*
*/
#define Module_MajorVersion_CMHG 5.20
#define Module_MajorVersion_CMHG 5.21
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 12 Sep 2011
#define Module_MajorVersion "5.20"
#define Module_Version 520
#define Module_MajorVersion "5.21"
#define Module_Version 521
#define Module_MinorVersion ""
#define Module_Date "12 Sep 2011"
......@@ -18,6 +18,6 @@
#define Module_ComponentName "BuildSys"
#define Module_ComponentPath "castle/RiscOS/BuildSys"
#define Module_FullVersion "5.20"
#define Module_HelpVersion "5.20 (12 Sep 2011)"
#define Module_LibraryVersionInfo "5:20"
#define Module_FullVersion "5.21"
#define Module_HelpVersion "5.21 (12 Sep 2011)"
#define Module_LibraryVersionInfo "5:21"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment