As we're moving to the end of the third quarter of the year, more things pop up for me to follow up. Interestingly but not surprisingly, life is as monotonous as ever. Yes, it can be routinely, but that probably the only way, through sheer discipline, to follow through your plans.
The components for setting up my homelab using AMD 5350 have been bought and set up accordingly. The only remaining tasks is to install the necessary OS and configuration. More writeups on this in coming future.
As usual, something I learned this week.
Looking into Makefile, specifically GNU Make. Extracting parameters from target? Yes, is doable but it's not pretty. See code below. If your target is not an actual physical file, make it a '.PHONY' target instead. Otherwise you will encounter "No rule to make target" error. Next, we will need to 'eval' when extracting the assigning the parameters passed, otherwise the 'PARAMS' assignment will be executed as command.
.PHONY: action action: $(eval PARAMS := $(filter-out $@,$(MAKECMDGOALS))) @echo $(PARAMS)
Interestingly, there are four ways for variable assignment in Make. The 'Set If Absent' way of variable declaration and initialization is quite handly. Funny though, Perl, which is known for its brevity, does not have such language construct.
# Lazy Set. Value is expanded and set when used. FOOBAR = x # Immediate Set. Value is set when declared. FOOBAR := x # Set If Absent FOOBAR ?= x # Append FOOBAR += x
Write it down, make it happens. Never underestimate the power of writing. Sometimes, the pen is mightier than the sword.
'git commit --allow-empty'. My goodness! I'm not aware of this option exists in Git. How many times I've adjusted a space just to create and make an empty dummy commit. While we on Git, if you seems to "misuse" it somehow, there are many ways to recover back.