[z88dk-dev] make

Bridge to the z88dk-developers mailing list
Post Reply
Rurigan
New member
Posts: 6
Joined: Mon Aug 14, 2017 9:28 am

[z88dk-dev] make

Post by Rurigan »

Hi there

I am trying to make a new target for the compiler. I ran into a trivial problem when trying to rebuild the clib.

How do you handle the RM command in the Makefile when you run it on a Windows platform.

Regards



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
pscust
Well known member
Posts: 194
Joined: Thu Jun 23, 2011 3:34 pm

Post by pscust »

Usually we run in a Linux-type environment in Windows, such as cygwin
or mingw32.

On 8/14/17, Rurigan (sa19620821@...) <lists@...> wrote:
Hi there

I am trying to make a new target for the compiler. I ran into a trivial
problem when trying to rebuild the clib.

How do you handle the RM command in the Makefile when you run it on a
Windows platform.

Regards



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
alvin
Well known member
Posts: 1872
Joined: Mon Jul 16, 2007 7:39 pm

Post by alvin »

Usually we run in a Linux-type environment in Windows, such as cygwin
or mingw32.

On 8/14/17, Rurigan (sa19620821@...) <lists@...> wrote:
Hi there

I am trying to make a new target for the compiler. I ran into a trivial
problem when trying to rebuild the clib.
It will also depend on which clib you are adding the target to.

If it's the classic lib rooted in z88dk/libsrc that you are looking at, it will have to be done with cygwin, msys, etc.

If it's the newlib rooted in z88dk/libsrc/_DEVELOPMENT then there are two "makefiles" maintained. One is "Makefile" for Linux&co and the other is "Winmake.bat" for windows. Adding a target means adding it to both these files. Then windows can build the libraries by running "Winmake all" or a specific target's library by running "Winmake zx" (for example). "Winmake" on its own will list the available targets.



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
Rurigan
New member
Posts: 6
Joined: Mon Aug 14, 2017 9:28 am

Post by Rurigan »

Usually we run in a Linux-type environment in Windows, such as cygwin
or mingw32.

On 8/14/17, Rurigan (sa19620821@...) <lists@...> wrote:
Hi there

I am trying to make a new target for the compiler. I ran into a trivial
problem when trying to rebuild the clib.
It will also depend on which clib you are adding the target to.

If it's the classic lib rooted in z88dk/libsrc that you are looking at, it will have to be done with cygwin, msys, etc.

