Commit 8d937699 authored by Ben Avison's avatar Ben Avison
Browse files

Changes to facilitate platform independence.

Detail:
  * Added shell-script make wrapper
  * Uses shared makefile fragments and one master makefile for all variants
  * #includes use CLX path explicitly
  * SWI numbers defined explicitly in s.unsqueeze to avoid dealing with the
    issue of RISC OS paths in GET statements
Admin:
   No functional change, so version not incremented

Tagged as 'squeeze-5_09-2'

Version 5.09. Not tagged
...@@ -13,4 +13,5 @@ ...@@ -13,4 +13,5 @@
| limitations under the License. | limitations under the License.
| |
Dir <Obey$Dir> Dir <Obey$Dir>
amu_machine all THROWBACK=-throwback amu_machine all COMPONENT=squeeze THROWBACK=-throwback
amu_machine all COMPONENT=xpand THROWBACK=-throwback
...@@ -13,5 +13,6 @@ ...@@ -13,5 +13,6 @@
| limitations under the License. | limitations under the License.
| |
Dir <Obey$Dir> Dir <Obey$Dir>
amu_machine clean amu_machine clean COMPONENT=squeeze
StripDepnd Makefile amu_machine clean COMPONENT=xpand
stripdepnd Makefile
...@@ -13,4 +13,6 @@ ...@@ -13,4 +13,6 @@
| limitations under the License. | limitations under the License.
| |
Dir <Obey$Dir> Dir <Obey$Dir>
amu_machine install THROWBACK=-throwback INSTDIR=<install$dir>.Library amu_machine install COMPONENT=squeeze INSTTYPE=tool THROWBACK=-throwback INSTDIR=<Install$Dir>.Library
amu_machine install COMPONENT=squeeze INSTTYPE=app THROWBACK=-throwback INSTDIR=<Install$Dir>.Tools.Tools
amu_machine install COMPONENT=xpand INSTTYPE=tool THROWBACK=-throwback INSTDIR=<Install$Dir>.Library
...@@ -12,109 +12,51 @@ ...@@ -12,109 +12,51 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
# #
# Makefile for squeeze & xpand # Makefile for squeeze (a.k.a. armsqueeze) and xpand
#
# *********************************** COMPONENT ?= squeeze
# *** C h a n g e L i s t *** INSTAPP = ${INSTDIR}${SEP}!Squeeze
# ***********************************
# Date Name Description ifneq (xpand,${COMPONENT})
# ---- ---- ----------- OBJS = squeeze unsqueeze1 unsqrm1
# 01-Mar-01 SNB Created else
# OBJS = xpand asmcall
endif
# LIBS = ${CLXLIB}
# Paths CDEFINES = -DDEBUGGING=0
# INSTALLAPPFILES = !Boot !Help !Run !Setup !Sprites [!Sprites11] !Sprites22 Desc Messages Templates
COMPONENT = squeeze CLEAN_DEPEND = extra_clean
TARGET = squeeze
TARGET2 = xpand include StdTools
include StdRules
CFLAGS = -Wpc -ffah -IC:CLX -DDDE -DDEBUGGING=0 include DbgRules
DIRS = o._dirs include AppLibs
include CApp
INSTAPP = ${INSTDIR}.!Squeeze
unsqueeze1.h unsqueeze1.c: unsqueeze.o
# aoftoc unsqueeze.o $*
# Program specific options:
# unsqrm1.h unsqrm1.c: unsqrm.o
OBJS = squeeze.o unsqueeze.o unsqrm.o aoftoc unsqrm.o $*
XPANDOBJS = xpand.o asmcall.o
LIBS = ${CLXLIB} ${CLIB} unsqueeze.o: unsqueeze.s
${AOFASM} -o $@ unsqueeze.s
include Makefiles:StdTools
include Makefiles:AppLibs unsqrm.o: unsqrm.s
include Makefiles:AppStdRule ${AOFASM} -o $@ unsqrm.s
# extra_clean:
# build a the library: ${RM} h.unsqueeze1
# ${RM} c.unsqueeze1
all: ${TARGET} ${TARGET2} ${RM} h.unsqrm1
${RM} c.unsqrm1
#
# RISC OS ROM build rules: o.unsqueeze1: c.unsqueeze1
# ${CC} ${CFLAGS} -o $@ c.unsqueeze1
rom: o.unsqrm1: c.unsqrm1
@echo ${COMPONENT}: rom module built ${CC} ${CFLAGS} -o $@ c.unsqrm1
export: export_${PHASE} # Static dependencies:
squeeze.o o.squeeze: unsqueeze1.h unsqrm1.h
install_rom:
@echo ${COMPONENT}: rom module installed
install: install_${INSTTYPE}
install_tool_squeeze: ${TARGET}
${MKDIR} ${INSTDIR}
${CP} ${TARGET} ${INSTDIR}.${TARGET} ${CPFLAGS}
@echo ${COMPONENT}: tool installed in library
install_tool_xpand: ${TARGET2}
${MKDIR} ${INSTDIR}
${CP} ${TARGET2} ${INSTDIR}.${TARGET2} ${CPFLAGS}
@echo ${COMPONENT}: xpand installed in library
install_app:
${MKDIR} ${INSTAPP}
${CP} LocalRes:!Boot ${INSTAPP}.!Boot ${CPFLAGS}
${CP} LocalRes:!Run ${INSTAPP}.!Run ${CPFLAGS}
${CP} LocalRes:!Help ${INSTAPP}.!Help ${CPFLAGS}
${CP} LocalRes:!Setup ${INSTAPP}.!Setup ${CPFLAGS}
${CP} LocalUserIFRes:!Sprites ${INSTAPP}.!Sprites ${CPFLAGS}
IfThere LocalUserIFRes:!Sprites11 then ${CP} LocalUserIFRes:!Sprites11 ${INSTAPP}.!Sprites11 ${CPFLAGS}
${CP} LocalUserIFRes:!Sprites22 ${INSTAPP}.!Sprites22 ${CPFLAGS}
${CP} LocalRes:Messages ${INSTAPP}.Messages ${CPFLAGS}
${CP} LocalRes:Templates ${INSTAPP}.Templates ${CPFLAGS}
${CC} -C++ -E >${INSTAPP}.Desc LocalRes:Desc
${TIDYDESC} ${INSTAPP}.Desc ${INSTAPP}.Desc
@echo ${COMPONENT}: FrontEnd app install in '${INSTAPP}'
clean:
${WIPE} o ${WFLAGS}
${RM} ${TARGET}
${RM} ${TARGET2}
@echo ${COMPONENT}: cleaned
export_hdrs:
@echo ${COMPONENT}: export complete (hdrs)
export_libs:
@echo ${COMPONENT}: export complete (libs)
${DIRS}:
${MKDIR} o
${TOUCH} $@
#
# Final link
#
${TARGET}: ${OBJS} ${LIBS} ${DIRS}
${LD} ${LDFLAGS} -o $@ ${OBJS} ${LIBS}
${SQZ} ${SQZFLAGS} $@
${CHMOD} a+rx $@
${TARGET2}: ${XPANDOBJS} ${LIBS} ${DIRS}
${LD} ${LDFLAGS} -o $@ ${XPANDOBJS} ${LIBS}
${SQZ} ${SQZFLAGS} $@
${CHMOD} a+rx $@
# Dynamic dependencies: # Dynamic dependencies:
/* (5.09) /* (5.09)
* *
* This file is automatically maintained by srccommit, do not edit manually. * This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.68. * Last processed by srccommit version: 1.1.
* *
*/ */
#define Module_MajorVersion_CMHG 5.09 #define Module_MajorVersion_CMHG 5.09
#define Module_MinorVersion_CMHG #define Module_MinorVersion_CMHG
#define Module_Date_CMHG 05 Apr 2004 #define Module_Date_CMHG 19 May 2010
#define Module_MajorVersion "5.09" #define Module_MajorVersion "5.09"
#define Module_Version 509 #define Module_Version 509
#define Module_MinorVersion "" #define Module_MinorVersion ""
#define Module_Date "05 Apr 2004" #define Module_Date "19 May 2010"
#define Module_ApplicationDate "05-Apr-04" #define Module_ApplicationDate "19-May-10"
#define Module_ComponentName "squeeze" #define Module_ComponentName "squeeze"
#define Module_ComponentPath "RiscOS/Tools/Sources/squeeze" #define Module_ComponentPath "castle/RiscOS/Tools/Sources/squeeze"
#define Module_FullVersion "5.09" #define Module_FullVersion "5.09"
#define Module_HelpVersion "5.09 (05 Apr 2004)" #define Module_HelpVersion "5.09 (19 May 2010)"
#define Module_LibraryVersionInfo "5:9" #define Module_LibraryVersionInfo "5:9"
...@@ -38,8 +38,8 @@ ...@@ -38,8 +38,8 @@
#include <time.h> #include <time.h>
#include <signal.h> #include <signal.h>
#ifdef __riscos #ifdef __riscos
#include "kernel.h" #include "CLib/kernel.h"
#include "swis.h" #include "CLib/swis.h"
#else #else
typedef struct { typedef struct {
int load, exec; /* load, exec addresses */ int load, exec; /* load, exec addresses */
...@@ -47,10 +47,10 @@ typedef struct { ...@@ -47,10 +47,10 @@ typedef struct {
} _kernel_osfile_block; } _kernel_osfile_block;
#endif #endif
#include "err.h" #include "CLX/err.h"
#include "host.h" #include "CLX/host.h"
#include "hash.h" #include "CLX/hash.h"
#include "wholefls.h" #include "CLX/wholefls.h"
#ifndef __riscos #ifndef __riscos
#include <limits.h> #include <limits.h>
...@@ -91,7 +91,7 @@ typedef struct { ...@@ -91,7 +91,7 @@ typedef struct {
#include "squeeze.h" #include "squeeze.h"
#ifndef __riscos #if 1
#include "unsqueeze1.h" #include "unsqueeze1.h"
#include "unsqrm1.h" #include "unsqrm1.h"
#else #else
......
...@@ -29,11 +29,11 @@ ...@@ -29,11 +29,11 @@
#include <string.h> #include <string.h>
#include <ctype.h> #include <ctype.h>
#include "wholefls.h" #include "CLX/wholefls.h"
#ifdef __riscos #ifdef __riscos
#include "kernel.h" #include "CLib/kernel.h"
#include "swis.h" #include "CLib/swis.h"
#else #else
typedef struct { typedef struct {
int load, exec; /* load, exec addresses */ int load, exec; /* load, exec addresses */
......
# Copyright 1999 Element 14 Ltd
#
# 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.
#
# Note CLXPATH should be set in the environment
#CLXPATH=/usr/local/riscos/clx
CLX=${CLXPATH}/clx.a
CFLAGS=-DDEBUGGING=0 -c -O -I${CLXPATH} ${CFL}
CC=gcc
AS=armasm
SQ_OBJS=squeeze.o unsqueeze1.o unsqrm1.o
XP_OBJS=xpand.o asmcall1.o
DERIVED= unsqueeze1.c unsqrm1.c unsqueeze1.h unsqrm1.h asmcall1.c asmcall1.h
DERIVED_SRC= unsqueeze.o unsqrm.o asmcall.o
EXTDIR1=${CLXPATH}
EXTLIB1=${CLX}
all: armsqueeze armxpand
@echo "Made armsqueeze (the default target)"
# Dependencies
asmcall1.h asmcall1.c: asmcall.o
aoftoc asmcall.o asmcall1
unsqueeze1.h unsqueeze1.c: unsqueeze.o
aoftoc unsqueeze.o unsqueeze1
unsqrm1.h unsqrm1.c: unsqrm.o
aoftoc unsqrm.o unsqrm1
armsqueeze: $(SQ_OBJS) $(EXTLIB1) derived
$(CC) -o armsqueeze ${SQ_OBJS} $(EXTLIB1)
@echo "Made armsqueeze"
armxpand: $(XP_OBJS) $(DERIVED) $(EXTLIB1)
$(CC) -o armxpand ${XP_OBJS} $(EXTLIB1)
@echo "Made armxpand"
clean:
-rm ${SQ_OBJS} ${XP_OBJS}
-rm armsqueeze armxpand
-rm $(DERIVED)
-rm $(DERIVED_SRC)
@echo cleaned squeeze
realclean: clean
-find . -type l -print | xargs rm
@echo cleaned squeeze links
derived: ${DERIVED}
@echo Made derived files
links:
./mklinks
@echo made squeeze links
install: armsqueeze
cp -p armsqueeze ${RISCOS_BUILD_TOOLS}
# cp -p armxpand ${RISCOS_BUILD_TOOLS}
@echo "Installed xpand and squeeze"
#!/usr/local/bin/bash
# usage: wantlink source dest
wantlink()
{
ext=$1
file=$2
source="../$ext/$file";
dest="$file.$ext";
if [ ! -L $dest ];
then
echo ln -s $source $dest
ln -s $source $dest
fi
}
if [ ! -L "VersionNum" ]; then
echo ln -s ../VersionNum .
ln -s ../VersionNum .
fi
wantlink c squeeze
wantlink c xpand
wantlink h squeeze
wantlink s asmcall
wantlink s unsqrm
wantlink s unsqueeze
#!/bin/bash
# A script to simplify building a single component.
# Syntax: mk.sh [target] [environment]
# For more flexibility, use make directly.
TARGET=all
[[ "$1" =~ (all|install|debug|clean|links) ]] && TARGET=$1 && shift
[ -z "$1" ] || BUILD=$1 && shift
[ -n "$BUILD" ] || BUILD=ROOL/CTools
cd $(dirname $0)
# Two ways of doing the same thing
if [ -n "$BUILDUSINGSUBSHELL" ]; then
HERE=`pwd`
cd ../../..
if [ $TARGET == "install" ]; then
Env/$BUILD.sh "cd $HERE && make install COMPONENT=squeeze INSTTYPE=tool INSTDIR=$INSTALLDIR/Library -I\$MAKEFILEDIR --no-print-directory"
Env/$BUILD.sh "cd $HERE && make install COMPONENT=squeeze INSTTYPE=app INSTDIR=$INSTALLDIR/Tools/Tools -I\$MAKEFILEDIR --no-print-directory"
Env/$BUILD.sh "cd $HERE && make install COMPONENT=xpand INSTTYPE=tool INSTDIR=$INSTALLDIR/Library -I\$MAKEFILEDIR --no-print-directory"
else
Env/$BUILD.sh "cd $HERE && make $TARGET COMPONENT=squeeze -I\$MAKEFILEDIR --no-print-directory"
Env/$BUILD.sh "cd $HERE && make $TARGET COMPONENT=xpand -I\$MAKEFILEDIR --no-print-directory"
fi
else
pushd ../../.. > /dev/null
source Env/$BUILD.sh
popd > /dev/null
if [ $TARGET == "install" ]; then
make install COMPONENT=squeeze INSTTYPE=tool INSTDIR=$INSTALLDIR/Library -I$MAKEFILEDIR --no-print-directory
make install COMPONENT=squeeze INSTTYPE=app INSTDIR=$INSTALLDIR/Tools/Tools -I$MAKEFILEDIR --no-print-directory
make install COMPONENT=xpand INSTTYPE=tool INSTDIR=$INSTALLDIR/Library -I$MAKEFILEDIR --no-print-directory
else
make $TARGET COMPONENT=squeeze -I$MAKEFILEDIR --no-print-directory
make $TARGET COMPONENT=xpand -I$MAKEFILEDIR --no-print-directory
fi
fi
...@@ -72,10 +72,14 @@ sizeToMove * 20 ...@@ -72,10 +72,14 @@ sizeToMove * 20
expand_memcheck SETL {TRUE} expand_memcheck SETL {TRUE}
[ expand_memcheck [ expand_memcheck
GET hdr:ListOpts ; GET hdr:ListOpts
GET hdr:Macros ; GET hdr:Macros
GET hdr:System ; GET hdr:System
GET hdr:MsgTrans ; GET hdr:MsgTrans
OS_GetEnv EQU &10
OS_GenerateError EQU &2b
XOS_SynchroniseCodeAreas EQU &2006e
XMessageTrans_ErrorLookup EQU &61506
] ]
; Constants defining partition of nibble value space: these must match ; Constants defining partition of nibble value space: these must match
......
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