Commit 803a18a1 authored by Stewart Brodie's avatar Stewart Brodie
Browse files

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.36. Tagged as 'Menu-0_36'
parent 577d56cb
......@@ -13,4 +13,5 @@
| limitations under the License.
|
Dir <Obey$Dir>
amu_machine clean
amu_machine clean COMPONENT=Menu
stripdepnd Makefile
......@@ -13,5 +13,4 @@
| limitations under the License.
|
Dir <Obey$Dir>
amu_machine all
amu_machine all COMPONENT=Menu
......@@ -13,4 +13,4 @@
| limitations under the License.
|
Dir <Obey$Dir>
amu_machine rom
amu_machine rom COMPONENT=Menu
| 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=Menu
......@@ -12,144 +12,37 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Makefile for Menu
# 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 = Menu
ROM_MODULE = aof.${COMPONENT}
RAM_MODULE = rm.${COMPONENT}
#
# Export Paths for Messages module
#
RESDIR = <resource$dir>.Resources2.${COMPONENT}
RAMMESSAGES = o.msgs
#
# Generic options:
#
MKDIR = cdir
CC = cc
CMHG = cmhg
CP = copy
LD = link
TLD = tlink
RM = remove
MODSQZ = modsqz
WIPE = -wipe
CPFLAGS = ~cfr~v
WFLAGS = ~c~v
COMMON_OBJ = o.Modhdr_NoD o.auxiliary o.create o.delete o.events o.getstate\
o.hide o.miscop o.show o.task
CFLAGS = -c -depend !Depend ${INCLUDES} -zM -ffah -zps1 ${DFLAGS}
DFLAGS = -D${SYSTEM}
ROMFLAGS = -DROM
INCLUDES = -I<Lib$Dir>.tboxlibint.,<Lib$Dir>.tboxlibs:,C:
ROM_OBJS = o.mainROM ${COMMON_OBJ}
#
# 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
RAM_OBJS = o.main ${RAMMESSAGES} ${COMMON_OBJ}
OBJS =\
o.Modhdr_NoD\
o.Menu\
o.auxiliary\
o.create\
o.delete\
o.events\
o.getstate\
o.hide\
o.miscop\
o.show\
o.task
RAM_OBJS =\
o.Modhdr_NoD\
o.MenuRAM\
o.auxiliary\
o.create\
o.delete\
o.events\
o.getstate\
o.hide\
o.miscop\
o.show\
o.task
RESF=o.msgs
DBG_OBJS = od.main ${RAMMESSAGES} 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: LocalRes:Messages
${MKDIR} ${RESDIR}
TokenCheck LocalRes:Messages
${CP} LocalRes:Messages ${RESDIR}.Messages ${CPFLAGS}
resources: resources-messages
@echo ${COMPONENT}: resource files copied to Messages module
clean:
${WIPE} o.* ${WFLAGS}
${WIPE} aof ${WFLAGS}
${WIPE} rm ${WFLAGS}
${WIPE} linked ${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
${LD} -o linked.${COMPONENT} -rmf -base ${ADDRESS} ${ROM_MODULE} ${ABSSYM}
${CP} linked.${COMPONENT} ${LINKDIR}.${COMPONENT} ${CPFLAGS}
@echo ${COMPONENT}: rom_link complete
${RESF}: LocalRes:Messages
resgen messages_file ${RESF} LocalRes:Messages Resources.${COMPONENT}.Messages
${RAM_MODULE}: ${RAM_OBJS} ${TBOXLIB} ${RESF} ${CLIB}
${mkdir} rm
${LD} -o $@ -module ${RAM_OBJS} ${TBOXLIB} ${RESF} ${CLIB}
${MODSQZ} $@
Access $@ RW/R
o.MenuRAM: Menu.c
$(CC) ${CFLAGS} -o $@ Menu.c
#---------------------------------------------------------------------------
# Dynamic dependencies:
/* (0.35)
/* (0.36)
*
* This file is automatically maintained by srccommit, do not edit manually.
*
*/
#define Module_MajorVersion_CMHG 0.35
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 15 Sep 1998
#define Module_MajorVersion_CMHG 0.36
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 04 May 2000
#define Module_MajorVersion "0.35"
#define Module_Version 35
#define Module_MinorVersion ""
#define Module_Date "15 Sep 1998"
#define Module_MajorVersion "0.36"
#define Module_Version 36
#define Module_MinorVersion ""
#define Module_Date "04 May 2000"
#define Module_FullVersion "0.36"
/* Copyright 1996 Acorn Computers Ltd
/* 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.
......@@ -36,6 +36,7 @@
#include "rmensure.h"
#include "mem.h"
#include "os.h"
#include "objmodule.h"
#include "auxiliary.h"
#include "create.h"
......@@ -70,16 +71,13 @@ 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 *Menu_finalise (int fatal, int podule, void *pw)
{
_kernel_swi_regs regs;
#ifndef ROM
extern int messages_file(void);
#endif
IGNORE(fatal);
IGNORE(podule);
IGNORE(pw);
......@@ -103,7 +101,7 @@ extern _kernel_oserror *Menu_finalise (int fatal, int podule, void *pw)
* ... and deregister from ResourceFS
*/
_swix (ResourceFS_DeregisterFiles, _IN(0), messages_file());
objmodule_deregister_resources(messages_file());
#endif
/* hide menus before deletion */
......@@ -111,18 +109,11 @@ extern _kernel_oserror *Menu_finalise (int fatal, int podule, void *pw)
if (global_menu.flags & GLOBAL_MENU_INFO_FLAGS_IS_SHOWING) {
DEBUG debug_output ("M","Menu: hiding menus\n");
regs.r[1] = -1;
_kernel_swi (Wimp_CreateMenu, &regs, &regs);
_swix(Wimp_CreateMenu, _IN(1), -1);
}
/* deregister object module */
regs.r[0] = 0;
regs.r[1] = Menu_ObjectClass;
_kernel_swi(Toolbox_DeRegisterObjectModule, &regs, &regs);
objmodule_deregister(0, Menu_ObjectClass);
/*
* free up memory we may have left allocated
......@@ -144,12 +135,8 @@ extern _kernel_oserror *Menu_finalise (int fatal, int podule, void *pw)
extern _kernel_oserror *Menu_init(char *cmd_tail, int podule_base, void *pw)
{
char *messages_filename;
_kernel_swi_regs regs;
_kernel_oserror *e;
#ifndef ROM
extern int messages_file(void);
#endif
IGNORE(cmd_tail);
IGNORE(podule_base);
......@@ -168,19 +155,13 @@ extern _kernel_oserror *Menu_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;
objmodule_register_resources(messages_file());
#endif
DEBUG debug_output ("M","Menu: code initialise\n");
if (getenv ("Menu$Path") == NULL)
messages_filename = "Resources:$.Resources.Menu.Messages";
else
messages_filename = "Menu:Messages";
if ((e = messages_file_open (messages_filename)) != NULL)
objmodule_ensure_path("Menu$Path", "Resources:$.Resources.Menu.");
if ((e = messages_file_open ("Menu:Messages")) != NULL)
return e;
......@@ -210,16 +191,7 @@ extern _kernel_oserror *Menu_init(char *cmd_tail, int podule_base, void *pw)
}
/* register here with the Toolbox as an Object Module */
regs.r[0] = 0;
regs.r[1] = Menu_ObjectClass;
regs.r[2] = Menu_ClassSWI;
regs.r[3] = 0;
if ((e = _kernel_swi(Toolbox_RegisterObjectModule, &regs, &regs)) != NULL)
return e;
return NULL;
return objmodule_register_with_toolbox(0, Menu_ObjectClass, Menu_ClassSWI, 0);
}
......@@ -229,8 +201,6 @@ extern _kernel_oserror *Menu_init(char *cmd_tail, int podule_base, void *pw)
extern void Menu_services(int service_number, _kernel_swi_regs *r, void *pw)
{
_kernel_swi_regs regs;
IGNORE(pw);
DEBUG debug_output ("M","Menu: svc 0x%x\n",service_number);
......@@ -262,13 +232,7 @@ extern void Menu_services(int service_number, _kernel_swi_regs *r, void *pw)
/*
* register with the Toolbox as an Object Module
*/
regs.r[0] = 0;
regs.r[1] = Menu_ObjectClass;
regs.r[2] = Menu_ClassSWI;
regs.r[3] = 0;
_kernel_swi (Toolbox_RegisterObjectModule, &regs, &regs);
objmodule_register_with_toolbox(0, Menu_ObjectClass, Menu_ClassSWI, 0);
break;
default:
......@@ -288,9 +252,9 @@ extern _kernel_oserror *Menu_SWI_handler(int swi_no, _kernel_swi_regs *r, void *
IGNORE(pw);
switch (swi_no+Menu_SWIChunkBase)
switch (swi_no)
{
case Menu_ClassSWI:
case Menu_ClassSWI-Menu_SWIChunkBase:
if (r->r[0] < 0 || r->r[0] >= MAX_CLASS_SWI_METHODS)
{
return make_error_hex(Menu_NoSuchMethod,1,r->r[0]);
......@@ -307,15 +271,15 @@ extern _kernel_oserror *Menu_SWI_handler(int swi_no, _kernel_swi_regs *r, void *
}
break;
case Menu_PostFilter:
case Menu_PostFilter-Menu_SWIChunkBase:
e = events_postfilter (r);
break;
case Menu_PreFilter:
case Menu_PreFilter-Menu_SWIChunkBase:
e = events_prefilter (r);
break;
case Menu_UpdateTree:
case Menu_UpdateTree-Menu_SWIChunkBase:
e = update_tree ();
break;
......
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