Commit 684d01e3 authored by Ben Avison's avatar Ben Avison
Browse files

Improvements to shared makefiles

Detail:
  * Some subtle bugs can be caused by including shared makefiles in the
    wrong order. To try to prevent further problems, and simplify main
    makefiles at the same time, CApp, CLibrary and CModule now include the
    makefiles they depend upon themselves, in the correct order: generally
    speaking, all macro (re)definitions should be before rule definitions.
  * Added sentry macro definitions to each makefile. These can be used to
    avoid repeated inclusion of makefiles - particularly important now that
    CApp, CLibrary and CModule do additional includes. This removes the
    majority of cases where amu produced warnings about multiple inclusion;
    a few components remain where this is still the case, but these
    warnings are harmless. If they bother you, simply remove the
    now-superfluous include statements from the relevant main makefile.
  * Created a CUtil shared makefile, for building transient utilities. The
    'C' in the name is more for c...
parent ebf083ac
......@@ -14,6 +14,9 @@
#
# Makefile fragment for assembler modules targetted at ROMming, previously built
# using AAsm but now using objasm.
INCLUDED_AASMMODULE = YES
#
# $Id$
#
......
......@@ -13,6 +13,9 @@
# limitations under the License.
#
# Makefile fragment for libraries linked against RAM applications
INCLUDED_APPLIBS = YES
#
STDMAKEFILE=$Id$
#
......
......@@ -14,6 +14,9 @@
#
# Makefile fragment for defining standard rules for various tools
# when building RAM applications
INCLUDED_APPSTDRULE = YES
#
# $Id$
#
......
......@@ -13,6 +13,9 @@
# limitations under the License.
#
# Makefile fragment for Binary Build Environment exporting.
INCLUDED_BBEEXPORT = YES
#
# This Makefile is included directly by srcbuild as the core implementation
# of the binary build environment phase.
......
......@@ -13,6 +13,9 @@
# limitations under the License.
#
# Makefile fragment for C and C++ applications
INCLUDED_CAPP = YES
#
# $Id$
#
......@@ -43,6 +46,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)
#
......@@ -84,16 +88,31 @@ INSTDIR ?= ${INSTALLDIR}.${TARGET}
DIRS ?= o._dirs
OBJS ?= ${TARGET}
DBG_OBJS ?= ${OBJS}
APP_LIBS ?= ${LIBS}
DBG_LIBS ?= ${LIBS}
ifeq (C++,${LINK_TYPE})
LIBS += ${C++LIB}
APP_LIBS += ${C++LIB}
DBG_LIBS += ${C++LIB}
endif
LIBS += ${CLIB}
APP_LIBS += ${CLIB}
DBG_LIBS += ${DEBUGLIBS} ${CLIB}
APP_OBJS ?= $(addprefix o.,${OBJS})
APP_DBG_OBJS ?= $(addprefix od.,${DBG_OBJS})
ifeq ("${INCLUDED_STDTOOLS}","")
include StdTools
endif
ifeq ("${INCLUDED_APPLIBS}","")
include AppLibs
endif
ifeq ("${INCLUDED_APPSTDRULE}","")
include AppStdRule
endif
ifeq ("${INCLUDED_DBGRULES}","")
include DbgRules
endif
all: ${TARGET}
@${ECHO} ${COMPONENT}: application built
......@@ -136,11 +155,11 @@ install_tool${CUSTOMINSTALLTOOL}: ${TARGET}
debug: ${DBG_TARGET}
@${ECHO} ${COMPONENT}: debug application built
${TARGET}: ${APP_OBJS} ${LIBS} ${DIRS}
${LD} ${LDFLAGS} -o ${TARGET} ${APP_OBJS} ${LIBS}
${TARGET}${CUSTOMLINK}: ${APP_OBJS} ${APP_LIBS} ${DIRS}
${LD} ${LDFLAGS} -o ${TARGET} ${APP_OBJS} ${APP_LIBS}
${SQZ} ${SQZFLAGS} $@
${DBG_TARGET}: ${APP_DBG_OBJS} ${DBG_LIBS} ${DIRS}
${DBG_TARGET}${CUSTOMLINK}: ${APP_DBG_OBJS} ${DBG_LIBS} ${DIRS}
${LD} ${LDFLAGS} ${LDDFLAGS} -o ${DBG_TARGET} ${APP_DBG_OBJS} ${DBG_LIBS}
# EOF
......@@ -13,6 +13,9 @@
# limitations under the License.
#
# Makefile fragment for C and C++ libraries for applications and modules
INCLUDED_CLIBRARY = YES
#
# $Id$
#
......@@ -107,6 +110,17 @@ EXPORTING_ASMHDRS = $(addprefix expasm.,${ASMHDRS})
EXPORTING_LIBS = $(addprefix explib.,${LIBRARIES})
TARGET_LIBS = $(addprefix ${LIBEXT}.,${LIBRARIES})
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 C and C++ modules
INCLUDED_CMODULE = YES
#
# $Id$
#
......@@ -174,6 +177,19 @@ CDEFINES += ${ROMCDEFINES}
ASMDEFINES += ${ROMASMDEFINES}
endif
ifeq ("${INCLUDED_STDTOOLS}","")
include StdTools
endif
ifeq ("${INCLUDED_MODULELIBS}","")
include ModuleLibs
endif
ifeq ("${INCLUDED_MODSTDRULE}","")
include ModStdRule
endif
ifeq ("${INCLUDED_DBGRULES}","")
include DbgRules
endif
# General rules
......
......@@ -13,6 +13,9 @@
# limitations under the License.
#
# Makefile fragment for defining standard debug rules for various tools
INCLUDED_DBGRULES = YES
#
# $Id$
#
......
......@@ -14,6 +14,9 @@
#
# 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 RISC OS hosted builds.
......
......@@ -14,6 +14,9 @@
#
# Makefile fragment for defining standard rules for various tools
# when building modules
INCLUDED_MODSTDRULE = YES
#
# $Id$
#
......
......@@ -13,6 +13,9 @@
# limitations under the License.
#
# Makefile fragment for libraries linked against modules (RAM or ROM)
INCLUDED_MODULELIBS = YES
#
STDMAKEFILE=$Id$
#
......
......@@ -13,6 +13,9 @@
# limitations under the License.
#
# Makefile fragment for C and C++ modules targetted at RAM.
INCLUED_RAMCMODULE = YES
#
# $Id$
#
......
......@@ -13,6 +13,9 @@
# limitations under the License.
#
# Makefile fragment for assembler modules targetted at RAM, built using objasm
INCLUDED_RAMMODULE = YES
#
# $Id$
#
......
......@@ -13,6 +13,9 @@
# limitations under the License.
#
# Makefile fragment for C and C++ modules targetted at ROMming.
INCLUDED_ROMCMODULE = YES
#
# $Id$
#
......
......@@ -13,6 +13,9 @@
# limitations under the License.
#
# Makefile fragment for assembler modules targetted at ROMming, built using objasm
INCLUDED_ROMMODULE = YES
#
# $Id$
#
......
......@@ -13,6 +13,9 @@
# limitations under the License.
#
# Makefile fragment for defining standard rules for various tools
INCLUDED_STDRULES = YES
#
# $Id$
#
......
......@@ -13,6 +13,9 @@
# limitations under the License.
#
# Makefile fragment for defining the various tools and their options
INCLUDED_STDTOOLS = YES
#
# $Id$
#
......@@ -100,6 +103,8 @@ STDTOOLOPTIONS = -depend !Depend ${THROWBACK}
AASMFLAGS += -Stamp -quit ${STDTOOLOPTIONS} ${AASMDEFINES} ${AASMINCLUDES}
ASFLAGS += -Stamp -quit ${STDTOOLOPTIONS} ${ASMDEFINES} ${ASMINCLUDES}
ASFLAGS += -ihdr -i<Hdr$Dir>.Global -i<Hdr$Dir>.Interface -i<Hdr$Dir>.Interface2
ASFLAGS += -pd "APCS SETS \"${APCS}\"" -pd "Machine SETS \"${MACHINE}\"" -pd "UserIF SETS \"${USERIF}\""
CFLAGS += -c ${STDTOOLOPTIONS} ${CDEFINES} ${CINCLUDES} ${C_NO_FNAMES} ${C_WARNINGS}
C++INCLUDES += -ICPP:
C++FLAGS += -c ${STDTOOLOPTIONS} ${C++DEFINES} ${C++INCLUDES}
......
/* (5.11)
/* (5.12)
*
* This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.1.
*
*/
#define Module_MajorVersion_CMHG 5.11
#define Module_MajorVersion_CMHG 5.12
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 19 Mar 2011
#define Module_Date_CMHG 31 Mar 2011
#define Module_MajorVersion "5.11"
#define Module_Version 511
#define Module_MajorVersion "5.12"
#define Module_Version 512
#define Module_MinorVersion ""
#define Module_Date "19 Mar 2011"
#define Module_Date "31 Mar 2011"
#define Module_ApplicationDate "19-Mar-11"
#define Module_ApplicationDate "31-Mar-11"
#define Module_ComponentName "BuildSys"
#define Module_ComponentPath "castle/RiscOS/BuildSys"
#define Module_FullVersion "5.11"
#define Module_HelpVersion "5.11 (19 Mar 2011)"
#define Module_LibraryVersionInfo "5:11"
#define Module_FullVersion "5.12"
#define Module_HelpVersion "5.12 (31 Mar 2011)"
#define Module_LibraryVersionInfo "5:12"
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