[hackers] [slstatus] Get rid of HDR variable || Laslo Hunhold
commit 61e44e894890c1521a01148fbf969cbd4dbb4cae Author: Laslo HunholdAuthorDate: 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)"
Re: [hackers] [slstatus] Simplify Makefile
> 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] Simplify Makefile || Laslo Hunhold
commit f56e50a2694e92d972a060d71b2f80c72fd23365 Author: Laslo HunholdAuthorDate: Sun Sep 17 23:48:11 2017 +0200 Commit: Aaron Marcher CommitDate: Mon Sep 18 08:47:54 2017 +0200 Simplify Makefile diff --git a/Makefile b/Makefile index d657981..505b526 100644 --- a/Makefile +++ b/Makefile @@ -31,26 +31,7 @@ all: slstatus slstatus: slstatus.o $(COM:=.o) $(REQ:=.o) slstatus.o: slstatus.c slstatus.h $(HDR) $(REQ:=.h) - -battery.o: battery.c config.mk $(HDR) $(REQ:=.h) -cpu.o: cpu.c config.mk $(HDR) $(REQ:=.h) -datetime.o: datetime.c config.mk $(HDR) $(REQ:=.h) -disk.o: disk.c config.mk $(HDR) $(REQ:=.h) -entropy.o: entropy.c config.mk $(HDR) $(REQ:=.h) -hostname.o: hostname.c config.mk $(HDR) $(REQ:=.h) -ip.o: ip.c config.mk $(HDR) $(REQ:=.h) -kernel_release.o: kernel_release.c config.mk $(HDR) $(REQ:=.h) -keyboard_indicators.o: keyboard_indicators.c config.mk $(HDR) $(REQ:=.h) -load_avg.o: load_avg.c config.mk $(HDR) $(REQ:=.h) -num_files.o: num_files.c config.mk $(HDR) $(REQ:=.h) -ram.o: ram.c config.mk $(HDR) $(REQ:=.h) -run_command.o: run_command.c config.mk $(HDR) $(REQ:=.h) -swap.o: swap.c config.mk $(HDR) $(REQ:=.h) -temperature.o: temperature.c config.mk $(HDR) $(REQ:=.h) -uptime.o: uptime.c config.mk $(HDR) $(REQ:=.h) -user.o: user.c config.mk $(HDR) $(REQ:=.h) -volume.o: volume.c config.mk $(HDR) $(REQ:=.h) -wifi.o: wifi.c config.mk $(HDR) $(REQ:=.h) +$(COM:=.o): config.mk $(HDR) $(REQ:=.h) config.h: cp config.def.h $@
Re: [hackers] [slstatus] Simplify Makefile
Dear Laslo, dear Quentin, 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! Regards, Aaron -- Web: https://drkhsh.at/ or http://drkhsh5rv6pnahas.onion/ Gopher: gopher://drkhsh.at or gopher://drkhsh5rv6pnahas.onion GPG: 0x09e71697435bf54b Fingerprint: 57D2 5F2C 9402 A6BD FEF9 B3B6 09E7 1697 435B F54B
Re: [hackers] [slstatus] Fix missing config.h in Makefile
Hi Quentin, thank you very much. Forgot that. Regards, Aaron -- Web: https://drkhsh.at/ or http://drkhsh5rv6pnahas.onion/ Gopher: gopher://drkhsh.at or gopher://drkhsh5rv6pnahas.onion GPG: 0x09e71697435bf54b Fingerprint: 57D2 5F2C 9402 A6BD FEF9 B3B6 09E7 1697 435B F54B
[hackers] [slstatus] Fix missing config.h in Makefile || Quentin Rameau
commit e04a3853643df1c98a451969d515d8850f138bcc Author: Quentin RameauAuthorDate: Sun Sep 17 22:31:26 2017 +0200 Commit: Aaron Marcher CommitDate: Mon Sep 18 08:32:30 2017 +0200 Fix missing config.h in Makefile diff --git a/Makefile b/Makefile index d690612..d657981 100644 --- a/Makefile +++ b/Makefile @@ -5,7 +5,7 @@ include config.mk REQ = util -HDR = arg.h +HDR = arg.h config.h COM =\ battery\ cpu\ @@ -52,6 +52,9 @@ user.o: user.c config.mk $(HDR) $(REQ:=.h) volume.o: volume.c config.mk $(HDR) $(REQ:=.h) wifi.o: wifi.c config.mk $(HDR) $(REQ:=.h) +config.h: + cp config.def.h $@ + .o: $(CC) -o $@ $(LDFLAGS) $< $(COM:=.o) $(REQ:=.o) $(LDLIBS)