Last active
August 29, 2015 14:21
-
-
Save themalkolm/390bb8abc003af0fdee1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Итак, упрощенный вариант для демонстрации чуда. | |
# | |
tmp := $(shell touch a.txt) | |
srcs := $(wildcard *.txt) | |
all: $(srcs) | |
@echo $(srcs) | |
clean: | |
rm -rf *.txt | |
.-(~/Documents/projects/make_wtf)----------------------------------------------------------------------------------------------(malkolm@malkolms-MacBook-Air)- | |
`--> make clean | |
rm -rf *.txt | |
.-(~/Documents/projects/make_wtf)----------------------------------------------------------------------------------------------(malkolm@malkolms-MacBook-Air)- | |
`--> make | |
.-(~/Documents/projects/make_wtf)----------------------------------------------------------------------------------------------(malkolm@malkolms-MacBook-Air)- | |
`--> make | |
a.txt | |
# | |
# Поменяем местами, разницы нет. | |
# | |
srcs := $(wildcard *.txt) | |
tmp := $(shell touch a.txt) | |
all: $(srcs) | |
@echo $(srcs) | |
clean: | |
rm -rf *.txt | |
.-(~/Documents/projects/make_wtf)----------------------------------------------------------------------------------------------(malkolm@malkolms-MacBook-Air)- | |
`--> make clean | |
rm -rf *.txt | |
.-(~/Documents/projects/make_wtf)----------------------------------------------------------------------------------------------(malkolm@malkolms-MacBook-Air)- | |
`--> make | |
.-(~/Documents/projects/make_wtf)----------------------------------------------------------------------------------------------(malkolm@malkolms-MacBook-Air)- | |
`--> make | |
a.txt | |
# | |
# Заменим wildcard на shell, внезапно все работает. | |
# | |
tmp := $(shell touch a.txt) | |
srcs := $(shell echo *.txt) | |
all: $(srcs) | |
@echo $(srcs) | |
clean: | |
rm -rf *.txt | |
.-(~/Documents/projects/make_wtf)----------------------------------------------------------------------------------------------(malkolm@malkolms-MacBook-Air)- | |
`--> make clean | |
rm -rf *.txt | |
.-(~/Documents/projects/make_wtf)----------------------------------------------------------------------------------------------(malkolm@malkolms-MacBook-Air)- | |
`--> make | |
a.txt | |
.-(~/Documents/projects/make_wtf)----------------------------------------------------------------------------------------------(malkolm@malkolms-MacBook-Air)- | |
`--> make | |
a.txt | |
# | |
# Банально поменяем порядок, уже не работает. | |
# | |
srcs := $(shell echo *.txt) | |
tmp := $(shell touch a.txt) | |
all: $(srcs) | |
@echo $(srcs) | |
clean: | |
rm -rf *.txt | |
.-(~/Documents/projects/make_wtf)----------------------------------------------------------------------------------------------(malkolm@malkolms-MacBook-Air)- | |
`--> make clean | |
rm -rf *.txt | |
.-(~/Documents/projects/make_wtf)----------------------------------------------------------------------------------------------(malkolm@malkolms-MacBook-Air)- | |
`--> make | |
make: *** No rule to make target `*.txt', needed by `all'. Stop. | |
.-(~/Documents/projects/make_wtf)----------------------------------------------------------------------------------------------(malkolm@malkolms-MacBook-Air)- | |
`--> make | |
a.txt | |
# | |
# Судя по всему shell & wildcard вычисляются на разных стадиях. | |
# |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment