1. 09 Oct, 2021 3 commits
    • Robert Sprowson's avatar
      Use same names for CExport$Dir and Export$Dir as GNUmakefiles · 89a54862
      Robert Sprowson authored
      The CEXPDIR and EXPDIR names are the wild so hang around as aliases until those components are visited.
      Purely for symmetry add the same to AAsmModule.
      
      Version 7.64. Tagged as 'BuildSys-7_64'
      89a54862
    • Robert Sprowson's avatar
      Retire old OSINC alias · b8f39d1a
      Robert Sprowson authored
      b8f39d1a
    • Robert Sprowson's avatar
      Simplify debug and CUSTOMSA use · d6ee8ba0
      Robert Sprowson authored
      AppLibs/ModuleLibs:
      DebugLib requires remotedb to link, and both are present, but remotedb requires InetLib and SockLib. Currently client makefiles must specify this, but can't do via DBG_LIBS because of the ordering, so end up having to mess around with LIBS in a conditional.
      Simplify this by providing the libraries in DEBUGLIBS.
      
      CModule:
      Add a new SA_TARGET_RULE variable so that when CUSTOMSA is in use it is still possible to invoke the standalone build without needing to know about the differences between GNU and native makefiles (one uses 'MyModule,ffa' the other 'rm.MyModule').
      This will allow the 5 uses of CModule to be simplified in future, the 5 uses of AAsmModule for CUSTOMSA are just to stop a module being output.
      d6ee8ba0
  2. 18 Sep, 2021 1 commit
    • Robert Sprowson's avatar
      Allow clients of CLibrary to use LibIncludes variables · f33c9046
      Robert Sprowson authored
      The comment in LibIncludes mentions libraries that depend on other libraries may find those path variables useful, but since CLibrary doesn't itself include ModuleLibs or AppLibs, they expand as empty. Add LibIncludes.
      
      Version 7.63. Tagged as 'BuildSys-7_63'
      f33c9046
  3. 04 Sep, 2021 1 commit
  4. 26 Jun, 2021 1 commit
  5. 23 Jun, 2021 1 commit
    • Ben Avison's avatar
      Change detail of `C_EXP_HDR` for CModule clients · 7dca5691
      Ben Avison authored
      This macro is used to define the root directory for exported C header files.
      Previously, when native-compiling, the default setting, if not otherwise
      overridden by the master makefile, was `<cexport$dir>.Interface.h`. This is
      at odds with the cross-compiling case, which defaults to the equivalent
      string, but without the `h` subdirectory, for obvious reasons.
      
      Only one component, DHCP, currently overrides `C_EXP_HDR`, although more will
      be joining it in the near future. The macro is used internally within rules
      defined by `CModule`, but a few components also use it within rules in their
      master makefiles.
      
      We hereby change the default value to omit the `h` subdirectory, and permit
      master makefiles to specify an override value which also omits it (in future
      it wil be deprecated to include it, and its use will be phased out). There
      are two reasons for this:
      
      1) It assists with cross-compilation, since the override can then be
         expressed identically for both native and cross builds.
      
      2) It permits the `.exphdr.h` suffix rule to be re-used when one or more
         headers need to be exported to a subdirectory of `C_EXP_HDR`, so long as
         the headers are present at an equivalent subdirectory in the component
         source tree, and that subdirectory is on `VPATH`. This is because `$<`
         is set up to include the element of `VPATH` that matched the rule - but
         this needs to go before the `.h`, not after it.
      
      To prepare for this MR, the following must all be merged:
      * RiscOS/Sources/FileSys/ADFS/ADFS4!2
      * RiscOS/Sources/HWSupport/ATA/SATADriver!2
      * RiscOS/Sources/HWSupport/SD/SDIODriver!5
      * RiscOS/Sources/HWSupport/SPIDriver!1
      * RiscOS/Sources/HWSupport/USB/USBDriver!9
      
      Version 7.60. Tagged as 'BuildSys-7_60'
      7dca5691
  6. 12 Jun, 2021 5 commits
    • Ben Avison's avatar
      Introduce new shared makefile fragments for BASIC components · 6dc5260c
      Ben Avison authored
      The `BasicApp` fragment is analogous to the `CApp` fragment in that it
      supports both single-file executables and application directories. Rules are
      included for building any such application directories into ROMs, with
      files destined for `Resources:$.Resources` being exported to the Messages
      module during the `resources` phase, and those destinated for
      `Resources:$.Apps` being built into a position-independent module, so that
      when the module is killed or unplugged, those files disappear from ResourceFS.
      
      Because the module is position-independent, the makefile fragment implements
      the `install_rom` rule rather than the `rom_link` rule used by `CApp`. This
      is consistent with how `srcbuild` already installs ROM components listed in
      the ModuleDB as being of type `BAS`.
      
      The other main difference from `CApp` is that there is no compilation or
      linking step. Tokenisation, crunching and squishing of the (untokenised)
      source files are roughly analogous t...
      6dc5260c
    • Ben Avison's avatar
      7bfa5c9f
    • Ben Avison's avatar
      Fix typo · 4e012049
      Ben Avison authored
      Missing `$` character before `{LOCALE}` would have caused UK resources to
      be selected instead of non-UK ones, if anyone were to be doing an
      internationalised cross-compiled build.
      4e012049
    • Ben Avison's avatar
      Define SUFFIX_DATA · c63824df
      Ben Avison authored
      This allows RISC OS abstract data files with filetype ffd to be referenced
      identically whether native or cross-compiling (it expands to an empty string
      when used natively).
      c63824df
    • Ben Avison's avatar
      327b245f
  7. 15 May, 2021 24 commits
    • Ben Avison's avatar
      Support links for extension-less files in subdirectories · 9b0aed8c
      Ben Avison authored
      This only applies to cross-compilation builds. The `make links` rules don't
      know a pre-determined list of subdirectories that need to be converted into
      filename extensions. Instead, files that should have no filename extension
      are usually simply identified by the absence of a `/` in their specification
      in `SOURCES_TO_SYMLINK`. However, this is insufficient to handle some rarer
      cases, such as a `Makefile` within a `Test` subdirectory.
      
      To handle this, we introduce explicit support for specifying such files in
      `SOURCES_TO_SYMLINK`, using a double slash where there would otherwise be a
      filetype subdirectory name, such as `Test//Makefile`. (Conveniently, this is
      also valid Posix filename syntax anyway.) The way this is achieved is to
      tweak the regular expressions to require the directory and leafnames between
      slashes to be at least one character long.
      
      Version 7.58. Tagged as 'BuildSys-7_58'
      9b0aed8c
    • Ben Avison's avatar
      Define `export` rule for `CApp` shared makefile · 7118b699
      Ben Avison authored
      With GNU `make` unlike with `amu`, it is considered an error to make a target
      for which no rule is defined. Therefore we need an explicit no-op `export`
      rule in the cross-compiling `CApp` makefile.
      7118b699
    • Ben Avison's avatar
      Always implicitly include StdTools when cross-compiling · b1e26d51
      Ben Avison authored
      `AAsmModule`, `CApp`, `CLibrary` and `CModule` implicitly include various
      other shared makefile fragments to permit simpler master makefiles. However,
      when cross-compiling, they were only included when invoked from within the
      `objs` subdirectory, which in particular meant you couldn't rely on any of
      the definitions from `StdTools` when extending the `clean` rule unless you
      explicitly included it from the master makefile, thereby defeating the
      purpose of the implicit inclusion. Change them so that `StdTools` is included
      for all rules.
      b1e26d51
    • Ben Avison's avatar
      Pass `-tgcc` to `cmunge` · f3add28d
      Ben Avison authored
      This tells it to use gcc for preprocessing the CMHG file (if enabled) and
      asasm for the backend (which means the object file is an ELF file, required
      in order to link with GCC objects).
      f3add28d
    • Ben Avison's avatar
      Allow cross-compile C++FLAGS to be inherited from environment · b2eb8ff6
      Ben Avison authored
      Occasionally, it is useful to be able to set C++FLAGS from the calling
      environment, for example when building a 32-bit x86 target from a 64-bit
      x86-64 host. This works fine for CFLAGS and LDFLAGS, but C++FLAGS is not a
      valid Posix environment variable name. Import setting from CXXFLAGS instead
      when cross-compiling.
      b2eb8ff6
    • Ben Avison's avatar
      Correct capitalisation of AsmUtilszm library · 7733fdc5
      Ben Avison authored
      7733fdc5
    • Ben Avison's avatar
    • Ben Avison's avatar
      Tweak definition of `${MAKE}` when cross-compiling · 64010501
      Ben Avison authored
      When executing the makefile from within the `objs` directory, this now
      includes an implicit `-C..` option. This makes it simpler to write agnostic
      makefiles. For example,
      
      	${MAKE} -f other${EXT}mk other_target
      
      rather than
      
      ifeq (,${MAKE_VERSION})
      	${MAKE} -f other/mk other_target
      else
      	${MAKE} -f ../other.mk other_target
      endif
      64010501
    • Ben Avison's avatar
      Compatibility fix for amu < 5.32 · b0848633
      Ben Avison authored
      Earlier versions couldn't cope with RES_OBJ being set to an empty string.
      b0848633
    • Timothy E Baldwin's avatar
      Define PARENT · 4f35a3e7
      Timothy E Baldwin authored
      This allows makefiles to refer to the parent directory in an OS-neutral way.
      4f35a3e7
    • Ben Avison's avatar
      Add tokenised help file functionality to `CModule` · ee10b29f
      Ben Avison authored
      `TOKHELPSRC`, `HELPSRC` and `TOKENS` have the same meaning as in `AAsmModule`.
      Because `CModule`, unlike `AAsmModule`, can build a binary from multiple
      linked object files, it is also necessary to specify which object file(s)
      depend on the autogenerated source file. This is achieved with the new input
      variable `TOKHELPDEPENDS`. This defaults to `OBJS` which in turn defaults to
      `TARGET`, which should mean that any components converted from `AAsmModule`
      will not require any such line to be specified in their master makefile.
      
      Requires RiscOS/Sources/Programmer/Debugger!4
      ee10b29f
    • Ben Avison's avatar
    • Ben Avison's avatar
      Define SUFFIX_PERL · bf28bf7a
      Ben Avison authored
      This allows Perl files with filetype 102 to be referenced identically whether
      native or cross-compiling (it expands to an empty string when used natively).
      bf28bf7a
    • Ben Avison's avatar
      Permit makefiles using CLibrary to cross-compile `export` target · 6ffb78b8
      Ben Avison authored
      This brings it into line with AAsmModule and CModule shared makefiles
      6ffb78b8
    • Ben Avison's avatar
      Define Tokenise tool for cross-compilation · 3e39f8da
      Ben Avison authored
      There are at least 19 components that use this tool to autogenerate a source
      file. Needs initial capitalisation on case-sensitive filesystems.
      3e39f8da
    • Ben Avison's avatar
      614326fc
    • Ben Avison's avatar
    • Ben Avison's avatar
    • Ben Avison's avatar
      Define cross-platform specifier for -Itbox: · 1e58a98d
      Ben Avison authored
      Use `${TBOXINC}` instead.
      1e58a98d
    • Ben Avison's avatar
      Define cross-platform specifier for -ITCPIPLibs: · def85aec
      Ben Avison authored
      Use `${TCPIPINC}` instead. Although there is only a single directory
      on TCPIPLibs$Path, all ported BSD sockets code assumes their headers are
      already directly on the include path.
      def85aec
    • Ben Avison's avatar
      Support application and module targets with differing compiler flags · a7947759
      Ben Avison authored
      Typically useful for libraries where you have both types of target, and you
      want the application build to contain function names (for meaningful
      backtraces) but the module build not to (to save ROM space). This is
      achieved as follows:
      
      * CAPPFLAGS and CMODFLAGS contain additional flags to be passed to application
        and module builds, respectively
      
      * C_FNAMES is initialised to a compiler-agnostic build switch to enable
        function names in the binary
      
      Therefore a master makefile will often use the line
      CAPPFLAGS = ${C_FNAMES}
      although CAPPFLAGS and CMODFLAGS are not limited to this usage.
      a7947759
    • Ben Avison's avatar
      Allow components using CLibrary shared Makefile to specify additional exports · 51f761a1
      Ben Avison authored
      Occasionally, a library needs to export additional files that don't live in
      either an h or hdr directory and (when cross compiling) shouldn't have a
      .h suffix added to their exported version. A typical example would be where
      the licence conditions of the library require a licence header to be attached
      to all copies. To achieve this, CLibrary now uses EXPORTS in a similar manner
      to how AAsmModule does, simply as a dependency of export_hdrs, which can
      expand to any additional targets you need to define. By default, it overrides
      the internal targets EXPORTING_HDRS and EXPORTING_ASMHDRS (derived from
      HDRS and ASMHDRS supplied by the master makefile), but you can always include
      them in your definition of EXPORTS if desired.
      51f761a1
    • Ben Avison's avatar
      Split library include paths into separate included Makefile · bc6cf22d
      Ben Avison authored
      This de-duplicates some of the information from AppLibs and ModuleLibs,
      which now include the new Makefile fragment in order to ensure compatibility.
      It also means that the definitions can be used for building other library
      components, which by definition do not perform a link step, without having
      to choose either AppLibs or ModuleLibs when most of either one is unused for
      a library build.
      bc6cf22d
    • Ben Avison's avatar
  8. 19 Apr, 2021 4 commits