Commit c95cca46 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.23. Tagged as 'FontMenu-0_23'
parent 28ec10f3
......@@ -13,5 +13,5 @@
| limitations under the License.
|
Dir <Obey$Dir>
amu_machine clean
amu_machine clean COMPONENT=FontMenu
stripdepnd Makefile
......@@ -13,4 +13,4 @@
| limitations under the License.
|
Dir <Obey$Dir>
amu_machine all
amu_machine all COMPONENT=FontMenu
......@@ -13,4 +13,4 @@
| limitations under the License.
|
Dir <Obey$Dir>
amu_machine rom
amu_machine rom COMPONENT=FontMenu
| 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=FontMenu
......@@ -12,142 +12,37 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Makefile for FontMenu
# 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 = FontMenu
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
WIPE = -wipe
CPFLAGS = ~cfr~v
WFLAGS = ~c~v
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} -depend !Depend -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
${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.22)
/* (0.23)
*
* This file is automatically maintained by srccommit, do not edit manually.
*
*/
#define Module_MajorVersion_CMHG 0.22
#define Module_MajorVersion_CMHG 0.23
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 07 Mar 2000
#define Module_Date_CMHG 04 May 2000
#define Module_MajorVersion "0.22"
#define Module_Version 22
#define Module_MajorVersion "0.23"
#define Module_Version 23
#define Module_MinorVersion ""
#define Module_Date "07 Mar 2000"
#define Module_Date "04 May 2000"
#define Module_FullVersion "0.22"
#define Module_FullVersion "0.23"
......@@ -36,6 +36,7 @@
#include "messages.h"
#include "objects.toolbox.h"
#include "objects.fontmenu.h"
#include "objmodule.h"
#include "object.h"
#include "auxiliary.h"
......@@ -73,14 +74,12 @@ static _kernel_oserror *(*const class_swi_methods [MAX_CLASS_SWI_METHODS])(_kern
#ifdef ROM
static _kernel_oserror *__ROM;
#else
extern int messages_file(void);
#endif
extern _kernel_oserror *FontMenu_finalise (int fatal, int podule, void *pw)
{
#ifndef ROM
extern int messages_file(void);
#endif
IGNORE(fatal);
IGNORE(podule);
IGNORE(pw);
......@@ -107,7 +106,7 @@ extern _kernel_oserror *FontMenu_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 */
......@@ -119,8 +118,7 @@ extern _kernel_oserror *FontMenu_finalise (int fatal, int podule, void *pw)
/* deregister object module */
_swix(Toolbox_DeRegisterObjectModule, _INR(0,1), 0, FontMenu_ObjectClass);
objmodule_deregister(0, FontMenu_ObjectClass);
/*
* free up memory we may have left allocated
*/
......@@ -140,12 +138,8 @@ extern _kernel_oserror *FontMenu_finalise (int fatal, int podule, void *pw)
extern _kernel_oserror *FontMenu_init(char *cmd_tail, int podule_base, void *pw)
{
char *messages_filename;
_kernel_oserror *e;
int buffer_size;
#ifndef ROM
extern int messages_file(void);
#endif
IGNORE(cmd_tail);
IGNORE(podule_base);
......@@ -168,14 +162,10 @@ extern _kernel_oserror *FontMenu_init(char *cmd_tail, int podule_base, void *pw)
return e;
#endif
if (getenv ("FontMenu$Path") == NULL)
messages_filename = "Resources:$.Resources.FontMenu.Messages";
else
messages_filename = "FontMenu:Messages";
objmodule_ensure_path("FontMenu$Path", "Resources:$.Resources.FontMenu.");
DEBUG debug_output ("M","FontMenu: Opening main message file\n");
if ((e = messages_file_open (messages_filename)) != NULL)
if ((e = messages_file_open ("FontMenu:Messages")) != NULL)
return e;
if ((e = messages_file_lookup ("Help", 0, &buffer_size, 0)) != NULL)
......@@ -187,27 +177,8 @@ extern _kernel_oserror *FontMenu_init(char *cmd_tail, int podule_base, void *pw)
if ((e = messages_file_lookup ("Help", global_help_message, &buffer_size, 0)) !=NULL)
return e;
/* regsiter font's message file with MessageTrans */
/*
DEBUG debug_output ("M","FontMenu: Opening fontman message file\n");
regs.r[0] = (int) font_messages_fd;
regs.r[1] = (int) "Resources:$.Resources.Fonts.Messages";
regs.r[2] = 0;
if ((e = _kernel_swi (MessageTrans_OpenFile, &regs, &regs)) != NULL) {
return e;
*/
/* register here with the Toolbox as an Object Module */
if ((e = _swix(Toolbox_RegisterObjectModule, _INR(0,3),
0,
FontMenu_ObjectClass,
FontMenu_ClassSWI,
0
)) != NULL)
return e;
return NULL;
return objmodule_register_with_toolbox(0, FontMenu_ObjectClass, FontMenu_ClassSWI, 0);
}
......@@ -247,12 +218,7 @@ extern void FontMenu_services(int service_number, _kernel_swi_regs *r, void *pw)
* register with the Toolbox as an Object Module
*/
_swix (Toolbox_RegisterObjectModule, _INR(0,3),
0,
FontMenu_ObjectClass,
FontMenu_ClassSWI,
0);
objmodule_register_with_toolbox(0, FontMenu_ObjectClass, FontMenu_ClassSWI, 0);
break;
default:
......
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