Jump to content

Open Club  ·  61 members

DASM
IGNORED

DASM compiling?


Thomas Jentzsch

Recommended Posts

I did put make.exe in the root and the src directory and tried to run make from root. Same old error. Even after doing a "set cc= gcc" before.

 

BTW: make clean doesn't work in both dirs.

Edited by Thomas Jentzsch
Link to comment
Share on other sites

For reference, as I don't know how much you know about makefiles, but basically you type make followed by a "target".

The default target is "all"

When I say "make clean", I am saying make the target named "clean"

When make runs, it looks for your target in the Makefile.  

The default is a line starting with "all:"

The make clean command will look for a line starting with "clean:"

And after the colon on each of those targets in the makefile is a list of dependencies (optional).

Those dependencies can ALSO be other targets.

 

So if we had a line line like this...

 

all : clean

 

That would mean that every time you typed make, it would first try to process the all target, and to process that it would see there's a dependency on clean, so it would process the clean.

After the target line (with the : ) the following lines (indented) are what to DO to make that target

so when we put the echo in, we put it after the dasm: target, and that meant that every time the dasm: target was "processed" we got an echo output of the path.

On that dasm target we see...

 

dasm: $(OBS)

 

What that's doing is exactly the same as described before.  The target is dasm, and it depends on $(OBJS)

What is $(OBJS)?  It's the .o files listed earlier in the makefile...

 

OBJS= main.o ops.o globals.o exp.o symbols.o \
      mne6303.o mne6502.o mne65c02.o mne68705.o mne6811.o mnef8.o mne68908.o
 

 

So $(OBJS) is just a macro subsitution with the contents of the OBS variable

 

it would be exactly the same to have the target say...

 

dasm: main.o ops.o globals.o exp.o

...etc

 

So when building target dasm, it first says "hey, I have to build main.o"

So how does it do that?  Well, in this case it looks to see if the main.o file exists... and if it doesn't, then it executes the following indented lines of code.

So they are...

 

    $(CC) $(CFLAGS) $(OBJS) -o dasm $(LDFLAGS)
 

Basically that's doing a build of the dasm file (and as a byproduct the .o files)

Next dependency will already have been made (that is, ops.o exists) so it ends there.

The $(CC) $(CFLAGS) $(OBJS) are replaced with the earlier definitions of these things.

 

 

There's a whole bunch of extra stuff you can have - like 'rules' which tell make how to create different sorts of files. It's powerful.

 

But the above is the essence.  In short, you make a "target".  The target is listed in the makefile with all the dependencies it has.  All of those dependencies are built/met before the target itself is built.  Each of those dependencies may have other dependencies.  You can for example have a .asm file dependent on a .h file.  So anytime the timestamp on the .h file is newer, the .asm file is automatically assembled.  Set up right, you touch any of your source code and all (but only) the required dependent files are assembled.  You split your code into many many source files (if you want) and only build/assemble those ones that absolutely need to be built. And it's all worked out automatically from the rules in the Makefile.  And yes, you can automatically scan source code and generate these dependencies for make to use.

 

Anyway, back to your problem. Still am sure it's a path error but not having my skills on Windows suitable or a machine to even try to test on... can't do much more to assist sorry. At least you have a build going, from src.

 

 

 

  • Like 1
Link to comment
Share on other sites

Yes, making it compile "somehow" was the only thing I tried to achieve. And that works now. 👍 

 

I still think there should be some details given how to compile DASM. Not everyone is an expert in C compilers originating from the ux world. Especially when being used to Visual Studio and Windows. And for the former the learning curve seems to be steep with a lot of bumps. At least that is my (repeated) experience.

 

 

Link to comment
Share on other sites

10 minutes ago, Thomas Jentzsch said:

Yes, making it compile "somehow" was the only thing I tried to achieve. And that works now. 👍 

 

I still think there should be some details given how to compile DASM. Not everyone is an expert in C compilers originating from the ux world. Especially when being used to Visual Studio and Windows. And for the former the learning curve seems to be steep with a lot of bumps. At least that is my (repeated) experience.

 

 

 

I get your point. On the other hand on ANY machine with a properly configured make.... you simply type make from the root directory.

Any problems you are having are, IMHO, your machine is not properly configured.

Link to comment
Share on other sites

For compiling DASM, I loaded it into Jetbrain's CLion IDE, added the files to the CMake (default build system) project file, and built it that way.

 

I've never really understood why nobody's ever taken the time to create an "automatic + easy to use" build system for C/C++.

  • Like 1
Link to comment
Share on other sites

I'm not a regular Windows user either, but I have a Windows VM for testing. I usually use Cygwin when I'm on Windows,but that's because I actually want the pseudo UNIX environment. 🙂

 

Anyway, I downloaded MinGW and installed the dev tools, and used it to compile the latest DASM source from Git. I suspect that the issue @Thomas Jentzsch is having is because it wasn't run through the MSYS shell. On my system, the installer only created an icon for the setup utility itself, and not for MSYS.

 

Here were my steps to compile DASM via MinGW on Windows 64-bit:

 

1) Launch the MSYS shell, located e.g. in c:\mingw\msys\1.0

2) Navigate to your DASM source directory using forward-slashes instead of back-slashes, and leading with the drive letter as if if were a directory. E.g. on my system I put:

cd /c/Users/kgarr/Downloads/dasm-master

3) Set CC=gcc if that is not already part of your user environment (the new shell will inherit your existing environment):

export CC=gcc

4) Type "make" from the root source directory to do the compile.

 

Note that I didn't need to change my PATH or rename the make utility. That was handled by the MSYS shell.

  • Thanks 1
Link to comment
Share on other sites

Thanks, that's really useful information. I did not install that shell, because I avoid the UNIX world. But given the problems I faced, it most likely would have been the better option.

Edited by Thomas Jentzsch
Link to comment
Share on other sites

56 minutes ago, splendidnut said:

I've never really understood why nobody's ever taken the time to create an "automatic + easy to use" build system for C/C++.

This! I think M$ tried to do something like this. But in their usual, convoluted and totally proprietary way.

 

To me the IX community always feels snobbish ("If you are no VI expert and no fan of command line, you do not deserve IX."). Which maybe partially explains why Windows is that successful.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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