Commit e747ceeb authored by Robert Sprowson's avatar Robert Sprowson

Makefile recreated from fragments

* Version number inserted into messages at build time so info box is right
* Template 'proginfo' resized to have recommended slab sizes
* Easy warnings fixed up
* Imported sprites for Ursula and Morris4 themes
* Get filetype from central header file
Built, tested briefly in desktop and command line use

Version 0.53. Tagged as 'Squash-0_53'
parent c3340b4f
| Copyright 1996 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.
|
Dir <Obey$Dir>
amu_machine all
......@@ -14,124 +14,40 @@
#
# Makefile for !Squash
#
# ***********************************
# *** C h a n g e L i s t ***
# ***********************************
# Date Name Description
# ---- ---- -----------
# 25-Oct-94 AMcC Updated for Black build
#
#
# Program specific options:
#
COMPONENT = Squash
TARGET = abs.${COMPONENT}
APP = !${COMPONENT}
RDIR = Resources
LDIR = ${RDIR}.${LOCALE}
TARGET = !RunImage
INSTAPP = ${INSTDIR}.${APP}
INSTTYPE = app
MSGVERSION = ${AWK} -f Build:AwkVers
LDIR = Resources.${LOCALE}
APP_OBJS = main.o squash.o debug.o
CDFLAGS = -DDEBUG
LIBS = ${RLIB}
CINCLUDES = -IC:
INSTALLAPPFILES = !Boot !Help !Run !RunImage Templates !Sprites:Themes !Sprites11:Themes !Sprites22:Themes Morris4.!Sprites:Themes.Morris4 Morris4.!Sprites22:Themes.Morris4 Ursula.!Sprites:Themes.Ursula Ursula.!Sprites22:Themes.Ursula
#
# Generic options:
#
MKDIR = do mkdir -p
AS = objasm
CC = cc
CMHG = cmhg
CP = copy
LD = link
RM = remove
SQUEEZE = squeeze
WIPE = x wipe
INSTALLAPP_DEPEND = GenMessage Squash
AFLAGS = ${THROWBACK} -depend !Depend -nocache -stamp -quit
CFLAGS = ${THROWBACK} -c -depend !Depend -fah ${INCLUDES} ${DFLAGS}
CPFLAGS = ~cfr~v
WFLAGS = ~c~v
include CApp
#
# Libraries
#
CLIB = CLIB:o.stubs
RLIB = RISC_OSLib:o.risc_oslib
#
# Include files
#
INCLUDES = -IC:
DFLAGS =
FILES = \
${RDIR}.!Boot\
${LDIR}.!Help\
${LDIR}.!Run\
${LDIR}.!Sprites\
${LDIR}.!Sprites11\
${LDIR}.!Sprites22\
${LDIR}.Messages\
${LDIR}.Templates\
abs.!RunImage\
abs.Squash
OBJS = squash.o main.o debug.o
# Patch the messages files with the version
#
# Rule patterns
#
.c.o:; ${CC} ${CFLAGS} -o $@ $<
#
# Main rules:
#
# Application
#
all: ${FILES}
@echo ${COMPONENT}: Application built (Disc)
install: install_${INSTTYPE}
install_tool: ${TARGET}
${MKDIR} ${INSTDIR}.Docs
${CP} ${TARGET} ${INSTDIR}.${COMPONENT} ${CPFLAGS}
@echo ${COMPONENT}: tool installed in library
install_: ${FILES}
GenMessage: ${LDIR}.Messages VersionNum
${MSGVERSION} ${LDIR}.Messages > GenMessage
${MKDIR} ${INSTAPP}
${CP} ${RDIR}.!Boot ${INSTAPP}.!Boot ${CPFLAGS}
${CP} ${LDIR}.!Help ${INSTAPP}.!Help ${CPFLAGS}
${CP} ${LDIR}.!Run ${INSTAPP}.!Run ${CPFLAGS}
${CP} abs.!RunImage ${INSTAPP}.!RunImage ${CPFLAGS}
${CP} ${LDIR}.!Sprites ${INSTAPP}.!Sprites ${CPFLAGS}
${CP} ${LDIR}.!Sprites11 ${INSTAPP}.!Sprites11 ${CPFLAGS}
${CP} ${LDIR}.!Sprites22 ${INSTAPP}.!Sprites22 ${CPFLAGS}
${CP} ${LDIR}.Messages ${INSTAPP}.Messages ${CPFLAGS}
${CP} abs.Squash ${INSTAPP}.Squash ${CPFLAGS}
${CP} ${LDIR}.Templates ${INSTAPP}.Templates ${CPFLAGS}
Access ${INSTAPP} /r
Access ${INSTAPP}.* r/r
@echo ${COMPONENT}: Application installed (Disc)
clean:
${WIPE} o.* ${WFLAGS}
${RM} abs.!RunImage
${RM} abs.Squash
@echo ${COMPONENT}: cleaned
#
# Static dependencies:
#
abs.!RunImage: ${OBJS} ${RLIB} ${CLIB}
${LD} -o $@ ${OBJS} ${RLIB} ${CLIB}
${SQUEEZE} $@
${CP} GenMessage ${INSTAPP}.Messages ${CPFLAGS}
abs.Squash: util.o
${LD} -o $@ util.o ${CLIB}
${SQUEEZE} $@
Squash: squash.c squash.h
${CC} ${FLAGS} -c -o utility.o -DUTILITY squash.c
${LD} -o Squash utility.o ${CLIB}
${SQZ} ${SQZFLAGS} Squash
${CP} Squash ${INSTAPP}.Squash ${CPFLAGS}
util.o: squash.c squash.h
${CC} ${CFLAGS} -o $@ -DUTILITY squash.c
clean::
${RM} GenMessage
${RM} Squash
#---------------------------------------------------------------------------
# Dynamic dependencies:
Set Squash$Dir <Obey$Dir>
Set Squash$Path <Obey$Dir>.
Iconsprites <Squash$Dir>.!Sprites
Iconsprites <Squash$Dir>.Themes.!Sprites
Set File$Type_FCA Squash
Set Alias$@RunType_FCA "Run <Obey$Dir>.!Run %%*0"
#Messages for !Squash
TaskId:Squash
TaskSprite:!Squash
Version:0.49 (13-Dec-94)
_Version:Auto inserted
#
Squash0:Out of store
Squash1:Invalid Squash header
......
/* (0.52)
/* (0.53)
*
* This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.1.
*
*/
#define Module_MajorVersion_CMHG 0.52
#define Module_MajorVersion_CMHG 0.53
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 14 Jan 2012
#define Module_Date_CMHG 11 May 2013
#define Module_MajorVersion "0.52"
#define Module_Version 52
#define Module_MajorVersion "0.53"
#define Module_Version 53
#define Module_MinorVersion ""
#define Module_Date "14 Jan 2012"
#define Module_Date "11 May 2013"
#define Module_ApplicationDate "14-Jan-12"
#define Module_ApplicationDate "11-May-13"
#define Module_ComponentName "Squash"
#define Module_ComponentPath "castle/RiscOS/Sources/Apps/Squash"
#define Module_FullVersion "0.52"
#define Module_HelpVersion "0.52 (14 Jan 2012)"
#define Module_LibraryVersionInfo "0:52"
#define Module_FullVersion "0.53"
#define Module_HelpVersion "0.53 (11 May 2013)"
#define Module_LibraryVersionInfo "0:53"
......@@ -37,6 +37,7 @@
#include "visdelay.h"
#include "kernel.h"
#include "Global/FileTypes.h"
#include "squash.h"
#include "debug.h"
......@@ -114,9 +115,9 @@ static void program_info(void)
{
dbox d;
#ifdef RISCOS_200
char *version = SQUASH_VERS;
char *version = "(" Module_ApplicationDate ")";
#else
char *version = lookup_message("Version");
char *version = lookup_message("_Version");
#endif
/* Create the dialogue box */
if (d = dbox_new("ProgInfo"), d != NULL) {
......@@ -292,8 +293,8 @@ static BOOL squash_dir(char *nameto, void *handle)
else
copy_object(from, to, 0);
} else {
if ((squash_dirs && ((dirent.load_addr & 0x000fff00) != (SQUASH_TYPE << 8)))
|| (!squash_dirs && ((dirent.load_addr & 0x000fff00) == (SQUASH_TYPE << 8))))
if ((squash_dirs && ((dirent.load_addr & 0x000fff00) != (FileType_Squash << 8)))
|| (!squash_dirs && ((dirent.load_addr & 0x000fff00) == (FileType_Squash << 8))))
squash(to, from);
else
copy_object(from, to, 0);
......@@ -569,8 +570,7 @@ static int my_saveas(int filetype, char *name, int estsize,
return saved;
}
static void
free_all()
static void free_all(void)
{
tracef0("Freeing all pending objects\n");
while (ffirst != flast) {
......@@ -630,7 +630,7 @@ int main(int argc, char **argv) {
if (use_save_box) {
if (blocking) continue;
blocking = 1;
if (ftype[ffirst] == SQUASH_TYPE) {
if (ftype[ffirst] == FileType_Squash) {
squash_header header;
int fhand = open_file(fname[ffirst], OPEN_RO);
if (fhand == -1)
......@@ -642,7 +642,7 @@ int main(int argc, char **argv) {
close_file(fhand);
ftype[ffirst] = (header.load >> 8) & 0xfff;
} else
ftype[ffirst] = SQUASH_TYPE;
ftype[ffirst] = FileType_Squash;
if (my_saveas(ftype[ffirst], fname[ffirst], 0, squash, 0, 0, (void *)fname[ffirst]) == 0)
free_all();
} else {
......
......@@ -26,8 +26,11 @@
#include "kernel.h"
#include "swis.h"
#include "Global/FileTypes.h"
#ifndef UTILITY
#include "visdelay.h"
#else
#include "VersionNum"
#endif
#include "squash.h"
......@@ -83,7 +86,7 @@ char *error[] = {
static void usage(int err)
{
if (err == 0)
fprintf(stderr, "Squash version %s - compress/uncompress files\n\n", SQUASH_VERS);
fprintf(stderr, "Squash (%s) - compress/uncompress files\n\n", Module_ApplicationDate);
fprintf(stderr, "Syntax: Squash <source file> [<destination file>]\n");
exit(err);
}
......@@ -302,7 +305,7 @@ static void set_type(char *fname, int type)
(void)_kernel_swi(OS_File, &r, &r);
}
static char *gen_temp_name()
static char *gen_temp_name(void)
{
char *name = malloc(27);
sprintf(name, "<Wimp$ScrapDir>.sq%08X", time(0));
......@@ -410,7 +413,7 @@ int do_squash(int argc, char **argv)
/* Determine from the filetype whether we are compressing or decompressing. */
file_type = (load_addr & 0x000fff00) >> 8;
do_compress = !(((load_addr & 0xfff00000) == 0xfff00000) && (file_type == SQUASH_TYPE));
do_compress = !(((load_addr & 0xfff00000) == 0xfff00000) && (file_type == FileType_Squash));
/* Open the input file. */
if ((input = open_file(file_from, OPEN_RO)) == -1) {
......@@ -654,7 +657,7 @@ int do_squash(int argc, char **argv)
}
/* Change the file type if compressing. */
if (do_compress)
set_type(file_to, SQUASH_TYPE);
set_type(file_to, FileType_Squash);
tidy_up(0);
return 0;
}
......@@ -21,10 +21,6 @@
#ifndef _squash_h
#define _squash_h
#define SQUASH_VERS "0.49 (13 Dec 94)"
#define SQUASH_TYPE 0x0fca
#define SQUASH_ID "SQSH"
#define out_of_store 0
......
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