Commit 7dca5691 authored by Ben Avison's avatar Ben Avison Committed by ROOL
Browse files

Change detail of `C_EXP_HDR` for CModule clients

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'
parent 6dc5260c
......@@ -43,7 +43,7 @@ INCLUDED_CMODULE = YES
# AIF_TARGET (opt) (GPA-intermediate leafname - otherwise ${TARGET} in aif)
# GPA_TARGET (opt) (GPA debug leafname - otherwise ${TARGET} in gpa)
# INSTDIR (opt) (the target directory - otherwise <Install$Dir>)
# C_EXP_HDR (opt) (C header target directory - otherwise <cexport$dir>.Interface.h)
# C_EXP_HDR (opt) (C header target directory - otherwise <cexport$dir>.Interface)
# EXP_HDR (opt) (assembly header target directory - otherwise <export$dir>
# DIRS (opt) (stamp object for directory creation - otherwise o._dirs)
# HDRS (opt) (C header files to export, no h. prefix - otherwise ${TARGET})
......@@ -158,7 +158,7 @@ DBG_TARGET ?= ${TARGET}D
AIF_TARGET ?= ${TARGET}
GPA_TARGET ?= ${TARGET}
INSTDIR ?= ${INSTALLDIR}
C_EXP_HDR ?= ${CEXPDIR}.Interface.h
C_EXP_HDR ?= ${CEXPDIR}.Interface
EXP_HDR ?= ${EXPDIR}
DIRS ?= o._dirs
HDRS ?= ${TARGET}
......@@ -256,7 +256,7 @@ expasm.${ASM2TXT_BASE}: hdr.${ASM2TXT_BASE}
endif
ifneq ($(findstring ${ASM2TXT_BASE},${HDRS}),)
exphdr.${ASM2TXT_BASE}: h.${ASM2TXT_BASE}
${CP} h.${ASM2TXT_BASE} ${C_EXP_HDR}.${ASM2TXT_BASE} ${CPFLAGS}
${CP} h.${ASM2TXT_BASE} ${C_EXP_HDR:.h=}.h.${ASM2TXT_BASE} ${CPFLAGS}
endif
${ASM2TXT_SUBDIR}${ASM2TXT_EXT}${ASM2TXT_BASE}: o.${ASM2TXT_BASE} ${DIRS}
${LD} -bin -o $@ o.${ASM2TXT_BASE}
......@@ -321,7 +321,7 @@ export_: export_libs export_hdrs
@${NOP}
create_exp_hdr_dirs:
${MKDIR} ${C_EXP_HDR}
${MKDIR} ${C_EXP_HDR:.h=}.h
${MKDIR} ${EXP_HDR}
ifneq (${CMHGFILE},)
......@@ -331,13 +331,13 @@ endif
ifneq ($(findstring ${CMHGAUTOHDR},${HDRS}),)
exphdr.${CMHGAUTOHDR}: h.${CMHGAUTOHDR} o._h_${CMHGAUTOHDR}
${FAPPEND} ${C_EXP_HDR}.${CMHGAUTOHDR} h.${CMHGAUTOHDR} o._h_${CMHGAUTOHDR}
${FAPPEND} ${C_EXP_HDR:.h=}.h.${CMHGAUTOHDR} h.${CMHGAUTOHDR} o._h_${CMHGAUTOHDR}
endif
ifneq ($(findstring ${CMHGAUTOHDR},${ASMCHDRS}),)
expasmc.${CMHGAUTOHDR}: hdr.${CMHGAUTOHDR} o._h_${CMHGAUTOHDR}
${HDR2H} hdr.${CMHGAUTOHDR} ${C_EXP_HDR}.${CMHGAUTOHDR}
${FAPPEND} ${C_EXP_HDR}.${CMHGAUTOHDR} ${C_EXP_HDR}.${CMHGAUTOHDR} o._h_${CMHGAUTOHDR}
${HDR2H} hdr.${CMHGAUTOHDR} ${C_EXP_HDR:.h=}.h.${CMHGAUTOHDR}
${FAPPEND} ${C_EXP_HDR:.h=}.h.${CMHGAUTOHDR} ${C_EXP_HDR:.h=}.h.${CMHGAUTOHDR} o._h_${CMHGAUTOHDR}
endif
ifneq (${CMHGDEPENDS},)
......@@ -362,9 +362,9 @@ o.modulewrap od.modulewrap: s.modulewrap
endif
.SUFFIXES: .exphdr .expasm .expasmc .h .hdr
.h.exphdr:; @${ECHO} ${CP} $< ${C_EXP_HDR}.$(subst h.,,$<) ${CPFLAGS} ; ${CP} $< ${C_EXP_HDR}.$(subst h.,,$<) ${CPFLAGS}
.h.exphdr:; @${ECHO} ${CP} $< ${C_EXP_HDR:.h=}.$< ${CPFLAGS} ; ${CP} $< ${C_EXP_HDR:.h=}.$< ${CPFLAGS}
.hdr.expasm:; @${ECHO} ${CP} $< ${EXP_HDR}.$(subst hdr.,,$<) ${CPFLAGS} ; ${CP} $< ${EXP_HDR}.$(subst hdr.,,$<) ${CPFLAGS}
.hdr.expasmc:; @${ECHO} ${HDR2H} $< ${C_EXP_HDR}.$(subst hdr.,,$<) ; ${HDR2H} $< ${C_EXP_HDR}.$(subst hdr.,,$<)
.hdr.expasmc:; @${ECHO} ${HDR2H} $< ${C_EXP_HDR:.h=}.$(subst hdr.,h.,$<) ; ${HDR2H} $< ${C_EXP_HDR:.h=}.$(subst hdr.,h.,$<)
export_hdrs${CUSTOMEXP}: ${EXPORTING_ASMCHDRS} ${EXPORTING_ASMHDRS} ${EXPORTING_HDRS} ${DIRS} create_exp_hdr_dirs
@${ECHO} ${COMPONENT}: header export complete
......
/* (7.59)
/* (7.60)
*
* This file is automatically maintained by srccommit, do not edit manually.
*
*/
#define Module_MajorVersion_CMHG 7.59
#define Module_MajorVersion_CMHG 7.60
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 12 Jun 2021
#define Module_Date_CMHG 23 Jun 2021
#define Module_MajorVersion "7.59"
#define Module_Version 759
#define Module_MajorVersion "7.60"
#define Module_Version 760
#define Module_MinorVersion ""
#define Module_Date "12 Jun 2021"
#define Module_Date "23 Jun 2021"
#define Module_ApplicationDate "12-Jun-21"
#define Module_ApplicationDate "23-Jun-21"
#define Module_ComponentName "BuildSys"
#define Module_FullVersion "7.59"
#define Module_HelpVersion "7.59 (12 Jun 2021)"
#define Module_LibraryVersionInfo "7:59"
#define Module_FullVersion "7.60"
#define Module_HelpVersion "7.60 (23 Jun 2021)"
#define Module_LibraryVersionInfo "7:60"
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