If it's the newlib rooted in z88dk/libsrc/_DEVELOPMENT then there are two "makefiles" maintained. One is "Makefile" for Linux&co and the other is "Winmake.bat" for windows. Adding a target means adding it to both these files. Then windows can build the libraries by running "Winmake all" or a specific target's library by running "Winmake zx" (for example). "Winmake" on its own will list the available targets.
I will throw it in the development then. Actually it is development any way. I am not keen on switching to Linux at the moment even though I have two installations running (one on my old laptop and the on on my Pi. I am working on a Z80 design for a FPGA. All other software I am using is running on window.

Additional could you point me to some description of how the memory layout is working with the compiler. WHat I have been seeing so far don't give any clear picture. It is probably simple when you get into it. Any other hints is welcome and highly appreciated.



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
Rurigan
New member
Posts: 6
Joined: Mon Aug 14, 2017 9:28 am

Post by Rurigan »

Well well...

To a look at the development. I don't find a usable solution for me. It is development for a new version of the whole library as I see it.

I think I just redefine the RM macro so it will run with the gnu make for windows i use.



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
Rurigan
New member
Posts: 6
Joined: Mon Aug 14, 2017 9:28 am

Post by Rurigan »

For get the RM problem. I installed Cygwin and it runs fine. That is the RM command works but of course it can't find the assembler and other tools. I guess I have to ad the search path. Well I will get to it.

But I am still very interested in some hints on the memory setup for the compiler

Thanks for pointing me to Cygwin seems to be a good solution.



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
alvin
Well known member
Posts: 1872
Joined: Mon Jul 16, 2007 7:39 pm

Post by alvin »

To a look at the development. I don't find a usable solution for me. It is development for a new version of the whole library as I see it.
It's a second library that exists in parallel with the classic. It's being done as fresh re-implementation to achieve a subset of C11 and to clear out some of the cruft that always happens in a long existing project. It's in active use, it should not be considered in development, although of course nothing is ever "not in development" :D and there are a few things that still need doing.

Each target gets its own directory in z88dk/libsrc/_DEVELOPMENT/target and a good place to look for a generic z80 system is the generic z80 target in that directory. What makes the generic z80 target different from the others is that it has no hardware specific functionality in it whereas the others may have drivers for display, input, etc and specific code for audio and video.

Some technical information on the z80 target for newlib:
https://www.z88dk.org/wiki/doku.php?id= ... t_embedded

The memory map you define although you can just use what z88dk supplies as it will be perfectly adequate for any 64k system. New sections would have to be defined for bankswitched systems. The linker will not automatically generate programs that bankswitch but the tools will easily place things in memory where you tell them to with the actual banking under program responsibility.



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
Rurigan
New member
Posts: 6
Joined: Mon Aug 14, 2017 9:28 am

Post by Rurigan »

great thank you. :D



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
alvin
Well known member
Posts: 1872
Joined: Mon Jul 16, 2007 7:39 pm

Post by alvin »

great thank you. :D
Np, with cygwin you have a choice.

Setting up requires setting PATH and defining ZCCCFG:
https://www.z88dk.org/wiki/doku.php?id= ... stallation

But make sure you are using a current version - there have been more than a thousand commits since the sourceforge release in January. Some of those things are bugfixes.

For windows (and mac osx) you can get the nightly build which will include everything and only requires setting the PATH & ZCCCFG:
http://nightly.z88dk.org/

For everything else and cygwin, you can use github to clone and build it all:
https://github.com/z88dk/z88dk

Then updating is a matter of either git update + rebuild or erasing an old nightly install and replacing with a new one.



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
Rurigan
New member
Posts: 6
Joined: Mon Aug 14, 2017 9:28 am

Post by Rurigan »

great thank you. :D
Np, with cygwin you have a choice.

Setting up requires setting PATH and defining ZCCCFG:
https://www.z88dk.org/wiki/doku.php?id= ... stallation

But make sure you are using a current version - there have been more than a thousand commits since the sourceforge release in January. Some of those things are bugfixes.

For windows (and mac osx) you can get the nightly build which will include everything and only requires setting the PATH & ZCCCFG:
http://nightly.z88dk.org/

For everything else and cygwin, you can use github to clone and build it all:
https://github.com/z88dk/z88dk

Then updating is a matter of either git update + rebuild or erasing an old nightly install and replacing with a new one.
I forked the repository and prepared it exactly as described. I have had no problems doing the build with VisualStudio.

Any way. I just read through the documentation on the embedded target you pointed me to. It seems like it is so flexible that I can use that unchanged. At least for now. So I stick to that and use my time on the FPGA design I am trying to build (using SystemVerilog and this https://opencores.org/project,a-z80)

Thank you again.



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
alvin
Well known member
Posts: 1872
Joined: Mon Jul 16, 2007 7:39 pm

Post by alvin »

I forked the repository and prepared it exactly as described. I have had no problems doing the build with VisualStudio.
Awesome. One C compiler is maintained outside of z88dk (zsdcc and its preprocessor zsdcpp). This is because it originates in the sdcc project and has not yet been brought in as a git submodule. You can get the windows binaries from the nightly build - just copy them to z88dk/bin. For windows, m4 is something else added that is external to z88dk and it too is in the nightly build bin. So for windows, it's better to prime your z88dk/bin directory with binaries from the nightly build and then go about your business building with vs.
Any way. I just read through the documentation on the embedded target you pointed me to. It seems like it is so flexible that I can use that unchanged. At least for now. So I stick to that and use my time on the FPGA design I am trying to build (using SystemVerilog and this https://opencores.org/project,a-z80)
Nice, going down to the gate level would have taken some work!

Yes, the generic z80 target is meant to work with any z80 system minus hw specific things. If you need to modify its behaviour via pragmas, the best route is to store those in a separate zpragma.inc file and then just include that on the compile line by adding "-pragma-include:zpragma.inc"



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
Post Reply