Jump to content
IGNORED

In dasm, how do I correctly specify an include directory, located at a different directory inside the file's parent directory (relative path), from the command line?


Recommended Posts

I'm using dasm 2.20.14.1 and Ubuntu 22.04.

 

I don't want to copy vcs.h and macro.h in multiple directories, so I want them to stay in a specific directory where other files can include them. Something like this structure, where all asm files include vcs.h and macro.h from the same directory:

 

├── includes
│   ├── macro.h
│   └── vcs.h
└── source
    ├── program-1.asm
    ├── program-2.asm
    └── program-3.asm

 

So I checked the docs. They say:

 

Quote

- Idirectory


This adds the directory to the search path dasm uses when looking for files when it encounters INCLUDE and INCBIN directives. Use of this option on the command line is equivalent to an INCDIR directive placed at the beginning of the source file.


See INCDIR for the format of the directory name

 

Seems that -Idirectory is just what I wanted, just needed to see how to specify relative paths.

 

So I went to check INCDIR for the format of the directory name, but there's not much info about it:

 

Quote

INCDIR " directory "


Add the given directory name to the list of places where INCLUDE and INCBIN search their files. Multiple directories can be added through multiple INCDIR commands. When the other includes directives look for files, first the names are tried relative to the current directory, if that fails and the name is not an absolute pathname, the directory list is tried. You can optionally end the directory name with a /.

 

AmigaDOS filename conventions imply that two slashes at the end of a directory indicates the parent directory, and so this does an INCLUDE "/directory".


The command-line option -Idirectory is equivalent to an INCDIR "directory" directive placed at the beginning of the source file.


The directory list is not cleared between passes, but each exact directory
name is added to the list only once

 

It just says that it uses AmigaDOS filename conventions? And I can't find for the life of me how relative paths are described in AmigaDOS format?

 

I tried things like

 

-I../includes

-I./../includes

 

But nothing like that works.

 

How do I correctly specify an include directory that is located in a different directory inside the parent directory, from the command line? How do I correctly specify relative paths when using the the -I option?

 

Link to comment
Share on other sites

8 hours ago, RobertMorombo said:

How do I correctly specify an include directory that is located in a different directory inside the parent directory, from the command line? How do I correctly specify relative paths when using the the -I option?

The following should work. Note that the file you are assembling is specified before the options.

 

dasm program-1.asm -I../includes -f3 -oprogram-1.bin

 

Edited by JetSetIlly
  • Like 1
  • Thanks 1
Link to comment
Share on other sites

4 hours ago, JetSetIlly said:

The following should work. Note that the file you are assembling is specified before the options.

 

dasm program-1.asm -I../includes -f3 -oprogram-1.bin

 

I thought I tried that several times and it didn't work. I thought I was messing up the relative path formatting. But I just tried and it worked! I created this account and waited for approval exclusively because I gave up trying for hours. I'm not sure what I was doing wrong anymore, I was probably too tired. This is embarrassing lol!

 

Thank you very much for your help!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

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