martanne / vis

A vi-like editor based on Plan 9's structural regular expressions
Other
4.19k stars 259 forks source link

build: allow incremental rebuilds #1113

Closed rnpnr closed 10 months ago

rnpnr commented 11 months ago

Its been annoying me for a while that every time I change a single source file I have to rebuild all of them. Now we rebuild only the files that were touched.

This should also make the ci marginally faster since the files can be built in parallel.

TwoF1nger commented 11 months ago

This doesn't detect changes in header files (both Vis own, and system ones). You might want to use the -MD or -MMD gcc options.

I have a similar commit it in my fork - build: incremental compilation

rnpnr commented 11 months ago

I guess I never really bother tracking headers. I'm not really against it though. What do other people think? I've added it as a second commit for now.

mcepl commented 11 months ago

PR has been merged to https://git.sr.ht/~mcepl/vis and although only the Makefile part is relevant (and I have also added https://git.sr.ht/~mcepl/vis/commit/25fe086eb427 for build.sr.ht), it seems to be building and working just fine.

erf commented 10 months ago

I think it happened after this commit that a bunch of .d and .o files are generated on make. Is it possible to avoid this as it clutters up the directory?

rnpnr commented 10 months ago

Is it possible to avoid this as it clutters up the directory?

Yes you are right, fixed here: 4ca7119.

rnpnr commented 10 months ago

fixed here: https://github.com/martanne/vis/commit/4ca711941423a9bdd206b3efb298aa9793682f10.

Oh oops I guess | in make rules is a GNU extension so I broke building on Open/FreeBSD (macOS uses GNU make). I will have to do a separate fix for that.