AAsmModule 16.7 KB
Newer Older
1 2 3 4 5 6 7 8 9 10
# Makefile fragment for assembler modules, previously built using AAsm but now using objasm
# Such modules are characterised by the use of position-independent code
# and multiple source files (if applicable) linked at the assembly stage
# (using LNK and GET directives) rather than at the link stage.

INCLUDED_AASMMODULE = YES

#
# This makefile provides the following phony targets:
#
11
#    all     rom           install_rom   rom_link           resources
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
#    export  export_libs   export_hdrs   standalone         install
#    clean   debug         gpa_debug
#
#
# This fragment uses the following macros set by the master makefile.
#
#
# COMPONENT             (the name of the component)
# TARGET          (opt) (the leafname of the module - otherwise ${COMPONENT})
# ROM_MODULE      (opt) (output filename - otherwise ${TARGET})
# ROM_OBJECT      (opt) (object file for romming - otherwise ${TARGET}.o)
# ROM_LIBS        (opt) (libraries to link again ROM_OBJECT to generate ROM_MODULE)
# ROM_DEPEND      (opt) (any extra dependency to assert on ROM_MODULE)
# DBG_MODULE      (opt) (output filename for debug - otherwise ${TARGET}D
# DBG_OBJECT      (opt) (object file for debug - otherwise ${TARGET}D.o
# DBG_LIBS        (opt) (libraries to link against DBG_OBJECT to generate DBG_MODULE - otherwise ${ROM_LIBS})
# SA_MODULE       (opt) (output filename for softload - otherwise ${TARGET}SA
# SA_OBJECT       (opt) (object file for softload - otherwise ${TARGET}SA.o
# SA_LIBS         (opt) (libraries to link against SA_OBJECT to generate SA_MODULE - otherwise ${ROM_LIBS})
# SA_DEPEND       (opt) (any extra dependency to assert on SA_MODULE and DBG_MODULE)
# DIRS            (opt) (magic target to ensure object directories are present - otherwise _dirs)
# HEADER[1-3]     (opt) (leafname of file in hdr to copy to ${EXPORTDIR} on export_hdrs)
# ASMCHEADER[1-3] (opt) (C-from-assembly auto-generated header files to export, no Hdr. prefix - otherwise none)
# CHEADER[1-3]    (opt) (C header files to export - otherwise none)
# EXPORTS         (opt) (list of C and C-from-assembly headers to export)
# C_EXP_HDR       (opt) (C header target directory - otherwise ${CEXPORTDIR}/Interface)
# EXP_HDR         (opt) (directory for exported assembler interface headers)
39 40 41 42 43 44 45
# INSTRES_FILES   (opt) (extra resource files in addition to Messages - use InstRes specification rules)
# INSTRAM_FILES   (opt) (RAM build specific resources - otherwise ${INSTRES_FILES})
# INSTROM_FILES   (opt) (ROM build specific resources - otherwise ${INSTRES_FILES})
# INSTR??_DEPENDS (opt) (any extra dependency to assert on INSTRES/INSTRAM/INSTROM_FILES)
# INSTRES_VERSION (opt) (if set to "Messages", automatically insert version into Messages file during resources phase)
# MERGEDMSGS      (r/o) (leafname of generated Messages file)
# RESFSDIR        (opt) (actual directory to export resources to - otherwise ${RESDIR}/${TARGET})
46 47 48
# TOKHELPSRC      (opt) (set equal to ${TOKENSOURCE} to indicate that the binary depends on autogenerated tokenised help source file of that name)
# HELPSRC         (opt) (set to filename containing untokenised help messages if ${TOKHELPSRC} = ${TOKENSOURCE})
# TOKENS          (opt) (set to filename containing help message tokens - otherwise ${HDRDIR}/Global/Tokens)
49 50 51 52 53 54
# CUSTOMEXP       (opt) (set to "custom" to override the export rules)
# CUSTOMRES       (opt) (set to "custom" to override the resources rules, or "no" for no resources)
# CUSTOMROM       (opt) (set to "custom" to override the rom rules)
# CUSTOMSA        (opt) (set to "custom" to override the standalone rules)
# CUSTOMDBG       (opt) (set to "custom" to override the debug rules)
# CUSTOMGPA       (opt) (set to "custom" to override the GPA rules)
55
# SOURCES_TO_SYMLINK opt) (files which need be linked to by the link farm, in addition to contents of hdr and s directories)
56 57 58 59 60 61 62 63 64 65 66 67 68
#
#
# It relies on the following from the build system:
#
#
# INSTDIR          (installation directory for ROM_MODULE or disc install)
# INSTALLDIR       (if INSTDIR was not specified by the build system)
# RESDIR           (installation directory for resources - cf. RESFSDIR)
# EXPORTDIR        (export directory for assembler interface headers)
# CEXPORTDIR       (export directory for C interface headers)
# HDRDIR           (top-level export directory for assembler headers)
# CMDHELP          (optional, set to None to exclude syntax errors from Messages)
# PHASE            (export phase discriminator)
69
# INSERTVERSION    (awk script to substitute from VersionNum)
70 71 72 73 74 75 76 77 78 79 80 81 82 83 84
#
#
# It relies on the following generic tool macros from the Tools makefile
#
# CP + CPFLAGS     (copy, cp etc.)
# AS + ASFLAGS     (assembler)
# MKDIR            (cdir/mkdir -p)
# RM + WIPE        (deletions)
# ECHO
# LD               (linker)
#
#

