Commit 840bde5a 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 1.10. Tagged as 'DCS-1_10'
parent 1d151240
......@@ -13,5 +13,5 @@
| limitations under the License.
|
Dir <Obey$Dir>
amu_machine clean
amu_machine clean COMPONENT=DCS
stripdepnd Makefile
......@@ -13,4 +13,4 @@
| limitations under the License.
|
Dir <Obey$Dir>
amu_machine all
amu_machine all THROWBACK=-throwback COMPONENT=DCS
......@@ -13,4 +13,4 @@
| limitations under the License.
|
Dir <Obey$Dir>
amu_machine rom
amu_machine rom COMPONENT=DCS
| 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=DCS
......@@ -12,154 +12,45 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Makefile for DCS
# 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 = DCS
ROM_MODULE = aof.${COMPONENT}
RAM_MODULE = rm.${COMPONENT}
#
# Export Paths for Messages module
#
RESDIR = <resource$dir>.Resources2
#
# Generic options:
#
MKDIR = cdir
CC = cc
CMHG = cmhg
CP = copy
LD = link
TLD = tlink
MODSQZ = modsqz
RM = remove
WIPE = -wipe
CPFLAGS = ~cfr~v
WFLAGS = ~c~v
CFLAGS = -c -depend !Depend ${INCLUDES} -zM -ffa -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
RAMRESOURCES = o.msgs
OBJS =\
o.ModNoDebug\
o.create\
o.delete\
o.events\
o.getstate\
o.hide\
o.main\
o.miscop\
o.show\
o.task
COMMON_OBJ = o.Modhdr_NoD o.create o.delete o.events o.getstate\
o.hide o.miscop o.show o.task
RAM_OBJS =\
o.ModNoDebug\
o.create\
o.delete\
o.events\
o.getstate\
o.hide\
o.mainRAM\
o.miscop\
o.show\
o.task
ROM_OBJS = o.mainROM ${COMMON_OBJ}
DCSRESF=o.res_dcs
DCSMESS=o.msgs_dcs
QUITRESF=o.res_quit
QUITMESS=o.msgs_quit
ALLRESOURCES=${DCSRESF} ${DCSMESS} ${QUITRESF} ${QUITMESS}
RAM_OBJS = o.main ${RAMRESOURCES} ${COMMON_OBJ}
DBG_OBJS = od.main ${RAMRESOURCES} o.Modhdr 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}.DCS.Messages Resources.${LOCALE}.DCS.Res Resources.${LOCALE}.Quit.Messages Resources.${LOCALE}.Quit.Res
resources: LocalRes:DCS.Messages LocalREs:DCS.Res LocalRes:Quit.Messages LocalRes:Quit.Res
${CP} Resources.${LOCALE}.* ${RESDIR}.* ${CPFLAGS}
@echo ${COMPONENT}: resource files copied to Messages module
clean:
${WIPE} o.* ${WFLAGS}
${WIPE} aof ${WFLAGS}
${WIPE} rm ${WFLAGS}
${WIPE} linked ${WFLAGS}
${WIPE} map ${WFLAGS}
@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
${DCSRESF}: @.Resources.${LOCALE}.DCS.Res
resgen dcsres_file ${DCSRESF} Resources.${LOCALE}.DCS.Res Resources.DCS.Res
${DCSMESS}: @.Resources.${LOCALE}.DCS.Messages
resgen dcsmess_file ${DCSMESS} Resources.${LOCALE}.DCS.Messages Resources.DCS.Messages
${QUITRESF}: @.Resources.${LOCALE}.Quit.Res
resgen quitres_file ${QUITRESF} Resources.${LOCALE}.Quit.Res Resources.Quit.Res
${QUITMESS}: @.Resources.${LOCALE}.Quit.Messages
resgen quitmess_file ${QUITMESS} Resources.${LOCALE}.Quit.Messages Resources.Quit.Messages
${RAM_MODULE}: ${RAM_OBJS} ${TBOXLIB} ${ALLRESOURCES} ${CLIB}
${mkdir} rm
${LD} -o $@ -module ${RAM_OBJS} ${TBOXLIB} ${ALLRESOURCES} ${CLIB}
${MODSQZ} $@
Access $@ RW/R
o.mainRAM: main.c
$(CC) ${CFLAGS} -o $@ main.c
${RAMRESOURCES}: LocalRes:DCS.Messages LocalRes:DCS.Res LocalRes:Quit.Messages LocalRes:Quit.Res
resgen res_files $@ \
LocalRes:DCS.Res Resources.DCS.Res \
LocalRes:DCS.Messages Resources.DCS.Messages \
LocalRes:Quit.Res Resources.Quit.Res \
LocalRes:Quit.Messages Resources.Quit.Messages
clean: toolbox-clean
@echo ${COMPONENT}: cleaned
#---------------------------------------------------------------------------
# Dynamic dependencies:
/* (1.09)
/* (1.10)
*
* This file is automatically maintained by srccommit, do not edit manually.
*
*/
#define Module_MajorVersion_CMHG 1.09
#define Module_MajorVersion_CMHG 1.10
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 07 Mar 2000
#define Module_Date_CMHG 04 May 2000
#define Module_MajorVersion "1.09"
#define Module_Version 109
#define Module_MajorVersion "1.10"
#define Module_Version 110
#define Module_MinorVersion ""
#define Module_Date "07 Mar 2000"
#define Module_Date "04 May 2000"
#define Module_FullVersion "1.09"
#define Module_FullVersion "1.10"
......@@ -31,6 +31,7 @@
#include "debug.h"
#include "mem.h"
#include "messages.h"
#include "objmodule.h"
#include "rmensure.h"
#include "objects.toolbox.h"
......@@ -68,20 +69,12 @@ static _kernel_oserror *(*class_swi_methods [MAX_CLASS_SWI_METHODS])(_kernel_swi
#ifdef ROM
static _kernel_oserror *__ROM;
#else
extern int res_files(void);
#endif
extern _kernel_oserror *DCS_final (int fatal, int podule, void *pw)
{
_kernel_swi_regs regs;
_kernel_oserror *e;
#ifndef ROM
extern int dcsmess_file(void);
extern int dcsres_file(void);
extern int quitmess_file(void);
extern int quitres_file(void);
#endif
IGNORE(fatal);
IGNORE(podule);
IGNORE(pw);
......@@ -92,7 +85,7 @@ extern _kernel_oserror *DCS_final (int fatal, int podule, void *pw)
if (task_any_active())
{
e = make_error (DCS_TasksActive, 0);
_kernel_oserror *e = make_error (DCS_TasksActive, 0);
DEBUG debug_output ("finalise", "W:failed to finalise %s\n", e->errmess);
return e;
}
......@@ -109,17 +102,7 @@ extern _kernel_oserror *DCS_final (int fatal, int podule, void *pw)
* ... and deregister from ResourceFS
*/
regs.r[0] = dcsmess_file();
_kernel_swi (ResourceFS_DeregisterFiles, &regs, &regs);
regs.r[0] = dcsres_file();
_kernel_swi (ResourceFS_DeregisterFiles, &regs, &regs);
regs.r[0] = quitmess_file();
_kernel_swi (ResourceFS_DeregisterFiles, &regs, &regs);
regs.r[0] = quitres_file();
_kernel_swi (ResourceFS_DeregisterFiles, &regs, &regs);
objmodule_deregister_resources(res_files());
#endif
......@@ -127,14 +110,8 @@ extern _kernel_oserror *DCS_final (int fatal, int podule, void *pw)
* ... and deregister from Toolbox
*/
regs.r[0] = 0;
regs.r[1] = DCS_ObjectClass;
_kernel_swi (Toolbox_DeRegisterObjectModule, &regs, &regs);
regs.r[0] = 0;
regs.r[1] = Quit_ObjectClass;
_kernel_swi (Toolbox_DeRegisterObjectModule, &regs, &regs);
objmodule_deregister(0, DCS_ObjectClass);
objmodule_deregister(0, Quit_ObjectClass);
/*
* free up memory we may have left allocated
......@@ -152,51 +129,25 @@ extern _kernel_oserror *DCS_final (int fatal, int podule, void *pw)
/* ++++++++++++++++++++++++++++++++ initialisation code +++++++++++++++++++++++++++++++ */
_kernel_oserror *register_with_toolbox(void)
static _kernel_oserror *register_with_toolbox(void)
{
_kernel_swi_regs regs;
char *res_filename;
_kernel_oserror *e;
if (getenv ("DCS$Path") == NULL)
res_filename = "Resources:$.Resources.DCS.Res";
else
res_filename = "DCS:Res";
regs.r[0] = 0;
regs.r[1] = DCS_ObjectClass;
regs.r[2] = DCS_ClassSWI;
regs.r[3] = (int) res_filename;
if ((e = _kernel_swi (Toolbox_RegisterObjectModule, &regs, &regs)) != NULL)
objmodule_ensure_path("DCS$Path", "Resources:$.Resources.DCS.");
if ((e = objmodule_register_with_toolbox(0, DCS_ObjectClass, DCS_ClassSWI, "DCS:Res")) != NULL)
return e;
/* register here with the Toolbox as an Object Module */
DEBUG debug_output ("init", "Registering with Toolbox\n");
if (getenv ("Quit$Path") == NULL)
res_filename = "Resources:$.Resources.Quit.Res";
else
res_filename = "Quit:Res";
regs.r[0] = 0;
regs.r[1] = Quit_ObjectClass;
regs.r[2] = Quit_ClassSWI;
regs.r[3] = (int) res_filename;
return( _kernel_swi (Toolbox_RegisterObjectModule, &regs, &regs));
objmodule_ensure_path("Quit$Path", "Resources:$.Resources.Quit.");
return objmodule_register_with_toolbox(0, Quit_ObjectClass, Quit_ClassSWI, "Quit:Res");
}
extern _kernel_oserror *DCS_init(char *cmd_tail, int podule_base, void *pw)
{
char *messages_filename;
_kernel_oserror *e;
#ifndef ROM
_kernel_swi_regs regs;
extern int dcsmess_file(void);
extern int dcsres_file(void);
extern int quitmess_file(void);
extern int quitres_file(void);
#endif
IGNORE(cmd_tail);
IGNORE(podule_base);
......@@ -217,36 +168,15 @@ extern _kernel_oserror *DCS_init(char *cmd_tail, int podule_base, void *pw)
DEBUG debug_output ("init", "Registering messages files\n");
regs.r[0] = dcsmess_file();
if ((e = _kernel_swi (ResourceFS_RegisterFiles, &regs, &regs)) != NULL)
return e;
regs.r[0] = quitmess_file();
if ((e = _kernel_swi (ResourceFS_RegisterFiles, &regs, &regs)) != NULL)
return e;
DEBUG debug_output ("init", "Registering resource files\n");
regs.r[0] = dcsres_file();
if ((e = _kernel_swi (ResourceFS_RegisterFiles, &regs, &regs)) != NULL)
return e;
regs.r[0] = quitres_file();
if ((e = _kernel_swi (ResourceFS_RegisterFiles, &regs, &regs)) != NULL)
return e;
objmodule_register_resources(res_files());
#endif
/*
* register our messages file with MessageTrans
*/
if (getenv ("DCS$Path") == NULL)
messages_filename = "Resources:$.Resources.DCS.Messages";
else
messages_filename = "DCS:Messages";
if ((e = messages_file_open (messages_filename)) != NULL)
objmodule_ensure_path("DCS$Path", "Resources:$.Resources.DCS.");
if ((e = messages_file_open ("DCS:Messages")) != NULL)
return e;
/* Hmm what the **** do we do about two message files ??? */
......
; 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.
......
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