OSLib and ELF

Tom Hughes tom at compton.nu
Sun Apr 15 00:34:56 BST 2007


In message <64992fd24e.Jo at hobbes.bass-software.com>
          John Tytgat <John.Tytgat at aaug.net> wrote:

> In message <gemini.jgcgwg01ih5uo06me.tony at vanderhoff.org>
>           Tony van der Hoff <tony at vanderhoff.org> wrote:
> 
> > Would it be useful to investigate incorporating Tom's build system?
> 
> Well sure, Tom, any specifics you want to share why/how you build
> OSLib/DefMod differently ?

Well it's not exactly complete ;-) Basically on the RISC OS side
the directory structure looks like:

  OSLib [project root]
  + Build [build area for intermediate files]
    + Help
    + Release
    + Release26
  + OSLib [final output area]
    + o
    + OSLib
      + h
      + Hdr
  + Source [source files]
    + !Help [taskobey file to build help files]
    + !Release [taskobey file to build 32 bit OSLib]
    + !Release26 [taskobey file to build 26 bit OSLib]
    + HelpMF [template for makefile to build help files]
    + TemplateMF [template for makefile to build oslib]
    + Source [cvs/svn checkout nfs mounted from linux box]

The template makefiles are processed by a program I wrote called
makegen that does roughly what the makatic tool from Dr Smith's
used to do - mine is 32 bit clean though, so works on the Iyonix, and
it also has some bugs/limitations fixed.

I've attached the taskobey files and the template makefiles.

The NFS mount is not actually of the checkout itself, but of a link
farm created to "flat out" the checkout by dropping the distinction
between the four different groups of SWIs that exists purely to work
around the 77 file limit in old RISC OS versions. The shell script
that I use to build this link farm is also attached.

All this assumes that defmod and things are already build and sitting
in my library directory - I've never got arround to converting them
to use makegen.

Tom

-- 
Tom Hughes (tom at compton.nu)
http://www.compton.nu/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: !Help
Type: application/riscos
Size: 216 bytes
Desc: not available
URL: <http://lists.compton.nu/pipermail/oslib-user/attachments/20070415/6237221a/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: !Release
Type: application/riscos
Size: 257 bytes
Desc: not available
URL: <http://lists.compton.nu/pipermail/oslib-user/attachments/20070415/6237221a/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: !Release26
Type: application/riscos
Size: 259 bytes
Desc: not available
URL: <http://lists.compton.nu/pipermail/oslib-user/attachments/20070415/6237221a/attachment-0002.bin>
-------------- next part --------------
BaseDir		=	^.^

SourceDir	=	$(BaseDir).Source.Source

HelpFiles	=	\
#MakeGen{ ^.^.Source.Source.swi.*
			Flags.#0	\
#MakeGen}

HelpIndexes	=	\
			Manual.action_.!Root \
			Manual.class_.!Root \
			Manual.error_.!Root \
			Manual.message_.!Root \
			Manual.service_.!Root \

Manual		=	$(BaseDir).Manual

DEFMODFlags	=	$(DEFMODExtra) -byte_wide $(SourceDir).ByteWide

DEFMOD		=	defmod $(DEFMODFlags)
CREATE		=	create
INDEXHELP	=	indexhelp
BINDHELP	=	bindhelp

# Don't alter anything below this...

all: $(Manual)

$(Manual): $(HelpFiles) $(HelpIndexes)
	$(BINDHELP) Manual $@

#MakeGen{ ^.^.Source.Source.swi.*
Flags.#0: $(SourceDir).swi.#0
	$(DEFMOD) -cstrong -o Manual < $(SourceDir).swi.#0
	$(CREATE) $@

#MakeGen}

Manual.action_.!Root: $(HelpFiles)
	$(INDEXHELP) Manual.action_ -p Action

Manual.class_.!Root: $(HelpFiles)
	$(INDEXHELP) Manual.class_ -p Class

Manual.error_.!Root: $(HelpFiles)
	$(INDEXHELP) Manual.error_ -p Error

Manual.message_.!Root: $(HelpFiles)
	$(INDEXHELP) Manual.message_ -p Message

Manual.service_.!Root: $(HelpFiles)
	$(INDEXHELP) Manual.service_ -p Service
-------------- next part --------------
BaseDir		=	^.^

HeadersDir	=	$(BaseDir).OSLib.OSLib.h

AsmHeadersDir	=	$(BaseDir).OSLib.OSLib.Hdr

SourceDir	=	$(BaseDir).Source.Source

Headers		=	\
#MakeGen{ ^.^.Source.Source.h.*
		$(HeadersDir).#0	\
#MakeGen}
#MakeGen{ ^.^.Source.Source.swi.*
		$(HeadersDir).#0	\
#MakeGen}

AsmHeaders	=	\
#MakeGen{^.^.Source.Source.Hdr.*
		$(AsmHeadersDir).#0	\
