Commit 2f274647 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.18. Tagged as 'FileInfo-0_18'
parent cbd2e9ca
......@@ -13,4 +13,5 @@
| limitations under the License.
|
Dir <Obey$Dir>
amu_machine clean
amu_machine clean COMPONENT=FileInfo
stripdepnd Makefile
......@@ -13,4 +13,4 @@
| limitations under the License.
|
Dir <Obey$Dir>
amu_machine all
amu_machine all COMPONENT=FileInfo
......@@ -13,4 +13,4 @@
| limitations under the License.
|
Dir <Obey$Dir>
amu_machine rom
amu_machine rom COMPONENT=FileInfo
| 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=FileInfo
......@@ -12,151 +12,37 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Makefile for FileInfo
# 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 = FileInfo
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
RAMBOTH = o.msgs
CFLAGS = -c -depend !Depend ${INCLUDES} -zM -ffah -zps1 ${DFLAGS}
CMHGFLAGS= -depend !Depend -p
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 ${RAMBOTH} ${COMMON_OBJ}
MSGSF=o.msgs
RESF=o.res
DBG_OBJS = od.main ${RAMBOTH} 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} ${CMHGFLAGS} -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 Resources.${LOCALE}.Res
${MKDIR} ${RESDIR}
${CP} Resources.${LOCALE}.* ${RESDIR}.* ${CPFLAGS}
resources: resources-both
@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
${MKDIR} map
${LD} -o linked.${COMPONENT} -bin -base ${ADDRESS} ${ROM_MODULE} ${ABSSYM} \
-map > map.${COMPONENT}
truncate map.${COMPONENT} linked.${COMPONENT}
${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} ${CLIB}
${mkdir} rm
${LD} -o $@ -module ${RAM_OBJS} ${TBOXLIB} ${RESF} ${MSGSF} ${CLIB}
Access $@ RW/R
o.mainRAM: main.c
$(CC) ${CFLAGS} -o $@ main.c
#---------------------------------------------------------------------------
# Dynamic dependencies:
/* (0.17)
/* (0.18)
*
* This file is automatically maintained by srccommit, do not edit manually.
*
*/
#define Module_MajorVersion_CMHG 0.17
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 14 Jul 1998
#define Module_MajorVersion_CMHG 0.18
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 04 May 2000
#define Module_MajorVersion "0.17"
#define Module_Version 17
#define Module_MinorVersion ""
#define Module_Date "14 Jul 1998"
#define Module_MajorVersion "0.18"
#define Module_Version 18
#define Module_MinorVersion ""
#define Module_Date "04 May 2000"
#define Module_FullVersion "0.18"
......@@ -32,6 +32,7 @@
#include "debug.h"
#include "mem.h"
#include "messages.h"
#include "objmodule.h"
#include "objects.toolbox.h"
#include "objects.fileinfo.h"
......@@ -69,16 +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 *FileInfo_finalise (int fatal, int podule, void *pw)
{
_kernel_swi_regs regs;
#ifndef ROM
extern int messages_file(void);
extern int res_file(void);
#endif
IGNORE(fatal);
IGNORE(podule);
IGNORE(pw);
......@@ -101,20 +98,11 @@ extern _kernel_oserror *FileInfo_finalise (int fatal, int podule, void *pw)
/*
* ... and deregister from ResourceFS
*/
regs.r[0] = messages_file();
_kernel_swi (ResourceFS_DeregisterFiles, &regs, &regs);
regs.r[0] = res_file();
_kernel_swi (ResourceFS_DeregisterFiles, &regs, &regs);
objmodule_deregister_resources(messages_file());
#endif
/* deregister object module */
regs.r[0] = 0;
regs.r[1] = FileInfo_ObjectClass;
_kernel_swi(Toolbox_DeRegisterObjectModule, &regs, &regs);
/* deregister object module */
objmodule_deregister(0, FileInfo_ObjectClass);
/*
* free up memory we may have left allocated
......@@ -126,7 +114,7 @@ extern _kernel_oserror *FileInfo_finalise (int fatal, int podule, void *pw)
mem_free_all ();
#ifdef ROM
if(!__ROM) _swix(0xa2c41, 0);
if(!__ROM) _swix(0x82c41, 0);
#endif
return NULL;
......@@ -138,22 +126,15 @@ extern _kernel_oserror *FileInfo_finalise (int fatal, int podule, void *pw)
extern _kernel_oserror *FileInfo_init(char *cmd_tail, int podule_base, void *pw)
{
char *filename;
_kernel_swi_regs regs;
_kernel_oserror *e;
int buffer_size;
#ifndef ROM
extern int messages_file(void);
extern int res_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("FileInfo$Debug");
......@@ -166,26 +147,15 @@ extern _kernel_oserror *FileInfo_init(char *cmd_tail, int podule_base, void *pw)
#ifndef ROM
DEBUG debug_output ("M","FileInfo: registering messages file\n");
regs.r[0] = messages_file();
if ((e = _kernel_swi (ResourceFS_RegisterFiles, &regs, &regs)) != NULL)
return e;
DEBUG debug_output ("M","FileInfo: registering resource file\n");
regs.r[0] = res_file();
if ((e = _kernel_swi (ResourceFS_RegisterFiles, &regs, &regs)) != NULL)
return e;
if ((e = objmodule_register_resources(messages_file())) != NULL)
return e;
#endif
if (getenv ("FileInfo$Path") == NULL)
filename = "Resources:$.Resources.FileInfo.Messages";
else
filename = "FileInfo:Messages";
objmodule_ensure_path("FileInfo$Path", "Resources:$.Resources.FileInfo.");
DEBUG debug_output ("M","FileInfo: opening messages file\n");
if ((e = messages_file_open (filename)) != NULL)
if ((e = messages_file_open ("FileInfo:Messages")) != NULL)
return e;
buffer_size = 0;
......@@ -233,26 +203,8 @@ extern _kernel_oserror *FileInfo_init(char *cmd_tail, int podule_base, void *pw)
DEBUG debug_output ("M","FileInfo: looking up 'NO' (end)\n");
/* open the fileinfo template file */
if (getenv ("FileInfo$Path") == NULL)
filename = "Resources:$.Resources.FileInfo.Res";
else
filename = "FileInfo:Res";
DEBUG debug_output ("M","FileInfo: registering ...\n");
/* register here with the Toolbox as an Object Module */
regs.r[0] = 0;
regs.r[1] = FileInfo_ObjectClass;
regs.r[2] = FileInfo_ClassSWI;
regs.r[3] = (int) filename;
if ((e = _kernel_swi(Toolbox_RegisterObjectModule, &regs, &regs)) != NULL)
return e;
return NULL;
return objmodule_register_with_toolbox(0, FileInfo_ObjectClass, FileInfo_ClassSWI, "FileInfo:Res");
}
/* +++++++++++++++++++++++++++++++++ service handler code ++++++++++++++++++++++++++++++ */
......@@ -260,9 +212,6 @@ extern _kernel_oserror *FileInfo_init(char *cmd_tail, int podule_base, void *pw)
extern void FileInfo_services(int service_number, _kernel_swi_regs *r, void *pw)
{
_kernel_swi_regs regs;
char *filename;
IGNORE(pw);
switch (service_number)
......@@ -292,21 +241,7 @@ extern void FileInfo_services(int service_number, _kernel_swi_regs *r, void *pw)
/*
* register with the Toolbox as an Object Module
*/
/* open the FileInfo template file */
if (getenv ("FileInfo$Path") == NULL)
filename = "Resources:$.Resources.FileInfo.Res";
else
filename = "FileInfo:Res";
/* register here with the Toolbox as an Object Module */
regs.r[0] = 0;
regs.r[1] = FileInfo_ObjectClass;
regs.r[2] = FileInfo_ClassSWI;
regs.r[3] = (int) filename;
_kernel_swi (Toolbox_RegisterObjectModule, &regs, &regs);
objmodule_register_with_toolbox(0, FileInfo_ObjectClass, FileInfo_ClassSWI, "FileInfo:Res");
break;
......@@ -325,9 +260,9 @@ extern _kernel_oserror *FileInfo_SWI_handler(int swi_no, _kernel_swi_regs *r, vo
IGNORE(pw);
switch (swi_no + FileInfo_SWIChunkBase)
switch (swi_no)
{
case FileInfo_ClassSWI:
case FileInfo_ClassSWI - FileInfo_SWIChunkBase:
if (r->r[0] < 0 || r->r[0] >= MAX_CLASS_SWI_METHODS)
{
return make_error_hex(FileInfo_NoSuchMethod,1,r->r[0]);
......@@ -341,16 +276,16 @@ extern _kernel_oserror *FileInfo_SWI_handler(int swi_no, _kernel_swi_regs *r, vo
return make_error_hex(FileInfo_NoSuchTask,1,r->r[3]);
}
e = (*class_swi_methods[r->r[0]])(r, t);
return (*class_swi_methods[r->r[0]])(r, t);
}
break;
case FileInfo_PostFilter:
e = events_postfilter (r);
case FileInfo_PostFilter - FileInfo_SWIChunkBase:
return events_postfilter (r);
break;
case FileInfo_PreFilter:
e = events_prefilter (r);
case FileInfo_PreFilter - FileInfo_SWIChunkBase:
return events_prefilter (r);
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