Skip to content

Commit 54db424

Browse files
committed
* few tiny gramma fixes
Signed-off-by: Dmitry Ponyatov <[email protected]>
1 parent 469d675 commit 54db424

File tree

1 file changed

+36
-25
lines changed

1 file changed

+36
-25
lines changed

gnu-eprog.asciidoc

+36-25
Original file line numberDiff line numberDiff line change
@@ -1317,15 +1317,15 @@ This file(s) will be created or updated by this make rule.
13171317
`checked for modifications` by last edit time marker.
13181318

13191319
`tab`:: is tabulation char with ascii code 0x09, you must have editor able to
1320-
work with tabs not overwriting them into sequencies of spaces. Make rule can
1321-
have zero rules, or some tabbed compiling commands.
1320+
work with tabs not overwriting them into sequences of spaces. Make rule can
1321+
have zero rules or some tabbed compiling commands.
13221322

13231323
`compiling command`:: any command, like assembly or linker call, which updates
1324-
<target>s, doing some useful job.
1324+
`target`s, doing some useful job.
13251325

1326-
NOTE: Main principle of every makefile rule: if one of <source> files
1327-
`newer` then one of <target> file, rule body will be executed to update
1328-
<target>s.
1326+
NOTE: The main principle of every makefile rule: if one of `source` files
1327+
`newer` then one of `target` file, rule body will be executed to update
1328+
`target` s.
13291329

13301330
Let's write simple makefile for tiny program, described in `Hello ARM` section:
13311331

@@ -1360,13 +1360,13 @@ QEMU 2.1.2 monitor - type 'help' for more information
13601360
------
13611361

13621362
NOTE: If you use make without parameters, `first rule` in Makefile will be
1363-
processed as main <target>, walking over dependencies in all rules.
1363+
processed as main `target`, walking over dependencies in all rules.
13641364

13651365
[[makeseltarget]]
1366-
Selecting specific <target>
1366+
Selecting specific `target`
13671367
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
13681368

1369-
If you need to update only specific <target>, not first rule, put required
1369+
If you need to update only specific `target`, not first rule, put required
13701370
file name after make command:
13711371

13721372
------
@@ -1378,7 +1378,7 @@ This command will build only add.o object file, if and only if you modified add.
13781378
before command run. If you see some message like `make: 'add.o' is up to date.`,
13791379
source file was not changed, and make will not run assembler rule.
13801380

