Makefile空白语法背后的原因是什么? [英] What is the reasoning behind the Makefile whitespace syntax?

查看:80
本文介绍了Makefile空白语法背后的原因是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Michael Sparks在伦敦的SO DevDay上出色地介绍了Peter Norvig的Python拼写检查器之后,我正在重新访问Python.

I'm revisiting Python after Michael Sparks's excellent walk through of Peter Norvig's Python spell checker at the SO DevDay in London.

他强调的要点之一就是要看Python多么干净.范围内没有大括号,而是使用空格来表示块范围.

One of the points he highlighted was how clean Python is to look at. Not cluttered with braces for scopes but using white space to indicate block scope instead.

这让我开始思考.我想知道这是否是TAB缩进背后的原因,而TAB缩进是构建目标所需的命令的前提.

This got me thinking. I wonder if that is the reason behind the TAB indentations that are prepended to the commands needed to build a make target.

是否具有相同的清晰度?为了容易地区分目标和构建目标所需的命令?

Was it the same clarity aspect? To readily distinguish between a target and the commands needed to build the target?

推荐答案

引自"Unix编程的艺术"一词:

From "The Art of Unix Programming" comes this quote:

为什么在第1列中使用标签? Yacc是新的,Lex是全新的.我也没有尝试过,所以我认为这是学习的好借口.在被Lex的第一次刺中困扰之后,我只是使用模式newline-tab做了一些简单的事情.它起作用了,它留下了.然后几周后,我的用户数量约为12,其中大多数是朋友,我不想破坏我的嵌入式基础.遗憾的是,其余的就是历史.
-斯图尔特·费尔德曼(Stuart Feldman)
Why the tab in column 1? Yacc was new, Lex was brand new. I hadn't tried either, so I figured this would be a good excuse to learn. After getting myself snarled up with my first stab at Lex, I just did something simple with the pattern newline-tab. It worked, it stayed. And then a few weeks later I had a user population of about a dozen, most of them friends, and I didn't want to screw up my embedded base. The rest, sadly, is history.
-- Stuart Feldman

这篇关于Makefile空白语法背后的原因是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