Skip to content

Commit

Permalink
README: fixing grammatical errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
Nuno-Jesus committed Aug 1, 2023
1 parent 7aad35f commit 019d947
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -920,9 +920,9 @@ This is the number: 42

What if you were to change the `NUMBER` macro to `24`? Have you tried to `make` and run `a.out` after? To your surprise, the output is exacly the same. Why?

Well, as I explained in section [4.1](#index-4.1), `make` will remake a target if it notices its dependencies have a newer version. So, our Makefile cannot rely on the depedencies it doesn't know about, like `header.h`.
Well, as I explained in section [4.1](#index-4.1), `make` will remake a target if it notices its dependencies have a newer version. So, our Makefile cannot rely on the dependencies it doesn't know about, like `header.h`.

A naive solution would be to add `header.h` as dependency to `$(NAME)`:
A naive solution would be to add `header.h` as a dependency to `$(NAME)`:

```Makefile
...
Expand All @@ -938,15 +938,15 @@ $(NAME): $(OBJS) $(HEADERS)
...
```

It does fix the issue, but its only a band-aid. We have yet another issue:
It does fix the issue, but it's only a band-aid. We have yet another issue:

Changing `header.h` only forces the final linking of all object files...

```sh
cc -Wall -Werror -Wextra main.o -o a.out
```

..., but it won't force recompilation of `.c` files.
..., but it won't force the recompilation of `.c` files.


We could manually add a rule that specifies what files `main.o` depends on, which also solves the issue, but this is not very scalable.
Expand Down Expand Up @@ -1053,7 +1053,7 @@ Compiling with DEBUG=-g

## <a name="functions">A4 - Functions</a>

This starts to look a lot like C right? Now we have functions and they are very similar! Functions take parameters that are processed depending on the behaviour of the function. The result of that function is later returned and replaced wherever the function call happened.
This starts to look a lot like C right? Now we have functions and they are very similar! Functions take parameters that are processed depending on the behavior of the function. The result of that function is later returned and replaced wherever the function call happened.

### <a name="functions-1">A4.1 - Functions Call Syntax</a>

Expand Down Expand Up @@ -1358,7 +1358,7 @@ $(foreach var,list,text)

For each word in `list`, `var` takes its value and gets transformed according to whatever is expanded on `text`. Both `var` and `list` are expanded before any transformation is applied. The `var` field contains the name of a temporary variable used to reference each word inside `list`. This variable becomes undefined outside the `foreach` call.

Text is expanded as many times as there are whitespaced-separated words in `list`. The multiple expansions are then concatenated with a single space to produce the final result.
`Text` is expanded as many times as there are whitespace-separated words in `list`. The multiple expansions are then concatenated with a single space to produce the final result.

The following example replicates the `addprefix` example, saved on [code/24-foreach-example](code/24-foreach-example):

Expand Down

0 comments on commit 019d947

Please sign in to comment.