Is anyone willing to share an existing GCC using Makefile?
I know I can do the C code sections for what I want...
but I am dealing with the AmigaOS4.x changes from 3.x as somewhat new,
and I am also dealing with the GCC environment as new as well.
maybe what I am asking is unclear?
I've managed to dig pieces of Makefiles out of the OS4 development kit,
but for the Makefile I have written to use myself I would like it to be checked out.
along with a basic "empty.library" template skeleton that I have used before for AOS3.x
if there is anything else special other than adding the Interfaces for the libraries?
Feedback would be appreciated:
all this work will be public and available as a working example for building
multi-target ( AOS4.x + AROS ) Shared Libraries for Amiga systems using GCC.
As no one answer, i will be the brave one :) , so:
As i understand you need to know what Makefiles is it at all, and how they structured when you do your code for GCC? If so, then you can read any documentation in the net which describe Makefiles format (as its absolutly non amigaos4 specific, its the same as on linuxes and any other oses where GCC are used). Just type in google "gcc makefiles format" and there is a lot of links and explaining of how "make" works and how makefiles structured.
Then, as i understand you want to know how to construct Makefile which will build for you shared library ? Then all what you need to know its how to make a shared library for os4, and just put necessary flags to Makefile (i.e. there is no special makefiles for shared libs, makefiles are makefiles, and what you put in it based only on what you want to do). There can't be some 100% the same makefile which will works for every shared library which one want to create (all the libs its different set of sources of course, all of them compiles with different flags, and linking done differently, in matter of how and what you want to do).
Makefiles do the same as you can do via some bat-scripts: its just in some way constructed, but in end, its just compile and link for you sources and objects which you need, with the necessary flags and options. You even can not use makefiles at all if your project are small.
For the learning purposes you can check Salas00's ptplay.library port from os4depot (download it here). Which come with all the sources and Makefile, where you can find what kind of flags are provided to compiler and to linker in makefiles, and how to code shared library for os4 at all.
Check out idltool which is included with the SDK. Basically you generate a simple XML file which describes your library, then idltool will create all the files you need, then just fill in the functions. It's about as easy as it gets.
using idltool has the pre-requisite of running an Amiga OS 4.x system, this is a luxury I do not currently have (I am still working toward changing this)
so writing a Makefile myself and getting the options correct is like trying to play darts blindfolded with no idea where the board actually is...
I am after an already written one to compare against what I have done for myself so far
as I still feel I have missed something.
And I find it seriously uncomfortable in releasing code without being clear about that.
the "use idltool"/"use genmodule" suggestions while helpful are in themselves problematic
as I am a *returning* developer who has to learn about the AOS4 differences from AOS3
and earlier to make functional code.
so far I am certain I have messed up the options somewhere, especially as I want to write
entirely newlib based code where possible (clib2 if I must).
dealing with AmiDevCpp so far has been next to futile as the examples are based on the
assumption of writing application or commodity programs and not system components.
Where I am more interested in expanding what the OS itself can do with as minimal changes
to the OS itself as I can get away with.
no... you actually missed the entire point,
I know how to structure a Makefile and all the documentation *about* a Makefile
is entirely different to actually having a written *example* showing quite clearly
a functional demonstration.
Thank you for referring to an openly available library that is already ported,
as this is the kind of material I have been after...
again this is a VBCC Makefile, not GCC, Ive been looking for GCC examples[/edit]
it won't matter how many times I read about Makefiles and how simple they are,
without an example that is working, its all academic.
I also know that GCC and VBCC both come with the AOS4.x SDK however I would prefer
to have a working GCC usage for building a Shared Library.
so it appears that I will be waiting for when I get my own AOS4.x machine anyway.
No matter how well meaning your intentions, you still missed the target :|
Makefile from xvidcore.library source code:
You don't need to specify -mcrt=newlib any more since newlib is the default C library now but it doesn't hurt to do so either. Pretty much the only thing to watch out for when building a library or device is to disable linking of startup code which is done by using the -nostartfiles option.
In this Makefile I also strip the library using the strip command but this is not really necessary (only makes the file a little smaller).
Thank you salass00, this is exactly the kind of material I have been looking for,
glad to know there isn't really any special sauce for the Makefile part.
Now I just have to get the project to build... and for that I will *need* the sam440flex I am buying :)
Half-paid already... just need to get the rest together.