• Ben Avison's avatar
    Improvements to shared makefiles · 684d01e3
    Ben Avison authored
    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 consistency with CApp/CLibrary/CModule than
        anything to do with the 'C' language, since all of these makefiles work
        equally well for assembler and 'C' - the 'C' is for historic reasons.
      * Tweaked the debug rules in CApp to avoid harmless but annoying linker
        warnings about stubs being included twice.
      * Added several new default switches to ASFLAGS. These enable us to start
        making assembler source files work under a cross-assembler, because
        statements like
            GET  Hdr:Macros
            GET  Hdr:Machine.<Machine>
        are not portable, and tweaking the cross-assembler to understand these
        types of constructs would not be pretty. Instead, with the extra
        command line switches now introduced, you can use
            GET  Macros
            GET  Machine/$Machine
    Admin:
      Tested in a ROM build
    
    Version 5.12. Tagged as 'BuildSys-5_12'
    684d01e3
StdRules 1.24 KB
# Copyright 2008 Castle Technology Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Makefile fragment for defining standard rules for various tools

INCLUDED_STDRULES = YES

#
# $Id$
#
#

.SUFFIXES: .o .oz .s .c .h .c++ .cpp

# C source files -> object files
.c.o:;          ${CC} ${CFLAGS} -o $@ $<
.c.oz:;         ${CC} ${CFLAGS} ${C_MODULE} -o $@ $<

# C++ source files -> object files
.c++.o:;        ${C++} ${C++FLAGS} -o $@ $<
.cpp.o:;        ${C++} ${C++FLAGS} -o $@ $<
.c++.oz:;       ${C++} ${C++FLAGS} ${C_MODULE} -o $@ $<
.cpp.oz:;       ${C++} ${C++FLAGS} ${C_MODULE} -o $@ $<

# Assembler source files -> object files
.s.o:;          ${AS} ${ASFLAGS} -o $@ $<
.s.oz:;         ${AS} ${ASFLAGS} -pd "zM SETL {TRUE}" -o $@ $<


EOFSTDMAKEFILE=$Id$
# EOF