diff options
author | Xiao Pan <gky44px1999@gmail.com> | 2024-06-16 22:57:08 -0700 |
---|---|---|
committer | Xiao Pan <gky44px1999@gmail.com> | 2024-06-16 22:57:08 -0700 |
commit | fe9740317f031ac23272de6467789c9a3e5c65fe (patch) | |
tree | efd064e44e5f4e8ec95823c9be69c0abc584efe3 /Makefile | |
parent | b7b94c17cac1f1a71783c49911d4d11167340752 (diff) |
feat: auto get filenames when make so no need to manually add new filenames
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 12 |
1 files changed, 10 insertions, 2 deletions
@@ -7,8 +7,16 @@ # For a command not to echo itself, prefix @ to the command # https://unix.stackexchange.com/a/740226/459013 -SH = alarm backlight bell ccgp cfg chmodef curlqb dateft dirnameall gita gitfork gitmetap gitmetar gitpu grrc il lastarg loop lsp mll mmi mpra mpva mpvy mvln mvtr mvtu news o orgext pa pq px qg qw rate reco rfp sbar ta time-uuid topa upd vinfo wh wtr xmq prp vip vpn dnd cgm ggm ccp u -PACMAN_HOOKS = setcap-intel_gpu_top.hook setcap-iotop-c.hook setcap-nethogs.hook +# SH = $(wildcard sh/*) will print filenames with sh/ dir (more about wildcard see `info make` ) +# - more make commands maybe able to substitute it to only basename, maybe see https://stackoverflow.com/a/14447924 +# I use `find sh -type f -printf '%f '` which only prints basename +# - note: "SH = $$(...)" seems replace ${SH} with $(...), so everytime I use ${SH}, shell command in $(...) is run once, which is not ideal +# - so I use "SH = $(shell ...)" to only run it once when assign variable +# alternative: `find sh -type f -execdir basename -a '{}' \+` +# busybox find does not support -printf and -execdir, so here's another alternative: `find sh -type f -exec basename -a '{}' \+` +# about $$: https://stackoverflow.com/q/28533059 +SH = $(shell find sh -type f -printf '%f ') +PACMAN_HOOKS = $(shell find pacman_hooks -type f -printf '%f ') PREFIX = /usr/local install: |