#MakeGen}
#MakeGen{ ^.^.Source.Source.swi.*
		$(AsmHeadersDir).#0	\
#MakeGen}

Objects		=	\
#MakeGen{ ^.^.Source.Source.s.*
		o.#0	\
#MakeGen}

ViaFiles	=	\
#MakeGen{ ^.^.Source.Source.swi.*
		#0.ViaFile	\
#MakeGen}

OSObjects	=	\
			o.OSChangeDynamicAreaNoFail \
			o.OSHeapResizeNoFail \
			o.OSReadVarValSize \
			o.XOSChangeDynamicAreaNoFail \
			o.XOSHeapResizeNoFail \
			o.XOSReadVarValSize

Library		=	$(BaseDir).OSLib.o.$(LeafName)

include TomsLib:Make.$(BuildType)
include TomsLib:Make.Base

ASMFlags	+=	-I ^.^.OSLib
DEFMODFlags	+=	-byte_wide $(SourceDir).ByteWide

all: $(Library) $(Headers) $(AsmHeaders)

#MakeGen{ ^.^.Source.Source.h.*
$(HeadersDir).#0: $(SourceDir).h.#0
	$(COPY) $(SourceDir).h.#0 $@ $(COPYFlags)

#MakeGen}

#MakeGen{ ^.^.Source.Source.Hdr.*
$(AsmHeadersDir).#0: $(SourceDir).Hdr.#0
	$(COPY) $(SourceDir).Hdr.#0 $@ $(COPYFlags)

#MakeGen}

#MakeGen{ ^.^.Source.Source.s.*
o.#0: $(SourceDir).s.#0
	$(ASM) -from $(SourceDir).s.#0 -to $@

#MakeGen}

#MakeGen{ ^.^.Source.Source.swi.*
$(HeadersDir).#0: $(SourceDir).swi.#0
	$(DEFMOD) -h < $(SourceDir).swi.#0 > $@

$(AsmHeadersDir).#0: $(SourceDir).swi.#0
	$(DEFMOD) -hdr < $(SourceDir).swi.#0 > $@

#0.ViaFile: $(SourceDir).swi.#0
	$(DEFMOD) -l -o #0 < $(SourceDir).swi.#0
	$(REDUCEAOF) -via ViaFile
	$(REMOVE) $@
	$(RENAME) ViaFile $@

$(Library):: #0.ViaFile
	-$(LIBFILE) -d $@ #0.**
	$(LIBFILE) -i -o $@ -v #0.ViaFile

#MakeGen}

$(Library):: OS.Viafile o.OSReadVarValSize
	$(LIBFILE) -d $@ OS.0x00020.o.000
	$(LIBFILE) -i -o $@ o.OSReadVarValSize

$(Library):: OS.Viafile o.XOSReadVarValSize
	$(LIBFILE) -d $@ OS.0x00020x.o.000
	$(LIBFILE) -i -o $@ o.XOSReadVarValSize

$(Library):: OS.Viafile o.OSChangeDynamicAreaNoFail
	$(LIBFILE) -d $@ OS.0x00020.o.001
	$(LIBFILE) -i -o $@ o.OSChangeDynamicAreaNoFail

$(Library):: OS.Viafile o.XOSChangeDynamicAreaNoFail
	$(LIBFILE) -d $@ OS.0x00020x.o.001
	$(LIBFILE) -i -o $@ o.XOSChangeDynamicAreaNoFail

$(Library):: OSHeap.Viafile o.OSHeapResizeNoFail
	$(LIBFILE) -d $@ OSHeap.0x00010.o.001
	$(LIBFILE) -i -o $@ o.OSHeapResizeNoFail

$(Library):: OSHeap.Viafile o.XOSHeapResizeNoFail
	$(LIBFILE) -d $@ OSHeap.0x00010x.o.001
	$(LIBFILE) -i -o $@ o.XOSHeapResizeNoFail

-------------- next part --------------
#!/bin/sh

cd checkout
cvs -z9 update -dP
cd ..

ln -f checkout/\!OsLib/Source/ByteWide source

for group in Macros Types
do
  for file in checkout/\!OsLib/Source/$group/oslib/*.h
  do
    ln -f $file source/h/`basename $file .h`
  done

  for file in checkout/\!OsLib/Source/$group/oslib/*.Hdr
  do
    ln -f $file source/Hdr/`basename $file .Hdr`
  done
done

for group in Computer Core Toolbox User
do
  for file in checkout/\!OsLib/Source/$group/oslib/*.asm
  do
    ln -f $file source/s/`basename $file .asm`
  done

  for file in checkout/\!OsLib/Source/$group/oslib/*.swi
  do
    ln -f $file source/swi/`basename $file .swi`
  done
done


More information about the oslib-user mailing list