Commit f4e3e2cb authored by Stewart Brodie's avatar Stewart Brodie

Changed to use common Makefile system.

  Debug build facility added.
Detail:
  Uses core facilities from Common instead of having private copies.
  Makefile vastly simplified to simply define a few macros, then include
    the common Toolbox Makefile which is exported by Common.
Admin:
  Requires Common 0.09 or later (RiscOS/Sources/Toolbox/Common; Common-0_09)
  Requires BuildSys 1.92 or later (RiscOS/BuildSys; BuildSys-1_92)
  Requires Library 0.41 or later (RiscOS/Library; Library-0_41)

Version 0.15. Tagged as 'Scale-0_15'
parent 826e86b3
......@@ -13,4 +13,5 @@
| limitations under the License.
|
Dir <Obey$Dir>
amu_machine clean
amu_machine clean COMPONENT=Scale
stripdepnd Makefile
......@@ -13,4 +13,4 @@
| limitations under the License.
|
Dir <Obey$Dir>
amu_machine all
amu_machine all COMPONENT=Scale
......@@ -13,4 +13,4 @@
| limitations under the License.
|
Dir <Obey$Dir>
amu_machine rom
amu_machine rom COMPONENT=Scale
| Copyright 2000 Pace Micro Technology plc
|
| 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.
|
Dir <Obey$Dir>
amu_machine trace COMPONENT=Scale
......@@ -12,150 +12,37 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Makefile for Scale
# Makefile for a Toolbox Object module
#
# ***********************************
# *** C h a n g e L i s t ***
# ***********************************
# Date Name Description
# ---- ---- -----------
# 06-Jan-94 AMcC Created
# 04-Feb-98 SNB Updated to allow RAM builds
#
# $Id$
#
# Component specific options:
#
COMPONENT = Scale
ROM_MODULE = aof.${COMPONENT}
RAM_MODULE = rm.${COMPONENT}
#
# Export Paths for Messages module
#
RESDIR = <resource$dir>.Resources2.${COMPONENT}
#
# Generic options:
#
MKDIR = cdir
CC = cc
CMHG = cmhg
CP = copy
LD = link
TLD = tlink
RM = remove
WIPE = -wipe
CPFLAGS = ~cfr~v
WFLAGS = ~c~v
RAMBOTH = o.msgs
CFLAGS = -c -depend !Depend ${INCLUDES} -zM -ffah -zps1 ${DFLAGS}
DFLAGS = -D${SYSTEM}
ROMFLAGS = -DROM
INCLUDES = -I<Lib$Dir>.tboxlibint.,<Lib$Dir>.tboxlibs:,C:
#
# Libraries
#
ANSILIB = CLib:o.ansilib
CLIB = CLIB:o.stubs
RLIB = RISCOSLIB:o.risc_oslib
ROMCSTUBS = RISCOSLIB:o.romcstubs
ABSSYM = RISC_OSLib:o.abssym
TBOXLIB = <Lib$Dir>.tboxlibint.o.tboxlibm
COMMON_OBJ = o.Modhdr_NoD o.auxiliary o.create o.delete o.events o.getstate\
o.hide o.miscop o.show o.task
OBJS =\
o.Modhdr_NoD\
o.auxiliary\
o.create\
o.delete\
o.events\
o.getstate\
o.hide\
o.main\
o.miscop\
o.show\
o.task
ROM_OBJS = o.mainROM ${COMMON_OBJ}
RAM_OBJS =\
o.Modhdr_NoD\
o.auxiliary\
o.create\
o.delete\
o.events\
o.getstate\
o.hide\
o.mainRAM\
o.miscop\
o.show\
o.task
RAM_OBJS = o.main ${RAMBOTH} ${COMMON_OBJ}
MSGSF=o.msgs
RESF=o.res
DBG_OBJS = od.main ${RAMBOTH} o.Modhdr od.auxiliary od.create od.delete od.events\
od.getstate od.hide od.miscop od.show od.task
#
# Rule patterns
# Get main rules
#
.c.o:; ${CC} ${CFLAGS} ${ROMFLAGS} -o $@ $<
.cmhg.o:; ${CMHG} -p -o $@ $<
include C:tboxlibint.TboxMake
#
# Main rules:
# Module specific rules:
#
#
all: ${RAM_MODULE}
@echo ${COMPONENT}: Module built (RAM)
rom: ${ROM_MODULE}
@echo ${COMPONENT}: Module built (ROM)
install_rom: ${ROM_MODULE}
${CP} ${ROM_MODULE} ${INSTDIR}.${COMPONENT} ${CPFLAGS}
@echo ${COMPONENT}: Module installed (ROM)
resources: Resources.${LOCALE}.Messages Resources.${LOCALE}.Res
${MKDIR} ${RESDIR}
${CP} Resources.${LOCALE}.* ${RESDIR}.* ${CPFLAGS}
resources: resources-both
@echo ${COMPONENT}: resource files copied to Messages module
clean:
${WIPE} o.* ${WFLAGS}
${WIPE} aof ${WFLAGS}
${WIPE} rm ${WFLAGS}
${WIPE} linked ${WFLAGS}
${WIPE} map ${WFLAGS}
clean: toolbox-clean
@echo ${COMPONENT}: cleaned
${ROM_MODULE}: ${OBJS} ${TBOXLIB} ${ROMCSTUBS}
${MKDIR} aof
${LD} -o $@ -aof ${OBJS} ${TBOXLIB} ${ROMCSTUBS}
# final link for ROM Image (using given base address)
rom_link:
${MKDIR} linked
${MKDIR} map
${LD} -o linked.${COMPONENT} -bin -base ${ADDRESS} ${ROM_MODULE} ${ABSSYM} \
-map > map.${COMPONENT}
truncate map.${COMPONENT} linked.${COMPONENT}
${CP} linked.${COMPONENT} ${LINKDIR}.${COMPONENT} ${CPFLAGS}
@echo ${COMPONENT}: rom_link complete
${MSGSF}: @.Resources.${LOCALE}.Messages
resgen messages_file ${MSGSF} Resources.${LOCALE}.Messages Resources.${COMPONENT}.Messages
${RESF}: @.Resources.${LOCALE}.Res
resgen res_file ${RESF} Resources.${LOCALE}.Res Resources.${COMPONENT}.Res
${RAM_MODULE}: ${RAM_OBJS} ${TBOXLIB} ${RESF} ${MSGSF} ${CLIB}
${mkdir} rm
${LD} -o $@ -module ${RAM_OBJS} ${TBOXLIB} ${RESF} ${MSGSF} ${CLIB}
Access $@ RW/R
o.mainRAM: main.c
$(CC) ${CFLAGS} -o $@ main.c
#---------------------------------------------------------------------------
# Dynamic dependencies:
/* (0.14)
/* (0.15)
*
* This file is automatically maintained by srccommit, do not edit manually.
*
*/
#define Module_MajorVersion_CMHG 0.14
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 30 Jul 1998
#define Module_MajorVersion_CMHG 0.15
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 04 May 2000
#define Module_MajorVersion "0.14"
#define Module_Version 14
#define Module_MinorVersion ""
#define Module_Date "30 Jul 1998"
#define Module_MajorVersion "0.15"
#define Module_Version 15
#define Module_MinorVersion ""
#define Module_Date "04 May 2000"
#define Module_FullVersion "0.15"
......@@ -32,6 +32,7 @@
#include "rmensure.h"
#include "mem.h"
#include "messages.h"
#include "objmodule.h"
#include "objects.toolbox.h"
#include "objects.scale.h"
......@@ -67,16 +68,12 @@ static _kernel_oserror *(*class_swi_methods [MAX_CLASS_SWI_METHODS])(_kernel_swi
#ifdef ROM
static _kernel_oserror *__ROM;
#else
extern int messages_file(void);
#endif
extern _kernel_oserror *Scale_finalise (int fatal, int podule, void *pw)
{
_kernel_swi_regs regs;
#ifndef ROM
extern int messages_file(void);
extern int res_file(void);
#endif
/*
* refuse to finalise if tasks active
*/
......@@ -94,20 +91,11 @@ extern _kernel_oserror *Scale_finalise (int fatal, int podule, void *pw)
/*
* ... and deregister from ResourceFS
*/
regs.r[0] = messages_file();
_kernel_swi (ResourceFS_DeregisterFiles, &regs, &regs);
regs.r[0] = res_file();
_kernel_swi (ResourceFS_DeregisterFiles, &regs, &regs);
objmodule_deregister_resources(messages_file());
#endif
/* deregister object module */
regs.r[0] = 0;
regs.r[1] = Scale_ObjectClass;
_kernel_swi(Toolbox_DeRegisterObjectModule, &regs, &regs);
objmodule_deregister(0, Scale_ObjectClass);
/*
* free up memory we may have left allocated
......@@ -120,7 +108,7 @@ extern _kernel_oserror *Scale_finalise (int fatal, int podule, void *pw)
IGNORE(fatal);
#ifdef ROM
if(!__ROM) _swix(0xa2c41, 0);
if(!__ROM) _swix(0x82c41, 0);
#endif
return NULL;
......@@ -132,16 +120,10 @@ extern _kernel_oserror *Scale_finalise (int fatal, int podule, void *pw)
extern _kernel_oserror *Scale_init(char *cmd_tail, int podule_base, void *pw)
{
char *filename;
_kernel_swi_regs regs;
_kernel_oserror *e;
#ifndef ROM
extern int messages_file(void);
extern int res_file(void);
#endif
#ifdef ROM
__ROM = _swix(0xa2c43, _IN(0), pw);
__ROM = _swix(0x82c43, _IN(0), pw);
#endif
DEBUG debug_set_var_name("Scale$Debug");
......@@ -155,41 +137,21 @@ extern _kernel_oserror *Scale_init(char *cmd_tail, int podule_base, void *pw)
*/
#ifndef ROM
regs.r[0] = messages_file();
if ((e = _kernel_swi (ResourceFS_RegisterFiles, &regs, &regs)) != NULL)
return e;
regs.r[0] = res_file();
if ((e = _kernel_swi (ResourceFS_RegisterFiles, &regs, &regs)) != NULL)
return e;
if ((e = objmodule_register_resources(messages_file())) != NULL)
return e;
#endif
if (getenv ("Scale$Path") == NULL)
filename = "Resources:$.Resources.Scale.Messages";
else
filename = "Scale:Messages";
if ((e = messages_file_open (filename)) != NULL)
objmodule_ensure_path("Scale$Path", "Resources:$.Resources.Scale.");
if ((e = messages_file_open ("Scale:Messages")) != NULL)
return e;
/* open the proginfo template file */
if (getenv ("Scale$Path") == NULL)
filename = "Resources:$.Resources.Scale.Res";
else
filename = "Scale:Res";
/* register here with the Toolbox as an Object Module */
regs.r[0] = 0;
regs.r[1] = Scale_ObjectClass;
regs.r[2] = Scale_ClassSWI;
regs.r[3] = (int) filename;
IGNORE(pw);
IGNORE(podule_base);
IGNORE(cmd_tail);
return _kernel_swi(Toolbox_RegisterObjectModule, &regs, &regs);
/* register here with the Toolbox as an Object Module */
return objmodule_register_with_toolbox(0, Scale_ObjectClass, Scale_ClassSWI, "Scale:Res");
}
......@@ -198,9 +160,6 @@ extern _kernel_oserror *Scale_init(char *cmd_tail, int podule_base, void *pw)
extern void Scale_services(int service_number, _kernel_swi_regs *r, void *pw)
{
_kernel_swi_regs regs;
char *filename;
DEBUG debug_output ("M","Scale: svc 0x%x\n",service_number);
......@@ -232,17 +191,7 @@ extern void Scale_services(int service_number, _kernel_swi_regs *r, void *pw)
* register with the Toolbox as an Object Module
*/
if (getenv ("Scale$Path") == NULL)
filename = "Resources:$.Resources.Scale.Res";
else
filename = "Scale:Res";
regs.r[0] = 0;
regs.r[1] = Scale_ObjectClass;
regs.r[2] = Scale_ClassSWI;
regs.r[3] = (int) filename;
_kernel_swi (Toolbox_RegisterObjectModule, &regs, &regs);
objmodule_register_with_toolbox(0, Scale_ObjectClass, Scale_ClassSWI, "Scale:Res");
break;
default:
......@@ -262,9 +211,9 @@ extern _kernel_oserror *Scale_SWI_handler(int swi_no, _kernel_swi_regs *r, void
DEBUG debug_output ("M","Scale: SWI 0x%x\n",Scale_SWIChunkBase+swi_no);
switch (swi_no + Scale_SWIChunkBase)
switch (swi_no)
{
case Scale_ClassSWI:
case Scale_ClassSWI - Scale_SWIChunkBase:
if (r->r[0] < 0 || r->r[0] >= MAX_CLASS_SWI_METHODS)
{
return make_error_hex(Scale_NoSuchMethod,1,r->r[0]);
......@@ -283,11 +232,11 @@ extern _kernel_oserror *Scale_SWI_handler(int swi_no, _kernel_swi_regs *r, void
}
break;
case Scale_PostFilter:
case Scale_PostFilter - Scale_SWIChunkBase:
e = events_postfilter (r);
break;
case Scale_PreFilter:
case Scale_PreFilter - Scale_SWIChunkBase:
e = events_prefilter (r);
break;
......
......@@ -18,7 +18,7 @@
; History: 16-Feb-94: TGR: version 1.00
; 8-Feb-95: IDJ: version 0.11
;
#include "VersionNum"
initialisation-code: Scale_init
......
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