TARGET     ?= ${COMPONENT}
INSTDIR    ?= ${INSTALLDIR}
85
ROM_MODULE ?= ${TARGET}${SUFFIX_MODULE}
86 87 88 89 90 91
ROM_SOURCE ?= ${TARGET}.s
ROM_OBJECT ?= ${TARGET}.o
DIRS       ?= _dirs
EXP_HDR    ?= ${EXPORTDIR}
C_EXP_HDR  ?= ${CEXPORTDIR}/Interface

92
SA_MODULE  ?= ${TARGET}SA${SUFFIX_MODULE}
93
SA_OBJECT  ?= ${TARGET}SA.o
94 95 96 97 98 99 100 101
INSTRAM_FILES   ?= ${INSTRES_FILES}
INSTRAM_DEPENDS ?= ${INSTRES_DEPENDS}
INSTROM_FILES   ?= ${INSTRES_FILES}
INSTROM_DEPENDS ?= ${INSTRES_DEPENDS}
MERGEDRDIR ?= _ResData_
MERGEDMSGS ?= ${MERGEDRDIR}/${TARGET}/Messages
RESFSDIR   ?= ${RESDIR}/${TARGET}
RESAPPDIR  ?= ${RESDIR}/../Apps/${APP}
102 103 104 105 106 107 108
ifeq (${CMDHELP},None)
SA_FLAGS   ?= -PD "standalone SETL {TRUE}" -PD "MergedMsgs SETS \"${MERGEDMSGS}\"" -PD "international_help SETL {FALSE}"
else
SA_FLAGS   ?= -PD "standalone SETL {TRUE}" -PD "MergedMsgs SETS \"${MERGEDMSGS}\""
endif
SA_LIBS    ?= ${ROM_LIBS}

109
DBG_MODULE ?= ${TARGET}D${SUFFIX_MODULE}
110 111 112 113 114 115 116 117 118 119
DBG_OBJECT ?= ${TARGET}D.o
DBG_LIBS   ?= ${ROM_LIBS}

#GPA_FILE   ?= ${TARGET}.gpa
#GPA_AIF    ?= ${TARGET}.aif

TOKENS     ?= ${HDRDIR}/Global/Tokens

TOKENSOURCE ?= TokHelpSrc.s

120 121 122 123 124 125 126 127
ifeq ($(filter rom%,${MAKECMDGOALS}),)
RES_FILES_    = ${INSTRAM_FILES}
RES_DEPENDS_  = ${INSTRAM_DEPENDS}
else
RES_FILES_    = ${INSTROM_FILES}
RES_DEPENDS_  = ${INSTROM_DEPENDS}
endif

