Re: Makefiles and dub

2022-11-08 Thread Mathias LANG via Digitalmars-d-learn

On Friday, 4 November 2022 at 23:19:17 UTC, Anonymouse wrote:
[#20699](https://issues.dlang.org/show_bug.cgi?id=20699) must 
be non-trivial to fix, so I'm exploring makefiles. If possible 
I'd like to keep dub for dependency management though, just not 
for actual compilation.


That bug is fixed for the last 3 releases (not including the 
current one in progress), that is, since v1.26.0.


Is it at all possible (or even desireable) to construct a 
makefile that builds dependencies from outside of the source 
tree (namely 
`$HOME/.dub/packages/package_with_unknown_version-1.2.[0-9]+/`)?


Does anyone have an example `Makefile` I could dissect?

Thanks.


In the past, I used https://github.com/sociomantic-tsunami/makd 
for building D code.
But it doesn't do dependency management like dub, as it expected 
libraries to be in `submodules/`.


Re: Makefiles and dub

2022-11-05 Thread Guillaume Piolat via Digitalmars-d-learn
On Saturday, 5 November 2022 at 12:17:14 UTC, rikki cattermole 
wrote:


But yes, it has two others (although idk how much they get 
used, or how complete).



Using the first two all the time.
IIRC VisualD projects respect --combined




Re: Makefiles and dub

2022-11-05 Thread Christian Köstlin via Digitalmars-d-learn

On 05.11.22 12:38, rikki cattermole wrote:

We have a few build formats that dub can generate for you automatically:

```
visuald - VisualD project files
sublimetext - SublimeText project file
cmake - CMake build scripts
build - Builds the package directly
```

Unfortunately none of them are make, it would be nice to have that if 
you are looking to contribute!

If cmake works, then cmake could generate a normal makefile :)

Kind regards,
Christian



Re: Makefiles and dub

2022-11-05 Thread rikki cattermole via Digitalmars-d-learn

On 06/11/2022 1:16 AM, Imperatorn wrote:

On Saturday, 5 November 2022 at 11:38:09 UTC, rikki cattermole wrote:

We have a few build formats that dub can generate for you automatically:

```
visuald - VisualD project files
sublimetext - SublimeText project file
cmake - CMake build scripts
build - Builds the package directly
```

Unfortunately none of them are make, it would be nice to have that if 
you are looking to contribute!


Wait, dub can generate all those? I only knew about visuald


build is just dub and doesn't emit any project files.

But yes, it has two others (although idk how much they get used, or how 
complete).


Re: Makefiles and dub

2022-11-05 Thread Imperatorn via Digitalmars-d-learn
On Saturday, 5 November 2022 at 11:38:09 UTC, rikki cattermole 
wrote:
We have a few build formats that dub can generate for you 
automatically:


```
visuald - VisualD project files
sublimetext - SublimeText project file
cmake - CMake build scripts
build - Builds the package directly
```

Unfortunately none of them are make, it would be nice to have 
that if you are looking to contribute!


Wait, dub can generate all those? I only knew about visuald


Re: Makefiles and dub

2022-11-05 Thread rikki cattermole via Digitalmars-d-learn

We have a few build formats that dub can generate for you automatically:

```
visuald - VisualD project files
sublimetext - SublimeText project file
cmake - CMake build scripts
build - Builds the package directly
```

Unfortunately none of them are make, it would be nice to have that if 
you are looking to contribute!


Re: Makefiles and dub

2022-11-04 Thread Steven Schveighoffer via Digitalmars-d-learn

On 11/4/22 7:19 PM, Anonymouse wrote:
[#20699](https://issues.dlang.org/show_bug.cgi?id=20699) must be 
non-trivial to fix, so I'm exploring makefiles. If possible I'd like to 
keep dub for dependency management though, just not for actual compilation.


Is it at all possible (or even desireable) to construct a makefile that 
builds dependencies from outside of the source tree (namely 
`$HOME/.dub/packages/package_with_unknown_version-1.2.[0-9]+/`)?


Does anyone have an example `Makefile` I could dissect?

Thanks.


`dub describe` can give you probably enough information to build a makefile.

And I believe it should do all the dependency fetching when you call it.

-Steve


Re: Makefiles and dub

2022-11-04 Thread H. S. Teoh via Digitalmars-d-learn
On Fri, Nov 04, 2022 at 11:19:17PM +, Anonymouse via Digitalmars-d-learn 
wrote:
> [#20699](https://issues.dlang.org/show_bug.cgi?id=20699) must be
> non-trivial to fix, so I'm exploring makefiles. If possible I'd like
> to keep dub for dependency management though, just not for actual
> compilation.
> 
> Is it at all possible (or even desireable) to construct a makefile
> that builds dependencies from outside of the source tree (namely
> `$HOME/.dub/packages/package_with_unknown_version-1.2.[0-9]+/`)?
> 
> Does anyone have an example `Makefile` I could dissect?
[...]

Don't have a Makefile to show, but I've done the following in the past
when I have dub dependencies but need to use my own build system:

- Create a subdirectory containing a dummy empty dub project (containing
  nothing but an empty main()), whose sole purpose is to declare dub
  dependencies that I need.
- Run dub to retrieve and compile said dependencies, with --vverbose so
  that shows the actual compile commands (for extracting the pathnames
  of the compiled artifacts).
- Copy-n-paste the compiled objects paths into my build system as object
  files / libraries to link against.

In theory, the second step above can be automatically parsed to extract
the needed paths, or even recompile after altering the command-line
options, but I never got that far because I've since shelved the
project (for reasons unrelated to dub).


T

-- 
Holding a grudge is like drinking poison and hoping the other person dies. -- 
seen on the 'Net


Makefiles and dub

2022-11-04 Thread Anonymouse via Digitalmars-d-learn
[#20699](https://issues.dlang.org/show_bug.cgi?id=20699) must be 
non-trivial to fix, so I'm exploring makefiles. If possible I'd 
like to keep dub for dependency management though, just not for 
actual compilation.


Is it at all possible (or even desireable) to construct a 
makefile that builds dependencies from outside of the source tree 
(namely 
`$HOME/.dub/packages/package_with_unknown_version-1.2.[0-9]+/`)?


Does anyone have an example `Makefile` I could dissect?

Thanks.