Re: [hackers] [slstatus] Explicitly list component-objects in the Makefile || Laslo Hunhold
On Sun, May 27, 2018 at 1:55 PM wrote: > commit 0efd64ffaa04715eff9c834c437562952c4531cd > Author: Laslo Hunhold > AuthorDate: Sun May 27 22:40:00 2018 +0200 > Commit: Aaron Marcher > CommitDate: Sun May 27 22:55:15 2018 +0200 > Explicitly list component-objects in the Makefile > There was a long tinkering process at farbfeld about this, but the sad > truth is that it's the only way to make the Makefile truly portable. > Listing it just as > $(COM:=.o): config.mk $(REQ:=.h) > omits the dependency on the c-file itself, which incurs that strictly > speaking the object file is not depending on the source file, which is > nonsense. That is not true. The .o already depends on the .c and a target with prerequisites but no commands just adds to the list of prerequisites for that target.
Re: [hackers] [slstatus] Explicitly list component-objects in the Makefile || Laslo Hunhold
On Mon, 28 May 2018 15:54:54 +0200 Tobias Tschinkowitzwrote: Hey Tobias, > After this changes i cannot build on OpenBSD anymore > > It fails with: > > "Using $< in a non-suffix rule context is a GNUmake idiom (Makefile: > 63)" yes, I have cooked a patch to fix this earlier. The order of the arguments was also not correct, leading to build problems on very pedantic linkers (as buf[] is defined in slstatus.c and thus it needs to come last, if I'm not mistaken). With best regards Laslo -- Laslo Hunhold >From bca1bff2e743897809be34d665f0571458e6e8d7 Mon Sep 17 00:00:00 2001 From: Laslo Hunhold Date: Mon, 28 May 2018 15:58:28 +0200 Subject: [PATCH] Fix object order and stop using a GNU make idiom --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 8c6f170..5756418 100644 --- a/Makefile +++ b/Makefile @@ -60,7 +60,7 @@ config.h: cp config.def.h $@ slstatus: slstatus.o $(COM:=.o) $(REQ:=.o) - $(CC) -o $@ $(LDFLAGS) $< $(COM:=.o) $(REQ:=.o) $(LDLIBS) + $(CC) -o $@ $(LDFLAGS) $(COM:=.o) $(REQ:=.o) slstatus.o $(LDLIBS) clean: rm -f slstatus slstatus.o $(COM:=.o) $(REQ:=.o) -- 2.17.0
Re: [hackers] [slstatus] Explicitly list component-objects in the Makefile || Laslo Hunhold
>$(COM:=.o): config.mk $(REQ:=.h) > > omits the dependency on the c-file itself, which incurs that strictly > speaking the object file is not depending on the source file, which is > nonsense. Come on... This is suckless, read and try understanding the standard. > You don't see strictly Posix compliant Makefiles around very often and > most use nasty GNU-extensions everywhere. It is a good idea to go ahead > as a fitting example and show how to write them portably. Stop sounding like an evangelist, spreading nonsense.