128 129
SOURCES_TO_SYMLINK += $(wildcard h/*) $(wildcard hdr/*) $(wildcard s/*) Resources VersionNum VersionASM

130 131 132 133
ifeq ("${INCLUDED_STDTOOLS}","")
include StdTools
endif

134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152
ifneq (objs,$(notdir ${CURDIR}))

# Makefile invoked from same directory
# Create link farm, then execute the makefile from within it

ifeq (clean,${MAKECMDGOALS})
# With a double-colon rule which can have additional actions assigned from the
# master makefile, we'd normally need the master makefile to include the
# ${CURDIR} check to ensure that it's performed on the same invocation as us.
# However, there's no real benefit to performing clean from within the objs
# directory, and it adds an ordering problem between the different double-colon
# rules (the one that deletes the objs directory has to be last otherwise the
# cwd is invalid for the others) so to simplify things, we only ever do cleans
# from the same directory as the Makefile.
clean::
	@echo Cleaning...
	@rm -rf objs
	@echo ${COMPONENT}: cleaned
else
153
ifneq (,${SYMLINK_EXT_FIRST})
154
SYMLINK_SED_PATTERN = 's,^\([^/]\+\)/\(.\+\),\2.\1,'
155
else
156
SYMLINK_SED_PATTERN = 's,\([^/]\+\)/\([^/]\+\)$$,\2.\1,'
157
endif
158
all debug export export_hdrs export_libs gpa_debug install install_rom rom_link links resources rom standalone: ${SYMLINK_DEPEND}
159 160
	$(foreach linksource,${SOURCES_TO_SYMLINK}, \
		$(shell \
161
			linkdest=`echo ${linksource} | sed -e ${SYMLINK_SED_PATTERN} -e 's,^,objs/,'`; \
162 163
			linkdestdir=`echo $$linkdest | sed -e 's,/[^/]\+$$,,'`; \
			linkbackpath=`echo $$linkdestdir | sed -e 's,[^/]\+,..,g'`; \
164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180
			[ -d ${linksource} ] || [ -L $$linkdest ] || mkdir -p $$linkdestdir; \
			[ -d ${linksource} ] || [ -L $$linkdest ] || ln -s $$linkbackpath/${linksource} $$linkdest; \
		 ) \
	)
	@[ -L objs/Resources ] || ln -s ../Resources objs/Resources
	@mkdir -p objs
ifneq (links,${MAKECMDGOALS})
	@${MAKE} -C objs -f ../$(firstword ${MAKEFILE_LIST}) ${MAKECMDGOALS}
endif
endif

else

# Makefile invoked from objs subdirectory

all: rom debug standalone

181 182 183 184 185 186
# GNU make seems to treat any double-colon rule with no dependencies as
# always out-of-date, therefore always rebuilds it and anything which in turn
# depends on the target of the double-colon rule. So use a single-colon rule
# instead. If any cross builds need to create extra directories on a
# per-component basis, we'll cross that bridge when we get to it.
${DIRS}:
187 188 189 190 191 192 193 194 195 196 197 198 199
	${TOUCH} $@

#
# ROM build rules
#
rom${CUSTOMROM}: ${ROM_MODULE}
	@${ECHO} ${COMPONENT}: rom module built

install_rom${CUSTOMROM}: ${ROM_MODULE}
	${CP} ${ROM_MODULE} ${INSTDIR}/${TARGET} ${CPFLAGS}
	#${CP} ${ROM_MODULE}_gpa ${INSTDIR}/${TARGET}_gpa ${CPFLAGS}
	@${ECHO} ${COMPONENT}: rom module installed

200 201 202 203 204 205 206 207
rom_link${CUSTOMROM}: ${ROM_MODULE}
ifeq (GNU,${TOOLCHAIN})
	${CP} ${ROM_MODULE} ${LINKDIR}/${TARGET} ${CPFLAGS}
else
	${LD} -rmf -o ${LINKDIR}/${TARGET} ${ROM_OBJECT} ${ROM_LIBS} -Symbols ${LINKDIR}/${TARGET}_sym -base ${ADDRESS}
endif
	@${ECHO} ${COMPONENT}: rom_link complete

208
${ROM_MODULE}: ${ROM_DEPEND} ${DIRS} ${ROM_LIBS} ${ROM_OBJECT}
209 210 211
ifeq (GNU,${TOOLCHAIN})
	${LDBIN} $@ ${ROM_OBJECT} ${ROM_LIBS}
else
212 213 214
	${LD} -rmf -o $@ ${ROM_OBJECT} ${ROM_LIBS}
	#${LD} -aif -bin -d -Entry 0 -o ${ROM_MODULE}_aif ${ROM_OBJECT} ${ROM_LIBS}
	#${TOGPA} -s ${ROM_MODULE}_aif ${ROM_MODULE}_gpa
215
endif
216 217 218 219 220 221 222 223 224 225 226

${ROM_OBJECT}: ${DIRS} ${TOKHELPSRC} ${ROM_SOURCE}
	${AS} ${ASFLAGS} -depend $(subst .o,.d,$@) -g -o $@ ${ROM_SOURCE}

#
# Standalone builds
#
standalone${CUSTOMSA}: ${SA_MODULE}
	@${ECHO} ${COMPONENT}: standalone module built

${SA_MODULE}: ${SA_DEPEND} ${DIRS} ${SA_LIBS} ${SA_OBJECT}
227 228 229
ifeq (GNU,${TOOLCHAIN})
	${LDBIN} $@ ${SA_OBJECT} ${SA_LIBS}
else
230
	${LD} -rmf -o $@ ${SA_OBJECT} ${SA_LIBS}
231
endif
232 233 234 235 236
	${MODSQZ} -f ${MODSQZFLAGS} $@

${SA_OBJECT}: ${DIRS} ${TOKHELPSRC} ${MERGEDMSGS} ${ROM_SOURCE}
	${AS} ${ASFLAGS} -depend $(subst .o,.d,$@) -o $@ ${ROM_SOURCE} ${SA_FLAGS}

237 238 239
ifeq ($(filter no custom,${CUSTOMRES}),)
${MERGEDMSGS}:
	${MKDIR} ${MERGEDRDIR}/tmp
240 241 242
	${MKDIR} ${MERGEDRDIR}/${TARGET}
	${TOUCH} ${MERGEDRDIR}/tmp/Messages
	${TOUCH} ${MERGEDRDIR}/tmp/CmdHelp
243
	${INSTRES} -I Resources.${USERIF}.${LOCALE},Resources.${USERIF}.UK,Resources.${LOCALE},Resources.UK,Resources ${MERGEDRDIR}/tmp [Messages] [CmdHelp]
Ben Avison's avatar
Ben Avison committed
244
	${CAT} ${MERGEDRDIR}/tmp/Messages ${MERGEDRDIR}/tmp/CmdHelp > $@
245
	${WIPE} ${MERGEDRDIR}/tmp
246 247 248 249
else
${MERGEDMSGS}::
	@${NOP}
endif
250 251 252 253 254 255 256 257 258 259

install${CUSTOMSA}: ${SA_MODULE}
	${MKDIR} ${INSTDIR}
	${CP} ${SA_MODULE} ${INSTDIR}/${TARGET} ${CPFLAGS}
	@${ECHO} ${COMPONENT}: standalone module installed

debug${CUSTOMDBG}: ${DBG_MODULE}
	@${ECHO} ${COMPONENT}: standalone debug module built

${DBG_MODULE}: ${DBG_OBJECT} ${DBG_LIBS} ${DIRS} ${SA_DEPEND}
260 261 262
ifeq (GNU,${TOOLCHAIN})
	${LDBIN} $@ ${DBG_OBJECT} ${DBG_LIBS}
else
263
	${LD} -rmf -o $@ ${DBG_OBJECT} ${DBG_LIBS}
264
endif
265 266

${DBG_OBJECT}: ${ROM_SOURCE} ${MERGEDMSGS} ${TOKHELPSRC} ${DIRS}
267
	${AS} ${ASFLAGS} ${ASDFLAGS} -g -pd "debugging SETL {TRUE}" -depend $(subst .o,.d,$@) -o $@ ${ROM_SOURCE} ${SA_FLAGS}
268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288

#gpa_debug${CUSTOMGPA}: ${GPA_FILE}
#	@${ECHO} ${COMPONENT}: GPA debug listing generated
#
#${GPA_FILE}: ${GPA_AIF}
#	${TOGPA} -s ${GPA_AIF} ${GPA_FILE}
#
#${GPA_AIF}: ${DBG_OBJECT}
#	${LD} -aif -bin -d -o ${GPA_AIF} ${DBG_OBJECT}

#
# Export phases
#

export_hdrs: ${EXPORTS}
	@if [ -e ${HEADER1}.hdr ]; then ${ECHO} ${CP} ${HEADER1}.hdr ${EXP_HDR}/${HEADER1} ${CPFLAGS}; fi
	@if [ -e ${HEADER1}.hdr ]; then ${CP} ${HEADER1}.hdr ${EXP_HDR}/${HEADER1} ${CPFLAGS}; fi
	@if [ -e ${HEADER2}.hdr ]; then ${ECHO} ${CP} ${HEADER2}.hdr ${EXP_HDR}/${HEADER2} ${CPFLAGS}; fi
	@if [ -e ${HEADER2}.hdr ]; then ${CP} ${HEADER2}.hdr ${EXP_HDR}/${HEADER2} ${CPFLAGS}; fi
	@if [ -e ${HEADER3}.hdr ]; then ${ECHO} ${CP} ${HEADER3}.hdr ${EXP_HDR}/${HEADER3} ${CPFLAGS}; fi
	@if [ -e ${HEADER3}.hdr ]; then ${CP} ${HEADER3}.hdr ${EXP_HDR}/${HEADER3} ${CPFLAGS}; fi
289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314
	@if [ -e ${HEADER4}.hdr ]; then ${ECHO} ${CP} ${HEADER4}.hdr ${EXP_HDR}/${HEADER4} ${CPFLAGS}; fi
	@if [ -e ${HEADER4}.hdr ]; then ${CP} ${HEADER4}.hdr ${EXP_HDR}/${HEADER4} ${CPFLAGS}; fi
	@if [ -e ${HEADER5}.hdr ]; then ${ECHO} ${CP} ${HEADER5}.hdr ${EXP_HDR}/${HEADER5} ${CPFLAGS}; fi
	@if [ -e ${HEADER5}.hdr ]; then ${CP} ${HEADER5}.hdr ${EXP_HDR}/${HEADER5} ${CPFLAGS}; fi
	@if [ -e ${HEADER6}.hdr ]; then ${ECHO} ${CP} ${HEADER6}.hdr ${EXP_HDR}/${HEADER6} ${CPFLAGS}; fi
	@if [ -e ${HEADER6}.hdr ]; then ${CP} ${HEADER6}.hdr ${EXP_HDR}/${HEADER6} ${CPFLAGS}; fi
	@if [ -e ${HEADER7}.hdr ]; then ${ECHO} ${CP} ${HEADER7}.hdr ${EXP_HDR}/${HEADER7} ${CPFLAGS}; fi
	@if [ -e ${HEADER7}.hdr ]; then ${CP} ${HEADER7}.hdr ${EXP_HDR}/${HEADER7} ${CPFLAGS}; fi
	@if [ -e ${HEADER8}.hdr ]; then ${ECHO} ${CP} ${HEADER8}.hdr ${EXP_HDR}/${HEADER8} ${CPFLAGS}; fi
	@if [ -e ${HEADER8}.hdr ]; then ${CP} ${HEADER8}.hdr ${EXP_HDR}/${HEADER8} ${CPFLAGS}; fi
	@if [ -e ${HEADER9}.hdr ]; then ${ECHO} ${CP} ${HEADER9}.hdr ${EXP_HDR}/${HEADER9} ${CPFLAGS}; fi
	@if [ -e ${HEADER9}.hdr ]; then ${CP} ${HEADER9}.hdr ${EXP_HDR}/${HEADER9} ${CPFLAGS}; fi
	@if [ -e ${HEADER10}.hdr ]; then ${ECHO} ${CP} ${HEADER10}.hdr ${EXP_HDR}/${HEADER10} ${CPFLAGS}; fi
	@if [ -e ${HEADER10}.hdr ]; then ${CP} ${HEADER10}.hdr ${EXP_HDR}/${HEADER10} ${CPFLAGS}; fi
	@if [ -e ${HEADER11}.hdr ]; then ${ECHO} ${CP} ${HEADER11}.hdr ${EXP_HDR}/${HEADER11} ${CPFLAGS}; fi
	@if [ -e ${HEADER11}.hdr ]; then ${CP} ${HEADER11}.hdr ${EXP_HDR}/${HEADER11} ${CPFLAGS}; fi
	@if [ -e ${HEADER12}.hdr ]; then ${ECHO} ${CP} ${HEADER12}.hdr ${EXP_HDR}/${HEADER12} ${CPFLAGS}; fi
	@if [ -e ${HEADER12}.hdr ]; then ${CP} ${HEADER12}.hdr ${EXP_HDR}/${HEADER12} ${CPFLAGS}; fi
	@if [ -e ${HEADER13}.hdr ]; then ${ECHO} ${CP} ${HEADER13}.hdr ${EXP_HDR}/${HEADER13} ${CPFLAGS}; fi
	@if [ -e ${HEADER13}.hdr ]; then ${CP} ${HEADER13}.hdr ${EXP_HDR}/${HEADER13} ${CPFLAGS}; fi
	@if [ -e ${HEADER14}.hdr ]; then ${ECHO} ${CP} ${HEADER14}.hdr ${EXP_HDR}/${HEADER14} ${CPFLAGS}; fi
	@if [ -e ${HEADER14}.hdr ]; then ${CP} ${HEADER14}.hdr ${EXP_HDR}/${HEADER14} ${CPFLAGS}; fi
	@if [ -e ${HEADER15}.hdr ]; then ${ECHO} ${CP} ${HEADER15}.hdr ${EXP_HDR}/${HEADER15} ${CPFLAGS}; fi
	@if [ -e ${HEADER15}.hdr ]; then ${CP} ${HEADER15}.hdr ${EXP_HDR}/${HEADER15} ${CPFLAGS}; fi
	@if [ -e ${HEADER16}.hdr ]; then ${ECHO} ${CP} ${HEADER16}.hdr ${EXP_HDR}/${HEADER16} ${CPFLAGS}; fi
	@if [ -e ${HEADER16}.hdr ]; then ${CP} ${HEADER16}.hdr ${EXP_HDR}/${HEADER16} ${CPFLAGS}; fi
315 316 317 318 319 320
	@${ECHO} ${COMPONENT}: header export complete

export_libs:
	@${ECHO} ${COMPONENT}: library export complete

export${CUSTOMEXP}: export_${PHASE}
321
	@${NOP}
322 323

export_:: export_hdrs export_libs
324
	@${NOP}
325 326 327 328 329

# Need these to stop complaints about the rules below
ASMCHEADER1 ?= _!_x_!_
ASMCHEADER2 ?= _!_x_!_
ASMCHEADER3 ?= _!_x_!_
330 331 332 333 334
ASMCHEADER4 ?= _!_x_!_
ASMCHEADER5 ?= _!_x_!_
ASMCHEADER6 ?= _!_x_!_
ASMCHEADER7 ?= _!_x_!_
ASMCHEADER8 ?= _!_x_!_
335 336 337 338
CHEADER1    ?= _!_x_!_
CHEADER2    ?= _!_x_!_
CHEADER3    ?= _!_x_!_

339
${C_EXP_HDR}/${ASMCHEADER1}.h :: ${ASMCHEADER1}.hdr
340 341
	${HDR2H} ${ASMCHEADER1}.hdr $@

342
${C_EXP_HDR}/${ASMCHEADER2}.h :: ${ASMCHEADER2}.hdr
343 344
	${HDR2H} ${ASMCHEADER2}.hdr $@

345
${C_EXP_HDR}/${ASMCHEADER3}.h :: ${ASMCHEADER3}.hdr
346 347
	${HDR2H} ${ASMCHEADER3}.hdr $@

348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363
${C_EXP_HDR}/${ASMCHEADER4}.h :: ${ASMCHEADER4}.hdr
	${HDR2H} ${ASMCHEADER4}.hdr $@

${C_EXP_HDR}/${ASMCHEADER5}.h :: ${ASMCHEADER5}.hdr
	${HDR2H} ${ASMCHEADER5}.hdr $@

${C_EXP_HDR}/${ASMCHEADER6}.h :: ${ASMCHEADER6}.hdr
	${HDR2H} ${ASMCHEADER6}.hdr $@

${C_EXP_HDR}/${ASMCHEADER7}.h :: ${ASMCHEADER7}.hdr
	${HDR2H} ${ASMCHEADER7}.hdr $@

${C_EXP_HDR}/${ASMCHEADER8}.h :: ${ASMCHEADER8}.hdr
	${HDR2H} ${ASMCHEADER8}.hdr $@

${C_EXP_HDR}/${CHEADER1}.h :: ${CHEADER1}.h
364 365
	${CP} ${CHEADER1}.h $@ ${CPFLAGS}

366
${C_EXP_HDR}/${CHEADER2}.h :: ${CHEADER2}.h
367 368
	${CP} ${CHEADER2}.h $@ ${CPFLAGS}

369
${C_EXP_HDR}/${CHEADER3}.h :: ${CHEADER3}.h
370 371 372
	${CP} ${CHEADER3}.h $@ ${CPFLAGS}

#
373
# Resources
374
#
375
resources${CUSTOMRES}:: resources-${CMDHELP}
376 377 378 379 380 381 382
	@${ECHO} ${COMPONENT}: resources copied to Messages module

ifeq (${CUSTOMRES},no)
resources:
	@${ECHO} ${COMPONENT}: no resources to export
endif        

383 384 385 386 387 388 389 390
resources_extra: ${RES_DEPENDS_}
ifneq (${RES_FILES_},)
	${INSTRES} -I Resources.${USERIF}.${LOCALE},Resources.${USERIF}.UK,Resources.${LOCALE},Resources.UK,Resources ${RESFSDIR} ${RES_FILES_}
endif
ifneq (,$(filter Messages,${INSTRES_VERSION}))
	${INSERTVERSION} ${RESFSDIR}/Messages > ${RESFSDIR}/_Awk_
	${CP} ${RESFSDIR}/_Awk_ ${RESFSDIR}/Messages ${CPFLAGS}
	${RM} ${RESFSDIR}/_Awk_
391
	for path in ${USERIF}/${LOCALE} ${USERIF}/UK ${LOCALE} UK ""; do if [ -f Resources/$$path/Messages ]; then touch -r Resources/$$path/Messages ${RESFSDIR}/Messages; break; fi; done
392 393
endif
	@${NOP}
394

395
resources_common:
396
	${MKDIR} ${RESFSDIR}
397 398 399
	${INSTRES} -I Resources.${USERIF}.${LOCALE},Resources.${USERIF}.UK,Resources.${LOCALE},Resources.UK,Resources ${RESFSDIR} [Messages]

resources_cmdhelp: ${MERGEDMSGS}
400
	${CP} ${MERGEDMSGS} ${RESFSDIR}/Messages
401 402 403 404 405 406

resources-None: resources_common resources_extra
	@${NOP}

resources-: resources_common resources_cmdhelp resources_extra 
	@${NOP}
407 408 409 410 411 412 413 414 415 416 417 418

#
# Build the help tokens
#
${TOKENSOURCE}: ${TOKENS} ${HELPSRC}
	${TOKENISE} ${TOKENS} ${HELPSRC} $@

include $(wildcard *.d)

endif

# EOF