Jump to content

Open Club  ·  61 members

DASM
IGNORED

DASM compiling?


Thomas Jentzsch

Recommended Posts

My brain has never aligned to C make etc. So please have mercy with me.

 

First I found no instructions how to compile DASM. At github it says

Quote

This file describes the DASM source distribution, how to compile DASM, and where to get more information. DASM's homepage is https://dasm-assembler.github.io/

But I found no such instructions at https://dasm-assembler.github.io.

 

Then I thought I might be able to find out myself. I have installed MinGW32 (Windows 10) and added the bin directory to the path variable. But then I am stuck. How do I start the build? I tried "mingw32-make" from the command line (BTW: Why are there two MakeFiles?). But I get the following error:

Quote

C:\Users\Thomas\Documents\Atari\dev\Dasm\Dasm\source>mingw32-make
(cd src; mingw32-make; cd ..)
process_begin: CreateProcess(NULL, (cd src; mingw32-make; cd ..), ...) failed.
make (e=2): Das System kann die angegebene Datei nicht finden.
Makefile:47: recipe for target 'build' failed
mingw32-make: *** [build] Error 2

And from within the src directory:

Quote

C:\Users\Thomas\Documents\Atari\dev\Dasm\Dasm\source\src>mingw32-make
detected_OS is Windows
cc    -c -o main.o main.c
process_begin: CreateProcess(NULL, cc -c -o main.o main.c, ...) failed.
make (e=2): Das System kann die angegebene Datei nicht finden.
<builtin>: recipe for target 'main.o' failed
mingw32-make: *** [main.o] Error 2

What am I doing wrong here? (And why are the error messages of make in 2023 still as bad as I remember them?)

 

Any help is welcome.

Edited by Thomas Jentzsch
Link to comment
Share on other sites

Thanks. But sorry, for me it doesn't work (and in which path are you?). Maybe this helps:

Quote

C:\Users\Thomas\Documents\Atari\dev\Dasm\Dasm\source\src>mingw32-make --version
GNU Make 3.82.90
Built for i686-pc-mingw32
Copyright (C) 1988-2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

C:\Users\Thomas\Documents\Atari\dev\Dasm\Dasm\source\src>mingw32-make
detected_OS is Windows
cc    -c -o main.o main.c
process_begin: CreateProcess(NULL, cc -c -o main.o main.c, ...) failed.
make (e=2): Das System kann die angegebene Datei nicht finden.
<builtin>: recipe for target 'main.o' failed
mingw32-make: *** [main.o] Error 2

BTW: I have already pulled the latest source code.

Edited by Thomas Jentzsch
Link to comment
Share on other sites

I think "make" is named "mingw32-make" for mingw32. The mingw32 bin folder has no make.exe. If I try "make" I get a file not found error.

 

As you can see from above "mingw32-make --version" works. But just "mingw32-make" does not.

Edited by Thomas Jentzsch
Link to comment
Share on other sites

Multiple makefiles are just there to "encapsulate" each part of a build of a project. You may have different things that build under different circumstances. The Makefile in the root directory does it all and recursively calls make in the appropriate subdirectories. It's overkill for dasm. But basically all you need to do is make from the root directory.

Link to comment
Share on other sites

How? I tried https://gcc.gnu.org/install/ but it goes over my head (again). I don't want to build my compiler (and how should I do that without a compiler)? 

 

I only found mingw32 so far. Is it not compatible :? 

Edited by Thomas Jentzsch
Link to comment
Share on other sites

I renamed mingw32-make.exe into make.exe (for whatever reason, but what do I know), but that doesn't make any difference. Does the Makefile not work with Windows or what am I doing wrong here? :? :? :? 

 

(now I remember why I hate make with passion... :x )

Edited by Thomas Jentzsch
Link to comment
Share on other sites

The same I posted above:

Quote

C:\Users\Thomas\Documents\Atari\dev\Dasm\Dasm\source>make
(cd src; make; cd ..)
process_begin: CreateProcess(NULL, (cd src; make; cd ..), ...) failed.
make (e=2): Das System kann die angegebene Datei nicht finden.
Makefile:47: recipe for target 'build' failed
make: *** [build] Error 2

"Das System kann die angegebene Datei nicht finden" == "The system cannot find the given file" (whichever file that is...)

Link to comment
Share on other sites

3 minutes ago, Thomas Jentzsch said:

The same I posted above:

"Das System kann die angegebene Datei nicht finden" == "The system cannot find the given file" (whichever file that is...)

 

OK, I didn't look closely before. Sorry you had to repeat this.

 

So, it's failing when trying to run those aforementioned recursive makes.

Try cd to the src directory and type make from there.  In this way of doing it, dasm should be built in that directory.

 

 

Link to comment
Share on other sites

