Commit e84678a0 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
Admin:
   No functional change, so version not incremented

Tagged as 'unmodsqz-0_04-2'

Version 0.04. Not tagged
parent 2a32e36a
......@@ -13,4 +13,5 @@
| limitations under the License.
|
Dir <Obey$Dir>
amu_machine install THROWBACK=-throwback INSTDIR=<Install$Dir>.Library
amu_machine install INSTTYPE=tool THROWBACK=-throwback INSTDIR=<Install$Dir>.Library
amu_machine install INSTTYPE=app THROWBACK=-throwback INSTDIR=<Install$Dir>.Tools.Tools
# Copyright 1998 Acorn Computers 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.
#
# Makefile for unmodsqz
#
# ***********************************
# *** C h a n g e L i s t ***
# ***********************************
# Date Name Description
# ---- ---- -----------
# 01-Mar-01 SNB Created
#
#
# Paths
#
COMPONENT = unmodsqz
TARGET = unmodsqz
COMPONENT ?= unmodsqz
INSTAPP = ${INSTDIR}${SEP}!UnModSqz
CFLAGS = -Wpc -ffah -IC:CLX -DTARGET_IS_RISCOS
DIRS = o._dirs
OBJS = unsqueezec unmodsqz
LIBS = ${CLXLIB}
INSTALLAPPFILES = !Boot !Help !Run !Sprites [!Sprites11] !Sprites22 Desc Messages Templates
INSTAPP = ${INSTDIR}.!UnModSqz
#
# Program specific options:
#
OBJS = unsqueezec.o unmodsqz.o
LIBS = ${CLXLIB} ${CLIB}
include Makefiles:StdTools
include Makefiles:AppLibs
include Makefiles:AppStdRule
#
# build a the library:
#
all: ${TARGET}
#
# RISC OS ROM build rules:
#
rom:
@echo ${COMPONENT}: rom module built
export: export_${PHASE}
install_rom:
@echo ${COMPONENT}: rom module installed
install: install_${INSTTYPE}
install_tool: ${TARGET}
${MKDIR} ${INSTDIR}
${CP} ${TARGET} ${INSTDIR}.${TARGET} ${CPFLAGS}
@echo ${COMPONENT}: tool 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} 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} ${COMPONENT}
@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 ${COMPONENT} ${OBJS} ${LIBS}
${SQZ} ${SQZFLAGS} $@
${CHMOD} a+rx $@
include StdTools
include StdRules
include DbgRules
include AppLibs
include CApp
# Dynamic dependencies:
/* (0.04)
*
* This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.1.
*
*/
#define Module_MajorVersion_CMHG 0.04
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 20 Mar 2001
#define Module_Date_CMHG 19 May 2010
#define Module_MajorVersion "0.04"
#define Module_Version 4
#define Module_MinorVersion ""
#define Module_Date "20 Mar 2001"
#define Module_Date "19 May 2010"
#define Module_ApplicationDate2 "20-Mar-01"
#define Module_ApplicationDate4 "20-Mar-2001"
#define Module_ApplicationDate "19-May-10"
#define Module_ComponentName "unmodsqz"
#define Module_ComponentPath "RiscOS/Tools/Sources/unmodsqz"
#define Module_ComponentPath "castle/RiscOS/Tools/Sources/unmodsqz"
#define Module_FullVersion "0.04"
#define Module_HelpVersion "0.04 (20 Mar 2001)"
#define Module_HelpVersion "0.04 (19 May 2010)"
#define Module_LibraryVersionInfo "0:4"
......@@ -22,12 +22,16 @@
#include <stdlib.h>
#include "VersionNum"
#include "bytesex.h"
#include "err.h"
#include "prgname.h"
#include "wholefls.h"
#include "CLX/bytesex.h"
#include "CLX/err.h"
#include "CLX/prgname.h"
#include "CLX/wholefls.h"
#include "unmodsqz.h"
#ifdef __riscos
#define TARGET_IS_RISCOS
#endif
#ifdef TARGET_IS_RISCOS
#include "kernel.h"
#include "swis.h"
......
......@@ -22,7 +22,7 @@
#include <stdlib.h>
#include <stdarg.h>
#include "bytesex.h"
#include "CLX/bytesex.h"
#include "unmodsqz.h"
......
#!/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 INSTTYPE=tool INSTDIR=$INSTALLDIR/Library -I\$MAKEFILEDIR --no-print-directory"
Env/$BUILD.sh "cd $HERE && make install INSTTYPE=app INSTDIR=$INSTALLDIR/Tools/Tools -I\$MAKEFILEDIR --no-print-directory"
else
Env/$BUILD.sh "cd $HERE && make $TARGET -I\$MAKEFILEDIR --no-print-directory"
fi
else
pushd ../../.. > /dev/null
source Env/$BUILD.sh
popd > /dev/null
if [ $TARGET == "install" ]; then
make install INSTTYPE=tool INSTDIR=$INSTALLDIR/Library -I$MAKEFILEDIR --no-print-directory
make install INSTTYPE=app INSTDIR=$INSTALLDIR/Tools/Tools -I$MAKEFILEDIR --no-print-directory
else
make $TARGET -I$MAKEFILEDIR --no-print-directory
fi
fi
# 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.
#
# Makefile for unmodsqz
#
# ***********************************
# *** C h a n g e L i s t ***
# ***********************************
# Date Name Description
# ---- ---- -----------
# 18 Aug 00 SNB Created
#
#
# Paths
#
EXP_HDR = <cexport$dir>
#
# Generic options:
#
AWK = awk
MKDIR = mkdir
CC = gcc
LD = gcc
RM = -rm
WIPE = -rm
CD = cd
TOUCH = touch
STRIP = strip
COMPONENT = unmodsqz
#
# Internet version compatibility
#
DEFINES = ${OPTIONS}
CFLAGS = -c -g ${DEFINES} ${INCLUDES} ${DEPENDS}
WFLAGS = -rf
#
# Libraries
#
CLIB =
#
# Include files
#
INCLUDES = -I${CLXPATH}
#
# Program specific options:
#
TARGET = ${COMPONENT}
OBJS = unsqueezec.o unmodsqz.o
#
# Rule patterns
#
.SUFFIXES: .o .c
.c.o:; ${CC} ${CFLAGS} -o $@ $<
#
# build modsqz
#
all: ${TARGET}
@echo ${COMPONENT}: all complete
clean:
${WIPE} ${WFLAGS} *.o
${RM} ${TARGET}
@echo ${COMPONENT}: cleaned
#
# Target
#
${TARGET}: ${OBJS} ${CLIB}
${LD} -o $@ ${LDFLAGS} ${OBJS} ${CLXPATH}/clx.a ${CLIB}
${STRIP} $@
# Dynamic dependencies:
#!/usr/local/bin/bash
# usage: wantlink source dest
wantlink()
{
dir=$1
ext=$2
file=$3
source="../../$dir/$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 VersionNum
ln -s ../../VersionNum VersionNum
fi
wantlink . c unmodsqz
wantlink . c unsqueezec
wantlink . h unmodsqz
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