I'm using gnu make and stow to manage some configurations (dotfiles).
I have multiple directories in my repo:
dotfiles/
├── Makefile
├── package1/
└── package2/
Currently, my Makefile looks like:
PACKAGES = package1 package2
.PHONY: all $(PACKAGES)
all: $(PACKAGES)
package1:
stow --no-fold $@
package2:
stow --no-fold $@
I want to define a default rule for packages, so I did:
PACKAGES = package1 package2
.PHONY: all $(PACKAGES)
all: $(PACKAGES)
%:
stow --no-fold $@
But that didn't work:
$ make
make: Nothing to be done for `all'.
$ make package1
make: Nothing to be done for `package1'.
$ make package2
make: Nothing to be done for `package2'.
So: Is it possible to define a "default" rule for directories? If yes, how I do it?