Commit 8445a02f 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.21. Tagged as 'ColourMenu-0_21'
parent a0254b33
......@@ -13,5 +13,5 @@
| limitations under the License.
|
Dir <Obey$Dir>
amu_machine clean
amu_machine clean COMPONENT=ColourMenu
stripdepnd Makefile
......@@ -13,4 +13,4 @@
| limitations under the License.
|
Dir <Obey$Dir>
amu_machine all
amu_machine all COMPONENT=ColourMenu
......@@ -13,4 +13,4 @@
| limitations under the License.
|
Dir <Obey$Dir>
amu_machine rom
amu_machine rom COMPONENT=ColourMenu
| 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=ColourMenu
......@@ -12,143 +12,37 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Makefile for ColourMenu
# 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 = ColourMenu
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
RAMMESSAGES = 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 ${RAMMESSAGES} ${COMMON_OBJ}
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 -depend !Depend -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
${MKDIR} ${RESDIR}
${CP} Resources.${LOCALE}.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}
${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
${LD} -o linked.${COMPONENT} -rmf -base ${ADDRESS} ${ROM_MODULE} ${ABSSYM}
${CP} linked.${COMPONENT} ${LINKDIR}.${COMPONENT} ${CPFLAGS}
@echo ${COMPONENT}: rom_link complete
${RESF}: @.Resources.${LOCALE}.Messages
resgen messages_file ${RESF} Resources.${LOCALE}.Messages Resources.${COMPONENT}.Messages
${RAM_MODULE}: ${RAM_OBJS} ${TBOXLIB} ${RESF} ${CLIB}
${mkdir} rm
${LD} -o $@ -module ${RAM_OBJS} ${TBOXLIB} ${RESF} ${CLIB}
Access $@ RW/R
o.mainRAM: main.c
$(CC) ${CFLAGS} -o $@ main.c
#---------------------------------------------------------------------------
# Dynamic dependencies:
/* (0.20)
/* (0.21)
*
* This file is automatically maintained by srccommit, do not edit manually.
*
*/
#define Module_MajorVersion_CMHG 0.20
#define Module_MajorVersion_CMHG 0.21
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 07 Mar 2000
#define Module_Date_CMHG 04 May 2000
#define Module_MajorVersion "0.20"
#define Module_Version 20
#define Module_MajorVersion "0.21"
#define Module_Version 21
#define Module_MinorVersion ""
#define Module_Date "07 Mar 2000"
#define Module_Date "04 May 2000"
#define Module_FullVersion "0.20"
#define Module_FullVersion "0.21"
......@@ -34,6 +34,7 @@
#include "os.h"
#include "string32.h"
#include "messages.h"
#include "objmodule.h"
#include "objects.toolbox.h"
#include "objects.colourmenu.h"
......@@ -69,15 +70,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 *ColourMenu_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,25 +101,18 @@ extern _kernel_oserror *ColourMenu_finalise (int fatal, int podule, void *pw)
* ... and deregister from ResourceFS
*/
regs.r[0] = messages_file();
_kernel_swi (ResourceFS_DeregisterFiles, &regs, &regs);
objmodule_deregister_resources(messages_file());
#endif
/* hide menus before deletion */
if (global_menu.flags & GLOBAL_MENU_INFO_FLAGS_IS_SHOWING) {
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] = ColourMenu_ObjectClass;
_kernel_swi(Toolbox_DeRegisterObjectModule, &regs, &regs);
objmodule_deregister(0, ColourMenu_ObjectClass);
/*
* free up memory we may have left allocated
......@@ -139,23 +130,17 @@ extern _kernel_oserror *ColourMenu_finalise (int fatal, int podule, void *pw)
/* ++++++++++++++++++++++++++++++++ initialisation code +++++++++++++++++++++++++++++++ */
extern _kernel_oserror *ColourMenu_init(char *cmd_tail, int podule_base, void *pw)
{
char *messages_filename;
_kernel_swi_regs regs;
_kernel_oserror *e;
int buffer_size;
#ifndef ROM
extern int messages_file(void);
#endif
IGNORE(cmd_tail);
IGNORE(podule_base);
IGNORE(pw);
#ifdef ROM
__ROM = _swix(0xa2c43, _IN(0), pw);
__ROM = _swix(0x82c43, _IN(0), pw);
#endif
DEBUG debug_set_var_name("ColourMenu$Debug");
......@@ -167,19 +152,15 @@ extern _kernel_oserror *ColourMenu_init(char *cmd_tail, int podule_base, void *p
*/
#ifndef ROM
regs.r[0] = messages_file();
if ((e = _kernel_swi (ResourceFS_RegisterFiles, &regs, &regs)) != NULL)
if ((e = _swix(ResourceFS_RegisterFiles, _IN(0), messages_file())) != NULL)
return e;
#endif
if (getenv ("ColourMenu$Path") == NULL)
messages_filename = "Resources:$.Resources.ColourMenu.Messages";
else
messages_filename = "ColourMenu:Messages";
objmodule_ensure_path("ColourMenu$Path", "Resources:$.Resources.ColourMenu.");
DEBUG debug_output ("M","ColourMenu: Opening main message file\n");
if ((e = messages_file_open (messages_filename)) != NULL)
if ((e = messages_file_open ("ColourMenu:Messages")) != NULL)
return e;
if ((e = messages_file_lookup ("Help", 0, &buffer_size, 0)) != NULL)
......@@ -203,16 +184,7 @@ extern _kernel_oserror *ColourMenu_init(char *cmd_tail, int podule_base, void *p
DEBUG debug_output ("M","ColourMenu: buffer_size is %d (0x%x), title is '%s'\n",buffer_size, (int) &buffer_size, global_title);
/* register with the Toolbox as an Object Module */
regs.r[0] = 0;
regs.r[1] = ColourMenu_ObjectClass;
regs.r[2] = ColourMenu_ClassSWI;
regs.r[3] = 0;
if ((e = _kernel_swi(Toolbox_RegisterObjectModule, &regs, &regs)) != NULL)
return e;
return NULL;
return objmodule_register_with_toolbox(0, ColourMenu_ObjectClass, ColourMenu_ClassSWI, 0);
}
......@@ -222,9 +194,7 @@ extern _kernel_oserror *ColourMenu_init(char *cmd_tail, int podule_base, void *p
extern void ColourMenu_services(int service_number, _kernel_swi_regs *r, void *pw)
{
_kernel_swi_regs regs;
IGNORE(pw);
(void) pw;
switch (service_number)
{
......@@ -252,13 +222,7 @@ extern void ColourMenu_services(int service_number, _kernel_swi_regs *r, void *p
/*
* register with the Toolbox as an Object Module
*/
regs.r[0] = 0;
regs.r[1] = ColourMenu_ObjectClass;
regs.r[2] = ColourMenu_ClassSWI;
regs.r[3] = 0;
_kernel_swi (Toolbox_RegisterObjectModule, &regs, &regs);
objmodule_register_with_toolbox(0, ColourMenu_ObjectClass, ColourMenu_ClassSWI, 0);
break;
default:
......@@ -278,9 +242,9 @@ extern _kernel_oserror *ColourMenu_SWI_handler(int swi_no, _kernel_swi_regs *r,
DEBUG debug_output ("M","ColourMenu: SWI no. 0x%x\n",swi_no + ColourMenu_SWIChunkBase);
switch (swi_no + ColourMenu_SWIChunkBase)
switch (swi_no)
{
case ColourMenu_ClassSWI:
case ColourMenu_ClassSWI - ColourMenu_SWIChunkBase:
if (r->r[0] < 0 || r->r[0] >= MAX_CLASS_SWI_METHODS)
{
return make_error_hex(ColourMenu_NoSuchMethod,1,r->r[0]);
......@@ -298,11 +262,11 @@ extern _kernel_oserror *ColourMenu_SWI_handler(int swi_no, _kernel_swi_regs *r,
}
break;
case ColourMenu_PostFilter:
case ColourMenu_PostFilter - ColourMenu_SWIChunkBase:
e = events_postfilter (r);
break;
case ColourMenu_PreFilter:
case ColourMenu_PreFilter - ColourMenu_SWIChunkBase:
e = events_prefilter (r);
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