Commit 691ef673 authored by Stewart Brodie's avatar Stewart Brodie

Build process improvements:

  !MkRam,fd7 added to enable RAM builds of all Toolbox modules
  MakeFile tidied up and support for RAM build added
Module now uses Toolbox memory allocation instead of calling OS_Module.
parent a324e3c5
| Copyright 1998 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.
|
Dir <Obey$Dir>
amu_machine all
......@@ -20,6 +20,7 @@
# Date Name Description
# ---- ---- -----------
# 06-Jan-94 AMcC Created
# 04-Feb-98 SNB Updated to allow RAM builds
#
#
......@@ -27,6 +28,7 @@
#
COMPONENT = Scale
ROM_MODULE = aof.${COMPONENT}
RAM_MODULE = rm.${COMPONENT}
#
# Export Paths for Messages module
......@@ -41,6 +43,7 @@ CC = cc
CMHG = cmhg
CP = copy
LD = link
TLD = tlink
RM = remove
WIPE = -wipe
......@@ -48,7 +51,8 @@ CPFLAGS = ~cfr~v
WFLAGS = ~c~v
CFLAGS = -c -depend !Depend ${INCLUDES} -zM -ffah -zps1 ${DFLAGS}
DFLAGS = -DROM
DFLAGS = -D${SYSTEM}
ROMFLAGS = -DROM
INCLUDES = -I<Lib$Dir>.tboxlibint.,<Lib$Dir>.tboxlibs:,C:
#
......@@ -64,7 +68,6 @@ TBOXLIB = <Lib$Dir>.tboxlibint.o.tboxlibm
OBJS =\
o.Modhdr_NoD\
o.auxiliary\
o.copy\
o.create\
o.delete\
o.events\
......@@ -75,16 +78,35 @@ OBJS =\
o.show\
o.task
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
MSGSF=o.msgs
RESF=o.res
#
# Rule patterns
#
.c.o:; ${CC} ${CFLAGS} -o $@ $<
.c.o:; ${CC} ${CFLAGS} ${ROMFLAGS} -o $@ $<
.cmhg.o:; ${CMHG} -o $@ $<
#
# Main rules:
#
#
all: ${RAM_MODULE}
@echo ${COMPONENT}: Module built (RAM)
rom: ${ROM_MODULE}
@echo ${COMPONENT}: Module built (ROM)
......@@ -100,6 +122,7 @@ resources: Resources.${LOCALE}.Messages Resources.${LOCALE}.Res
clean:
${WIPE} o.* ${WFLAGS}
${WIPE} aof ${WFLAGS}
${WIPE} rm ${WFLAGS}
${WIPE} linked ${WFLAGS}
${WIPE} map ${WFLAGS}
@echo ${COMPONENT}: cleaned
......@@ -118,5 +141,21 @@ rom_link:
${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}
${mkdir} rm
${TLD} -o $@ -module ${RAM_OBJS} ${TBOXLIB} ${RESF} ${MSGSF}
Access $@ RW/R
o.mainRAM: main.c
$(CC) ${CFLAGS} -o $@ main.c
#---------------------------------------------------------------------------
# Dynamic dependencies:
/* 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.
*/
/* Title: copy.c
* Purpose: copy a Scale Object
* Author: TGR
* History: 16-Feb-94: TGR: created
*
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "kernel.h"
#include "swis.h"
#include "const.h"
#include "macros.h"
#include "services.h"
#include "debug.h"
#include "mem.h"
#include "messages.h"
#include "objects.toolbox.h"
#include "objects.scale.h"
#include "auxiliary.h"
#include "object.h"
#include "task.h"
#include "copy.h"
extern _kernel_oserror *copy_object (_kernel_swi_regs *r, TaskDescriptor *t)
{
/*
* request to copy an object
* R0 = 2
* R1 = Object ID
* R2 = internal handle returned when "src" Object was created
* R3 = wimp task handle of caller (use to identify task descriptor)
* R4 -> user regs R0-R9:
* R0 = flags
* bit 0 set => do not recursively copy the Object
* R1 = source Object ID
*/
/*
* The Toolbox has already checked that this is not just a copy
* call for a shared Object which already exists.
* We create a new Object, and add it to the list of Objects for this
* task.
* We need to remember the ObjectID passed to us by the Toolbox, so
* that we can identify this Object if we are given an ID from the
* client's "id block".
*/
#ifdef COPY_OBJECT
_kernel_oserror *e;
_kernel_swi_regs regs;
ScaleInternal *internal = (ScaleInternal *) r->r[2],
*internalx;
if ((internalx = mem_alloc (sizeof (ScaleInternal))) == NULL)
return make_error (Scale_AllocFailed, 0);
internalx = internal;
regs.r[0] = 0;
regs.r[1] = (int) internal->sub_object_id;
if ((e = _kernel_swi (Toolbox_CopyObject, &regs, &regs)) != NULL)
goto clearup1;
internalx->sub_object_id = (ObjectID) regs.r[0];
internalx->forward = t->object_list;
internalx->backward = t->object_list->backward;
t->object_list->backward->forward = internalx;
t->object_list->backward = internalx;
r->r[0] = (int) internalx;
return NULL;
clearup1:
mem_freek (internalx);
return e;
#else
return NULL;
#endif
}
......@@ -39,7 +39,6 @@
#include "object.h"
#include "create.h"
#include "delete.h"
#include "copy.h"
#include "show.h"
#include "hide.h"
#include "getstate.h"
......
......@@ -28,7 +28,7 @@ service-call-handler: Scale_services 0x44ec1, 0x44ec2, 0x44ec3
title-string: Scale
help-string: Scale 0.11
help-string: Scale 0.12
command-keyword-table: Scale_commands
Scale_Memory()
......
......@@ -28,7 +28,7 @@ service-call-handler: Scale_services 0x44ec1, 0x44ec2, 0x44ec3
title-string: Scale
help-string: Scale 0.11
help-string: Scale 0.12
swi-chunk-base-number: 0x82c00
......
/* 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.
*/
/* Title: copy.h
* Purpose: copy a Scale Object
* Author: TGR
* History: 16-Feb-94: TGR: created
*
*/
#ifndef __copy_h
#define __copy_h
#include "kernel.h"
#ifndef __task_h
#include "task.h"
#endif
extern _kernel_oserror *copy_object (_kernel_swi_regs *r, TaskDescriptor *t);
#endif
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