Index: apps/plugins/Makefile =================================================================== RCS file: /cvsroot/rockbox/apps/plugins/Makefile,v retrieving revision 1.5 diff -u -r1.5 Makefile --- apps/plugins/Makefile 28 Nov 2003 12:06:47 -0000 1.5 +++ apps/plugins/Makefile 15 Jan 2004 13:46:47 -0000 @@ -20,6 +20,7 @@ SRC := $(wildcard *.c) ROCKS := $(SRC:%.c=$(OBJDIR)/%.rock) +VIEWERS = $(OBJDIR)/viewers.config ifndef OBJDIR no_configure: @@ -35,17 +36,23 @@ $(OBJDIR)/%.rock : $(OBJDIR)/%.elf $(OC) -O binary $< $@ + (out="$(OBJDIR)/"`perl mkviewer.pl -f $(@F)` && $(OC) -O binary $< $$out) $(OBJDIR)/%.o: %.c ../plugin.h Makefile $(CC) $(CFLAGS) -c $< -o $@ -all: $(ROCKS) +all: $(ROCKS) $(VIEWERS) @echo done +$(VIEWERS): $(ROCKS) mkviewer.pl + rm -f $(VIEWERS) + (for i in $(ROCKS); do perl mkviewer.pl -o $$i >> $(VIEWERS); done) + # MEM should be passed on to this makefile with the chosen memory size given # in number of MB $(LINKFILE): $(LDS) $(CC) -DMEMORYSIZE=$(MEM) $(DEFINES) -x c -E -P $< >$@ clean: - -rm -f $(ROCKS) $(LINKFILE) + -rm -f $(ROCKS) $(LINKFILE) $(OBJDIR)/*.rock + Index: apps/plugins/mkviewer.pl =================================================================== RCS file: apps/plugins/mkviewer.pl diff -N apps/plugins/mkviewer.pl --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ apps/plugins/mkviewer.pl 15 Jan 2004 13:46:47 -0000 @@ -0,0 +1,98 @@ +#!/usr/bin/env perl +# __________ __ ___. +# Open \______ \ ____ ____ | | _\_ |__ _______ ___ +# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / +# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < +# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ +# \/ \/ \/ \/ \/ +# $Id: Makefile,v 1.59 2004/01/04 13:30:16 bagder Exp $ +# +# Copyright (C) 2004 by Daniel Stenberg +# +# Script for parsing the 'viewers' file to produce proper file names of +# viewer plugins. +# +open(VIEW, ") { + chomp; + my $l = $_; + $lnum++; + if(!$rock) { + if($l =~ /^ *\/) { + $rock=$lnum; + } + elsif($l =~ /^ *<\/rock>/) { + note($lnum, "dangling "); + } + } + if($rock) { + if($l =~ /^ *<\/rock>/) { + if(verified(%rock)) { +# print $rock{'File'}." ".$rock{'Extension'}." ".$rock{'Name'}."\n"; + if($config) { + if($file eq $rock{'File'}) { + print $rock{'Extension'}.",", + $rock{'Extension'}."-".$rock{'Name'}.".rock,", + $rock{'Icon'}."\n"; + } + } + elsif(!$file || ($file eq $rock{'File'})) { + print $rock{'Extension'}."-".$rock{'Name'}.".rock\n"; + exit; + } + } + else { + note($rock, "incomplete "); + } + $rock=0; + undef %rock; + } + + elsif($l =~ /^ *([A-Za-z]+): (.*)/) { + my ($what, $val) = ($1, $2); + + if($rock{$what}) { + note($rock, "$what: was already set to ".$rock{$what}); + } + if($what eq "Extension") { + if($exts{$val}) { + note($rock, "the extension $val was already claimed"); + } + $exts{$val}=$what; + } + + $rock{$what}=$val; + } + } +} +if($rock) { + note($rock, "unterminated "); +} +print $file if(!$config); Index: apps/plugins/viewers =================================================================== RCS file: apps/plugins/viewers diff -N apps/plugins/viewers --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ apps/plugins/viewers 15 Jan 2004 13:46:47 -0000 @@ -0,0 +1,14 @@ + +File: chip8.rock +Name: chip8 +Extension: ch8 +Icon: 70 70 7f 7f 70 70 + + + +File: viewer.rock +Name: viewer +Extension: txt +Icon: 55 55 55 55 55 55 + +