Commit Graph

42 Commits

Author SHA1 Message Date
Laslo Hunhold 81d5b427cb Don't explicitly list each component-target
I made a mistake while reading the Posix spec. In fact, the implicit
prerequisite imposed by the .c.o-rule is evaluated as expected, even if
the .c is not given in the target rule.

This partially reverts 0efd64ffaa.
2018-05-29 21:25:39 +02:00
Laslo Hunhold cd884c2f0a Fix object order and stop using a GNU make idiom 2018-05-28 16:16:20 +02:00
Laslo Hunhold 0efd64ffaa 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.

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.
2018-05-27 22:55:15 +02:00
Aaron Marcher c28643ce5b Revert "Add basic backlight percentage support"
On OpenBSD the backlight percentage cannot be retrieved in a simple way.
The only two solutions we are aware of for now are:

 - reading from /dev/ttyC0: which isn't possible without changing
 permissions or running slstatus as root
 - linking against xcb-xrandr: which is bloat and does not work in every
 case appearently

This reverts commit 37724ac2c3 for now.
2018-05-27 16:46:03 +02:00
Michael Buch 943b42de05 Add keymap component
Adding a new keymap component that will
indicate the current keyboard layout (language)
and variant if any was set. I use the
standard X11 XKB APIs to retrieve and parse
the xkb_symbols set with setxkbmap.
2018-05-23 10:09:13 +02:00
David Demelier 37724ac2c3 Add basic backlight percentage support
At the moment linux only, but will add support for OpenBSD as well.
2018-05-22 12:40:31 +02:00
Aaron Marcher 0d05b3d13d Add network speed functions 2018-05-19 00:31:33 +02:00
Laslo Hunhold 24b663d657 Tweak build system a little bit
Be consistent with brackets and add a comment for OpenBSD to make it
clearer what the actual intent of the uncommented line is.

In the Makefile, add a dependency of slstatus.o from config.mk.
2018-05-01 20:53:27 +02:00
Laslo Hunhold 42edfea89a Revert component-split
this reverts the commits from 92ab9ef52e up to
d42870d6ca.

After heavy consideration, the component split has more disadvantages
than advantages, especially given there will be utility-functions
sharing quite a lot of code that would then need to be duplicated, as it
does not fit into the util.c due to its speciality.

One big advantage of the component-wise build is readability, and
without doubt, this was achieved here. This point will be addressed
with a different approach that will be visible in the upcoming commits.

One big disadvantage of the component build is the fact that it
introduces state to the build process which is not necessary. Before its
introduction, the only influencing factors where the system-defines
__linux__ and __OpenBSD__. With the components, we are also relying on
the output of uname(1).
Additionally, if the os.mk is not present, make gives the output

     $ make
     Makefile:5: os.mk: No such file or directory
     make: *** No rule to make target 'os.mk'.  Stop.

This could easily be fixed by providing some sort of meta-rule for this
file, however, it indicates the problem we have here, and this entire
statefulness will heavily complicate packaging of this tool and makes
the build process much more complex than it actually has to be.
2018-05-01 19:43:34 +02:00
Quentin Rameau d42870d6ca Makefile: add distclean target 2018-04-30 16:27:07 +02:00
Quentin Rameau 2ea3d46f13 Makefile: move OS-specific libs to configure script 2018-04-30 16:27:07 +02:00
Quentin Rameau 95665e437b Makefile: separate default flags from user flags 2018-04-30 16:27:07 +02:00
Quentin Rameau 97ff66522c wifi: OS split 2018-04-30 15:42:16 +02:00
Quentin Rameau 19f3c8f545 uptime: OS split 2018-04-30 15:42:08 +02:00
Quentin Rameau 71eb1d321d temperature: OS split 2018-04-30 15:42:00 +02:00
Quentin Rameau 72f5a0d69a swap: OS split 2018-04-30 15:41:52 +02:00
Quentin Rameau 259e106b4f ram: OS split 2018-04-30 15:41:43 +02:00
Quentin Rameau 3cc649e34c entropy: OS split 2018-04-30 15:41:31 +02:00
Quentin Rameau f088dbfea0 cpu: OS split 2018-04-30 15:41:09 +02:00
Quentin Rameau 720569bd56 battery: OS split 2018-04-30 15:40:59 +02:00
Quentin Rameau 92ab9ef52e Makefile: detect running OS 2018-04-30 15:40:20 +02:00
Laslo Hunhold 7246dc4381
Move components into dedicated subdirectory
This brings us a lot more tidiness.
2017-09-24 17:20:27 +02:00
Laslo Hunhold 61e44e8948
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
e04a385364, where config.h is pulled into
the tarball.
2017-09-18 10:08:51 +02:00
Laslo Hunhold f56e50a269
Simplify Makefile 2017-09-18 08:47:54 +02:00
Quentin Rameau e04a385364
Fix missing config.h in Makefile 2017-09-18 08:32:30 +02:00
Laslo Hunhold eea99fc0ac
Rewrite Makefile to accomodate file split 2017-09-17 17:37:49 +02:00
Aaron Marcher aa17443013
Added Makefile target for distribution tarballs. 2017-08-13 23:05:22 +02:00
Laslo Hunhold 8dad4910bf
Refactor build system 2017-08-10 22:32:14 +02:00
Aaron Marcher 3f976aabc0
Makefile fix and vol_perc fix for mute 2017-01-09 12:05:29 +01:00
Aaron Marcher a3cb24c438
simplified Makefile 2017-01-09 09:29:58 +01:00
Aaron Marcher 09c3ffe33b
small Makefile tweak 2017-01-09 09:23:17 +01:00
Aaron Marcher bb87736518
Makefile: Added back config.h handling in Makefile 2017-01-09 09:21:18 +01:00
Aaron Marcher 98d655c8d0
Makefile: Fixes #35 2017-01-09 08:24:26 +01:00
Aaron Marcher d1915f0d4d
saner makefile: cleaner, simpler, suckless 2017-01-07 21:49:10 +01:00
Aaron Marcher 8fa6229759
why releases for such a small project? useless and overhead! 2016-12-29 23:36:05 +01:00
Aaron Marcher 4a7aba5151 added man page 2016-09-17 22:51:49 +02:00
Aaron Marcher 6edc959933 do not overwrite config.h if config.def.h changes 2016-09-14 11:08:37 +02:00
Ali H. Fardan 720328cef9 what kind of weed is that? 2016-09-05 02:17:30 +03:00
Ali H. Fardan 9fa858daea added a tool for resetting the status bar && worked around some issues && removed the makefile (we need a better one) 2016-09-05 01:13:48 +03:00
Daniel Walter 410ba38a01 make config.h target depending on config.def.h 2016-03-10 11:55:12 +01:00
Aaron Marcher 864f2246b5 added config.def.h handling and fixed typo 2016-03-04 18:36:47 +01:00
Aaron Marcher 94ea78f0fe initial commit 2016-03-04 18:07:42 +01:00