How to make the z80 libraries under windows

Installing on windows
Post Reply
alvin
Well known member
Posts: 1872
Joined: Mon Jul 16, 2007 7:39 pm

How to make the z80 libraries under windows

Post by alvin »

Molochite originally asked on the z88dk-users mailing list:

> I have a problem, i use windows. I can build the binaries without problems
> with vs2005, but the libraries... I have tried with "GNU Make for windows"
> and with cygwin, but the two fails at least for me).
>
> how can i build the libraries from windows?

I'm also using windows as the primary platform so I can help you here.

I use GNU utilities for Win32: http://unxutils.sourceforge.net/ The direct download links on that page are dead but you can still download from the sourceforge link. Unzip someplace (c:\gnu ?) and add the two new binary directories to your path {gnu}\usr\local\wbin and {gnu}\bin

These win32 gnu utilities do not quite behave properly. For example the rm command, given a list of matching files to remove as in "rm *.tmp *.opt" returns with error if any matching string does not match and will not remove any matching files unless all matching strings match. For this reason, "make clean" does not work for me under windows. You also have to specify -i as in "make -i" whenever invoking make so that make will not quit prematurely when rm returns with these errors. Lastly, always run make from within the provided sh, otherwise the command.com dos versions of some commands like "mkdir" get executed rather than the GNU version and this again causes trouble.

So after installing the GNU utils above you can compile the cpc library with the following:

1. open up command console
2. do whatever you need to do to initialize your path variable to point at {z88dk}\bin and the two GNU bins
3. cd {z88dk}\libsrc
4. sh
5. rm *.lib (in case any previously compiled libs are there now)
6. make -i cpc_clib.lib (a list of make rules for other targets is found, as always, in Makefile; or just do "make -i" to make everything)
7. make -i cpcansi_clib.lib
8. make install (copies the lib files to the right place)
9. exit (to get out of sh)
Mochilote
Member
Posts: 42
Joined: Thu Jul 19, 2007 10:54 am

Post by Mochilote »

This works perfectly, many thanks.
Molochite originally asked on the z88dk-users mailing list:
Uhmmm, Molochite sounds like Mochilote, no? :lol: , many thanks avlin ;)
User avatar
RobertK
Well known member
Posts: 303
Joined: Mon Feb 26, 2018 12:58 pm

Re: How to make the z80 libraries under windows

Post by RobertK »

I think we can continue the discussion from the Galaksija thread here.
stefano wrote: Tue May 24, 2022 1:37 pm RokertK, a first build does not require a git sync, you could in example lend the pre-build environment distributed by MAME, grab z88dk-master in zipped form from github, set 2 environment variables in bashrc and you are set.
Tiny commits can be done also using the web interface.
I hopefully should be able to handle Git (haven't tried branches, commits etc. yet), but my problem is that I still can't compile.

I have installed "Git" so that I can use the "Git Bash" Unix-style command window.
dom wrote: Mon Apr 04, 2022 6:31 pm I think that error means that cc is not on the path when a shell is spawned from make.
You should be able to build with make CC=/full/path/to/cc - and then probably run into another problem!
I am wondering whether cc is present at all. I expected it to find it like this...

Code: Select all

ws09@nbkac3 MINGW64 ~/z88dk/src/appmake (master)
$ find / -name \cc*.* -print
find: ‘/tmp/msdtadmin’: Permission denied
/tmp/scoped_dir14768_670326614/ccfe8a3fff2addaa7b16a46a5bd805e3.png
/tmp/scoped_dir15560_1847592278/ccfe8a3fff2addaa7b16a46a5bd805e3.png
/tmp/scoped_dir16404_661146320/ccfe8a3fff2addaa7b16a46a5bd805e3.png
/tmp/scoped_dir26552_1442424085/ccfe8a3fff2addaa7b16a46a5bd805e3.png
/tmp/scoped_dir31592_1433695311/ccfe8a3fff2addaa7b16a46a5bd805e3.png
/usr/share/vim/vim80/autoload/ccomplete.vim
/usr/share/vim/vim80/tools/ccfilter.1
/usr/share/vim/vim80/tools/ccfilter_README.txt
find: failed to read file names from file system at or below ‘/’: No such file or directory

ws09@nbkac3 MINGW64 ~/z88dk/src/appmake (master)
$
...but there does not seem to be a cc executable.

After some web research I found out that using "MinGW for Windows" instead could help. The online installer mingw-w64-install.exe does not work, so I found the package x86_64-8.1.0-release-win32-seh-rt_v6-rev0.7z, but I don't really know what to do with it. This is probably supposed to be running entirely inside the Windows command prompt instead of a Unix-style environment.

Quite frustrating. Although I remember that I was successfully compiling programs for the Pacman HW target some three years ago, but for some reason that too doesn't work anymore.
User avatar
dom
Well known member
Posts: 1692
Joined: Sun Jul 15, 2007 10:01 pm

Re: How to make the z80 libraries under windows

Post by dom »

I wrote this guide a couple of years ago: https://github.com/z88dk/z88dk/wiki/Cla ... on-windows

It should be the best starting point for a win32 environment.
User avatar
RobertK
Well known member
Posts: 303
Joined: Mon Feb 26, 2018 12:58 pm

Re: How to make the z80 libraries under windows

Post by RobertK »

Yes, I followed these instructions, but then I ran into the "cc not found" problem mentioned before. So the next step would be to add cc to the path, but for that I would first need to know where cc is, but I can't find it inside the Git Bash command window.
stefano
Well known member
Posts: 1807
Joined: Mon Jul 16, 2007 7:39 pm

Re: How to make the z80 libraries under windows

Post by stefano »

I recently ran into a different problem with mingw.
The makefile couldn't 'include' all the required definitions, I solved it manually:

export ZCCCFG=/c/z88dk/lib/config
Post Reply