1381-
This is very useful if you have lot of source files (thousands files, like
1381+
This is very useful if you have lot of source files (thousands of files, like
13821382
Linux kernel for example), and fix some bug only in one source file. Without
13831383
make (using simple .rc shell script of .bat ch file) every tiny change in
13841384
source file
@@ -1396,10 +1396,10 @@ arm-none-eabi-as -o add.o add.s
13961396
------
13971397

13981398
`touch` command changes only modification time of source file add.s, not
1399-
chainging it's content, thus `make` will note that file changed, and run
1400-
assembler for selected <target>=add.o.
1399+
changing it's content, thus `make` will note that file changed, and run
1400+
assembler for selected target=add.o.
14011401

1402-
By default, make will print every command and it's output. If you have some
1402+
By default, make will print every command and its output. If you have some
14031403
reason to quiet make logging, you can prefix some compiler commands in make rule
14041404
with "-" minus sign.
14051405

@@ -1413,9 +1413,9 @@ can define some vars in makefile, and use them in all rules.
14131413
Very useful make tip: you can use two special variables: $@ and @<.
14141414

14151415
`$@`:: variable represents left side of Makefile rule, typically single
1416-
<target> file name
1416+
`target` file name
14171417

1418-
`$<`:: variable will be replaced by `first` file if <source> list
1418+
`$<`:: variable will be replaced by `first` file if `source` list
14191419

14201420
NOTE: running make, you can forced redefine any variables values: change
14211421
compiler options, tune rules, and ever use one universal makefile for all
@@ -1425,7 +1425,7 @@ So, we can change our makefile to be more adaptive:
14251425

14261426
------
14271427
# APPlication name, you can change it in make command line parameters
1428-
# to compile other onefile program with same makefile
1428+
# to compile another onefile program with same makefile
14291429
APP = add
14301430
14311431
# some std.variables widely used in Linux source builds:
@@ -1443,7 +1443,7 @@ OBJCOPY = $(TARGET)objcopy
14431443
14441444
# FlashROM size of target system, in 4K block
14451445
FLASHBLOCKS = 4K
1446-
emulation: $(APP).flash
1446+
emu: $(APP).flash
14471447
qemu-system-$(ARCH) -M connex -pflash $< \
14481448
-nographic -serial /dev/null
14491449
@@ -1468,7 +1468,7 @@ Then, we replaced all file parameters in assembler/linker calls with
14681468
Also we used some std.variables to select target system architecture, and
14691469
prefixed all toolchain calls with $(TARGET) variable.
14701470

1471-
NOTE: Now we can compile `other` source file: arrsum.s, contains listing
1471+
NOTE: Now we can compile `another` source file: arrsum.s, contains listing
14721472
of array summation program. We `override APP variable value in command line`:
14731473

14741474
------
@@ -1492,11 +1492,11 @@ QEMU 2.1.2 monitor - type 'help' for more information
14921492
(qemu) q
14931493
------
14941494

1495-
Wow, we compiled other program without any change in Makefile, all file names
1495+
Wow, we compiled another program without any change in Makefile, all file names
14961496
was renamed automatically, we jet get separate flash image and running Qemu
14971497
in one command.
14981498

1499-
Let's dig in details
1499+
Let's dig into details
15001500

15011501
[[makestdvars]]
15021502
Standard make variables
@@ -1549,7 +1549,7 @@ OpenSource developers world have some widely used standard targets:
15491549

15501550
`doc`:: build documentation, using some of asciidoc, DocBook, LaTeX,.. markup
15511551
translators, which will translate doc sources into some widely used document
1552-
format like .html and manual.pdf files. Fortunately you can use special program
1552+
format like .html and manual.pdf files. Fortunately, you can use special program
15531553
packages (for some programming languages like Java, C++,..) which let you
15541554
process your program sources and autogenerate tables of labels, function
15551555
definitions with parameters a.k.a call signatures, source file lists,
@@ -1565,7 +1565,7 @@ make
15651565
------
15661566

15671567
`distclean`:: same as clean with removing generated files going into binary
1568-
distribution of builded program package: .pdf/.html documentation,..
1568+
distribution of built program package: .pdf/.html documentation,..
15691569

15701570
.Recommended Makefile rules
15711571
------
@@ -1586,8 +1586,8 @@ distclean: clean
15861586
.PHONY targets
15871587
~~~~~~~~~~~~~
15881588

1589-
In previous makefile sample you can see `.PHONY some` directives.
1590-
This directives marks <target> is one that is not really the name of a file;
1589+
In previous makefile sample, you can see `.PHONY some` directives.
1590+
This directives marks `target` is one that is not really the name of a file;
15911591
rather it is just `a name for a recipe` to be executed when you make an
15921592
explicit request `make some` command.
15931593

@@ -1599,10 +1599,21 @@ Because the rm command in `clean` rule does not create a file named "clean",
15991599
probably no such file will ever exist. Therefore, the rm command will be
16001600
executed every time you say ‘make clean’.
16011601

1602+
NOTE: You can think about set of phony targets in Makefile as something
1603+
like `command line menu`: you select required action by run `make action`
1604+
16021605
[[makeqemu]]
16031606
Run qemu from `Makefile`
16041607
~~~~~~~~~~~~~~~~~~~~~~~~
16051608

1609+
If you define special `emu` rule:
1610+
------
1611+
.PHONY: emu
1612+
emu: $(APP).flash
1613+
qemu-system-$(ARCH) -M connex -pflash $< \
1614+
-nographic -serial /dev/null
1615+
------
1616+
16061617
[[makefiles]]
16071618
Some file/directory hints
16081619
~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -1636,7 +1647,7 @@ only one ~/universal.makefile for all of your projects.
16361647
Using pattern rules
16371648
~~~~~~~~~~~~~~~~~~~
16381649

1639-
Finaly, let's do some strange thing: define universal pattern rules, which will
1650+
Finally, let's do some strange thing: define universal pattern rules, which will
16401651
assemble, compile and link `any` file with specific extensions.
16411652

16421653
.Makefile pattern rules

0 commit comments

Comments
 (0)