Re: [hackers] [slstatus] Simplify Makefile

2017-09-18 Thread Quentin Rameau
> Dear Laslo, dear Quentin,

Hi Aaron,

> > why not just the following? Thanks for bringing the topic up; for
> > some reason I had in mind that it was necessary to list the
> > dependencies explicitly.  
> 
> I will merge this patch as it has the required dependency on
> slstatus.o and it is generally simpler.
> Thank you very much!

I think you missed some of the points of the patch...

My patched fixed the dependencies on the slstatus object,
there's no need to have all objects depend on util.h,
there's no need to override the inference rule .o:,
the dist target is missing some files.

It's not about apparent “simplicity”, it's about correctness.
Do the right thing!

-- Quentin



[hackers] [slstatus] Get rid of HDR variable || Laslo Hunhold

2017-09-18 Thread git
commit 61e44e894890c1521a01148fbf969cbd4dbb4cae
Author: Laslo Hunhold 
AuthorDate: Mon Sep 18 08:53:19 2017 +0200
Commit: Aaron Marcher 
CommitDate: Mon Sep 18 10:08:51 2017 +0200

Get rid of HDR variable

The HDR variable is used for general purpose headers, which are not
given in this project. arg.h and config.h are only needed for
slstatus.c, not every component $(COM:=.c).

This also fixes a problem introduced in
e04a3853643df1c98a451969d515d8850f138bcc, where config.h is pulled into
the tarball.

diff --git a/Makefile b/Makefile
index 505b526..1a90431 100644
--- a/Makefile
+++ b/Makefile
@@ -5,7 +5,6 @@
 include config.mk
 
 REQ = util
-HDR = arg.h config.h
 COM =\
battery\
cpu\
@@ -30,8 +29,8 @@ COM =\
 all: slstatus
 
 slstatus: slstatus.o $(COM:=.o) $(REQ:=.o)
-slstatus.o: slstatus.c slstatus.h $(HDR) $(REQ:=.h)
-$(COM:=.o): config.mk $(HDR) $(REQ:=.h)
+slstatus.o: slstatus.c slstatus.h arg.h config.h $(REQ:=.h)
+$(COM:=.o): config.mk $(REQ:=.h)
 
 config.h:
cp config.def.h $@
@@ -49,7 +48,7 @@ dist:
rm -rf "slstatus-$(VERSION)"
mkdir -p "slstatus-$(VERSION)"
cp -R LICENSE Makefile README config.mk config.def.h \
- $(HDR) slstatus.c $(COM:=.c) $(REQ:=.c) $(REQ:=.h) \
+ arg.h slstatus.c $(COM:=.c) $(REQ:=.c) $(REQ:=.h) \
  slstatus.1 "slstatus-$(VERSION)"
tar -cf - "slstatus-$(VERSION)" | gzip -c > "slstatus-$(VERSION).tar.gz"
rm -rf "slstatus-$(VERSION)"