Tried and posted that before too. Same result:

Quote

C:\Users\Thomas\Documents\Atari\dev\Dasm\Dasm\source\src>make
detected_OS is Windows
cc    -c -o main.o main.c
process_begin: CreateProcess(NULL, cc -c -o main.o main.c, ...) failed.
make (e=2): Das System kann die angegebene Datei nicht finden.
<builtin>: recipe for target 'main.o' failed
make: *** [main.o] Error 2

Which file does it not find? Is there any way to get a more detailed error output?

 

Uhm, does it try to run cc.exe? mingw32 has no cc.exe. Only a gcc.exe, a mingw32-gcc.exe and a mingw32-gcc-9.2.0.exe.

 

Hah, that was the problem. After "set CC=gcc", it compiles. :) 

But what does that mean? Do we have to document this? Is mingw32 the culprit? How could I have known before?

 

IMO, there really should be the promised compile instructions added somewhere.

 

BTW: There is a line #CC= gcc in the 2nd makefile. Why was it commented out?

Edited by Thomas Jentzsch
Link to comment
Share on other sites

I believe the issue is you do not have PATH setup correctly. When the new shell is spawned to run make in the subdirectory (i.e., the recursive bit), it spawns the shell and runs make.exe -- BUT since the path is not set properly, it fails too find make.exe and reports the error. This is my best guess. If so, it's your configuration error on the path, nothing to do with make.  That's my best-guess right now.

 

Link to comment
Share on other sites

Nope, the path was correct. It was only the missing "cc= gcc".

 

If I uncomment that line from the src/Makefile, I can compile from within src. But not from the root directory.

 

Anyway, thanks for taking your time. That helped and also motivated me to continue to search for a solution.

Edited by Thomas Jentzsch
Link to comment
Share on other sites

Yes, I still think compiling from the root directory IS a PATH issue.  To confirm, in the src/Makefile just put an 'echo $PATH' or something similar just after line 31, before it echoes the build complete.  The thinking here is, that it will output the path when you type 'make' ***FROM THE ROOT DIRECTORY*** and you should see wherever cc is supposed to be missing from the printed path. And for confirmation do 'make' from the src directory and if you see a different path output, then that confirms it.

But these are my guesses. Let me know.

Link to comment
Share on other sites

8 minutes ago, Andrew Davie said:

 To confirm, in the src/Makefile just put an 'echo $PATH' or something similar just after line 31, before it echoes the build complete. 

I inserted echo "Thomas" at line 30 of the src/Makefile and then tried make from the root. The echo doesn't show.

 

Or did you mean the root Makefile

(after all: build
    echo "Build complete, use 'make test' to run tests.")?

 

There is no output too.

Edited by Thomas Jentzsch
Link to comment
Share on other sites

Have had a closer look, sorry.

 

OK, in src/Makefile ...

 

dasm: $(OBJS)
      echo %%PATH%%
      $(CC) $(CFLAGS) $(OBJS) -o dasm $(LDFLAGS)

 

add the one line in the middle - the echo -- about line 72

This should now print the path when you do a make.

 

 

Two tests.

1) make from root directory. It will fail but print the path too

2) make from src directory. It will succeed and also print the path.

 

Are the paths different?

If so, look at the path in 1) and tell me how it is finding the location of cc.exe using that path.

 

Link to comment
Share on other sites

That (echo $(PATH)) works from src, but from the root it doesn't get that far.

 

Quote

C:\Users\Thomas\Documents\Atari\dev\Dasm\Dasm\source\src>make
detected_OS is Windows
gcc    -c -o main.o main.c
echo C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Users\Thomas\Documents\Compiler\MinGw\bin;C:\Program Files\Git\cmd;C:\Program Files\TortoiseGit\bin;C:\Program Files\Microsoft SQL Server\150\Tools\Binn\;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn\;C:\Program Files\dotnet\;C:\Program Files\Calibre2\;C:\Users\Thomas\AppData\Local\Microsoft\WindowsApps;C:\Users\Thomas\.dotnet\tools

BTW: The path is output twice!

Edited by Thomas Jentzsch
Link to comment
Share on other sites

OK, well we are making progress. Definitely a path issue, but this way of diagnosing it isn't going to help.

Basically if you put make.exe in source directory, then do the same experiment as I asked before.... this time I think it will find make.exe and run the second test.

If the way windows works is to look in current dir first. I dunno.

Give that a test, see if we get two paths. if we do, are they different. If they are - guess confirmed.

 

Link to comment
Share on other sites

We put the path output on the part where it builds each of the multiple source files. So we see many paths output. That's ok.

Just wanted to put it somewhere where it was likely to be printed.

BTW. to force a rebuild at any time, you type 'make clean'
 

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...