Commit 485d2a14 authored by Ben Avison's avatar Ben Avison
Browse files

Modernise build structure

Detail:
* Rewrite `Makefile` to use shared makefile fragments
* Uses `modgen` to create the !Alarm module, which obsoletes some source files
* Rename a couple of resource files to match their names when installed
* All the files in `Resources:$.Apps.!Alarm` are now registered by the !Alarm
  module, so you can kill or unplug the module to hide it
* The `Code` blob used to be installed in ResourceFS both by the Messages
  module and by the !Alarm module - now de-duplicated (only in Messages)
* Consolidate `.gitignore` files
* Enable GitLab CI

Admin:
  Requires RiscOS/BuildSys!32
parent 8248b1e8
No related merge requests found
Pipeline #1473 passed with stage
in 4 seconds
......@@ -13,4 +13,4 @@
| limitations under the License.
|
Dir <Obey$Dir>
amu_machine install INSTDIR=<obey$dir>
Do amu_machine install INSTDIR=<obey$dir>
/!RunImage,ffb
/bas/!RunImage
/code.mk.d
/crunched/
/Makefile.d
/o/
/objs/
/Resources/Code,ffd
/rm/
variables:
WHITESPACE_WHITELIST: "./Resources/UK/!Help ./bas/*"
include:
- project: 'Support/CI'
file: '/Alarm.yml'
......@@ -13,133 +13,25 @@
# limitations under the License.
#
# Makefile for Alarm
#
# ***********************************
# *** C h a n g e L i s t ***
# ***********************************
# Date Name Description
# ---- ---- -----------
# 05-Nov-94 AMcC Updated for Black build
# 24-Jul-03 RPS Use objasm
#
#
# Program specific options:
#
COMPONENT = Alarm
APP = !${COMPONENT}
ROM_MODULE = rm.${COMPONENT}
RDIR = Resources
LDIR = LocalRes:
MSGVERSION = ${AWK} -f Build:AwkVers
MSGS = Resources.GenMessage
#
# Export Paths for Messages module
#
RESDIR = <resource$dir>.Resources2.${COMPONENT}
RESAPP = <resource$dir>.Apps.${APP}
include StdTools
SQUISH = squish
SQFLAGS = -nolist
FILES =\
${RDIR}.!Boot \
${LDIR}!Help \
${RDIR}.!Run \
${RDIR}.!RunImage \
${RDIR}.Alarms \
${RDIR}.Code \
${MSGS} \
${LDIR}Template3D
# Resources to be included in the ROM module (not in Messages module)
RESFILES =\
${RDIR}.code \
${RDIR}.!RunImage
#
# Main rules:
#
all: ${FILES}
@echo ${COMPONENT}: Application built (Disc)
rom: ${ROM_MODULE}
@echo ${COMPONENT}: Module built (ROM)
install: ${FILES}
${MKDIR} ${INSTDIR}.${APP}
|
${CP} ${RDIR}.!Boot ${INSTDIR}.${APP}.!Boot ${CPFLAGS}
${CP} ${LDIR}!Help ${INSTDIR}.${APP}.!Help ${CPFLAGS}
${CP} ${RDIR}.!Run ${INSTDIR}.${APP}.!Run ${CPFLAGS}
${CP} ${RDIR}.!RunImage ${INSTDIR}.${APP}.!RunImage ${CPFLAGS}
${CP} ${RDIR}.Alarms ${INSTDIR}.${APP}.Alarms ${CPFLAGS}
${CP} ${RDIR}.Code ${INSTDIR}.${APP}.Code ${CPFLAGS}
${CP} ${MSGS} ${INSTDIR}.${APP}.Messages ${CPFLAGS}
${CP} ${LDIR}Template3D ${INSTDIR}.${APP}.Templates ${CPFLAGS}
|
Access ${INSTDIR}.${APP}.* lr/r
Access ${INSTDIR}.${APP}.Alarms wr/r
|
@echo ${COMPONENT}: Application installed (Disc)
install_rom: ${ROM_MODULE}
${CP} ${ROM_MODULE} ${INSTDIR}.${COMPONENT} ${CPFLAGS}
@echo ${COMPONENT}: Module installed {ROM}
resources: ${MSGS} ${RDIR}.Code
${MKDIR} ${RESAPP}
${MKDIR} ${RESDIR}
|
${CP} ${RDIR}.!Boot ${RESAPP}.!Boot ${CPFLAGS}
${CP} ${LDIR}!Help ${RESAPP}.!Help ${CPFLAGS}
${CP} ${RDIR}.ROM.!Run ${RESAPP}.!Run ${CPFLAGS}
${CP} ${LDIR}!RunLink ${RESDIR}.!RunLink ${CPFLAGS}
${CP} ${RDIR}.Code ${RESDIR}.Code ${CPFLAGS}
${CP} ${MSGS} ${RESDIR}.Messages ${CPFLAGS}
${CP} ${LDIR}Template3D ${RESDIR}.Templates ${CPFLAGS}
|
@echo ${COMPONENT}: resource files copied to Messages module
clean:
${RM} ${ROM_MODULE}
${RM} ${RDIR}.!RunImage
${RM} ${RDIR}.Code
${RM} ${MSGS}
${XWIPE} !Alarm ${WFLAGS}
${XWIPE} o ${WFLAGS}
${XWIPE} crunched.* ${WFLAGS}
@echo ${COMPONENT}: cleaned
#
# Static dependencies:
#
${ROM_MODULE}: s.Main ${MSGS} ${RESFILES}
${MKDIR} o
${AS} ${ASFLAGS} -o o.Main s.Main
${LD} -rmf -o $@ o.Main
${MSGS}: LocalRes:Messages VersionNum
${MSGVERSION} LocalRes:Messages > $@
${RDIR}.!RunImage: crunched.!RunImage
${SQUISH} ${SQFLAGS} -from crunched.!RunImage -to $@
COMPONENT ?= Alarm
override TARGET = !RunImage
SRCS = Main Dialogues Utils Clock Alarms
INSTTYPE = app
INSTAPP_FILES = !Boot !Help !Run !RunImage Alarms Code Messages Templates
INSTAPP_DEPENDS = Resources${SEP}Code${SUFFIX_DATA}
INSTAPP_VERSION = Messages
RES_FILES = !RunImage !RunLink Code Messages Templates
RES_DEPENDS = Resources${SEP}Code${SUFFIX_DATA}
RESAPP_FILES = !Boot !Help !Run
crunched.!RunImage: bas.Main bas.Dialogues bas.Utils bas.Clock bas.Alarms
FAppend crunched.All bas.Main bas.Dialogues bas.Utils bas.Clock bas.Alarms
${RUN}crunch.!RunImage; BASIC
include BasicApp
${RDIR}.Code: s.Browser
${MKDIR} o
${AS} ${ASFLAGS} -o o.Browser s.Browser
${LD} -bin -o $@ o.Browser
Resources${SEP}Code${SUFFIX_DATA}:
@${MAKE} -f code${EXT}mk
BBETYPE = alarm
bbe-alarm: bbe-generic
BBE_Export_Dir Resources
clean::
@${MAKE} -f code${EXT}mk clean
@${STRIPDEPEND} code${EXT}mk
#---------------------------------------------------------------------------
# Dynamic dependencies:
File added
File added
# Copyright 2020 RISC OS Open 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 for 'Code' blob
COMPONENT = Code
override TARGET = Resources${SEP}Code
OBJS = Browser
CUSTOMLINK = custom
include StdTools
# Override filetype of target (so 'all' phony rule has correct dependency)
SUFFIX_ABSOLUTE = ${SUFFIX_DATA}
include CApp
${TARGET}${SUFFIX_DATA}: ${DIRS} ${APP_OBJS_}
${LDBIN} $@ ${APP_OBJS_}
# Dynamic dependencies:
TEXTLOAD "crunched.All"
CRUNCH -1
SAVE "crunched.!RunImage"
QUIT
*
!.gitignore
*
!.gitignore
; Copyright 1996 Acorn Computers 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.
;
; > Sources.AppName
GBLS ApplicationName
ApplicationName SETS "Alarm"
END
; Copyright 1996 Acorn Computers 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.
;
; > Sources.Main
; *********************************
; *** C h a n g e L i s t ***
; *********************************
; Date Description
; ---- -----------
; 19-Feb-90 0.01 File created
;
AREA |Alarm$$Code|, CODE, READONLY, PIC
Module_BaseAddr
GET AppName.s ; read ApplicationName
GET Hdr:ListOpts
GET Hdr:Macros
GET Hdr:System
GET Hdr:ModHand
GET Hdr:Services
GET Hdr:Proc
GET Hdr:ResourceFS
GET VersionASM
; **************** Module code starts here **********************
ASSERT (.-Module_BaseAddr) = 0
DCD 0 ; App_Start - Module_BaseAddr
DCD App_Init - Module_BaseAddr
DCD App_Die - Module_BaseAddr
DCD App_Service - Module_BaseAddr
DCD App_Title - Module_BaseAddr
DCD App_HelpStr - Module_BaseAddr
DCD 0
[ :LNOT: No32bitCode
DCD 0
DCD 0
DCD 0
DCD 0
DCD 0
DCD App_ModFlag - Module_BaseAddr
]
[ :DEF: standalone
App_Title DCB "!$ApplicationName:CC:Resources",0
|
App_Title DCB "!$ApplicationName", 0
]
App_HelpStr DCB "!$ApplicationName", 9, 9, "$Module_MajorVersion ($Module_Date)", 0
ALIGN
; *****************************************************************************
;
; Module flags. Bit 0 set means module is 32-bit aware and safe
;
[ :LNOT: No32bitCode
App_ModFlag DCD ModuleFlag_32bit
]
; *****************************************************************************
;
; App_Init - Initialisation entry
;
App_Init Entry "r0"
ADR R0, resourcefsfiles
SWI XResourceFS_RegisterFiles ; ignore errors (starts on Service_ResourceFSStarting)
CLRV
EXIT
; *****************************************************************************
;
; App_Die - Die entry
;
App_Die Entry "r0"
ADR R0, resourcefsfiles
SWI XResourceFS_DeregisterFiles
CLRV
EXIT ; ignore errors (ResourceFS might be dead)
; *****************************************************************************
;
; App_Service - Main entry point for services
;
;Ursula format
App_ServTab
DCD 0 ;flags
DCD App_UService - Module_BaseAddr ;handler
DCD Service_ResourceFSStarting
DCD 0 ;terminator
DCD App_ServTab - Module_BaseAddr ;anchor
App_Service ROUT
MOV r0, r0 ;magic instruction
TEQ R1, #Service_ResourceFSStarting
MOVNE PC, LR
App_UService
; In R2 -> address inside ResourceFS module to call
; R3 = workspace pointer for module
; Out R2 called with R0 -> files, R3 -> workspace
svc_resourcefsstarting Entry "R0-R3"
ADR R0, resourcefsfiles
MOV LR, PC ; get return address
MOV PC, R2 ; R2 = address to call
EXIT
resourcefsfiles
GET ResFiles.s
DCD 0
END
; Copyright 1996 Acorn Computers 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.
;
; > Sources.ResFiles
;
; Insert here the names of the files to be put into Resources:$.Resources.<app>
[ :DEF: standalone
; NB these files are normally built into the ROM by the Messages
; module. They can be built into a Resources module by using the
; MakeRes file
ResourceFile Resources.GenMessages, Resources.$ApplicationName..Messages
ResourceFile LocalRes:Template3D, Resources.$ApplicationName..Templates
|
ResourceFile Resources.!RunImage, Resources.$ApplicationName..!RunImage
ResourceFile Resources.Code, Resources.$ApplicationName..Code
]
END
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