Re: [hackers] [farbfeld] Mark explicit dependency on requisites for BIN || Laslo Hunhold

From: Lucas Gabriel Vuotto <lvuotto92_AT_gmail.com>
Date: Sat, 1 Apr 2017 00:49:15 -0300

Hi,

On 30/03/17 04:29, git_AT_suckless.org wrote:
> commit d0ce307972fbc95073666e92043fc7012ffbefdf
> Author: Laslo Hunhold <dev_AT_frign.de>
> AuthorDate: Thu Mar 30 09:29:06 2017 +0200
> Commit: Laslo Hunhold <dev_AT_frign.de>
> CommitDate: Thu Mar 30 09:29:06 2017 +0200
>
> Mark explicit dependency on requisites for BIN
>
> diff --git a/Makefile b/Makefile
> index e1e954d..1f7446f 100644
> --- a/Makefile
> +++ b/Makefile
> _AT_@ -13,11 +13,13 @@ MAN5 = farbfeld.5
>
> all: $(BIN)
>
> -.o: $(REQ:=.o)
> - $(CC) $(LDFLAGS) $($*-LDFLAGS) -o $_AT_ $< $(REQ:=.o)
> +$(BIN): $(REQ:=.o)
>
> $(BIN:=.o): config.mk $(HDR) $(REQ:=.h)
>
> +.o: $(REQ:=.o)
> + $(CC) $(LDFLAGS) $($*-LDFLAGS) -o $_AT_ $< $(REQ:=.o)

This is a recipe for the file `.o'. I'm certain that you don't want to
do that.

Also, expanding macros inside macros produces undefined results. The
proposed patch by Quentin is correct solution [0].

> +
> clean:
> rm -f $(BIN) $(BIN:=.o) $(REQ:=.o)
>
>

Beside that, you're overriding CC in config.mk with a non-standard
binary and compiling against c89 for some reason. That goes against the
idea of making the Makefile POSIX imo.

I suggest you either do as Hiltjo says and revert everything or make the
build system completely POSIX. Right now, it's an ugly hybrid.

Cheers.

--
[0]: http://lists.suckless.org/hackers/1703/14849.html
-- lv.
Received on Sat Apr 01 2017 - 05:49:15 CEST

This archive was generated by hypermail 2.3.0 : Sat Apr 01 2017 - 06:00:19 CEST