Skip to content

Tłumaczenie #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 27 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
db0ed16
index.html translated
Penthurion Aug 26, 2020
5a5ebda
presentation_cmake.md translated
Penthurion Aug 26, 2020
e7538e0
presentation_make.md translated
Penthurion Aug 27, 2020
ec9c7bf
presentation_homework.md translated
Penthurion Aug 27, 2020
15cd393
changed filenames
Penthurion Aug 27, 2020
771b819
changed filenames
Penthurion Aug 27, 2020
078211b
merged polish and english branches
Penthurion Aug 27, 2020
1cf7562
first part of minor fixes
Penthurion Aug 27, 2020
6c133e8
2nd part of minor fixes
Penthurion Aug 27, 2020
17bbc9a
deleted _presentation prefix from filenames
Penthurion Aug 27, 2020
e799e5f
deleted _presentation prefix from filenames
Penthurion Aug 27, 2020
f40e99b
README.md modified to have polish and english versions. Also fixed links
Penthurion Aug 27, 2020
e2823aa
deleted Coders School logo from english version
Penthurion Aug 27, 2020
23e1e75
Update module1/index.en.html
Penthurion Aug 27, 2020
328020c
Update module1/index.en.html
Penthurion Aug 27, 2020
68016a3
Update module1/01_make.en.md
Penthurion Aug 27, 2020
7d913f5
Update module1/02_cmake.en.md
Penthurion Aug 27, 2020
2979439
Update module1/index.pl.html
Penthurion Aug 27, 2020
cc2c479
Update module1/index.en.html
Penthurion Aug 27, 2020
c45393f
Update module1/02_cmake.en.md
Penthurion Aug 27, 2020
ce81fdf
fixed problem with mixed english and polish in files
Penthurion Aug 27, 2020
d119266
Merge branch 'master' of github.com:Penthurion/cmake
Penthurion Aug 27, 2020
55d3101
fixed polish/english mix problem
Penthurion Aug 27, 2020
864f9fe
fixed filenames linked in index.pl.html
Penthurion Aug 27, 2020
f250192
Update module1/index.en.html
Penthurion Aug 28, 2020
f0605db
Update module1/index.en.html
Penthurion Aug 28, 2020
c533a46
Update module1/index.en.html
Penthurion Aug 28, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 16 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,22 @@
<img width="500" data-src="coders_school_logo.png" src="coders_school_logo.png" alt="Coders School" class="plain">
</a>

## [Moduł 1](module1/)
## [Moduł 1](module1/index.pl.html)

### [`make`](module1/presentation_make.md)
### [`make`](module1/01_make.pl.md)

### [`cmake`](module1/presentation_cmake.md)
### [`cmake`](module1/02_cmake.pl.md)

### [homework](module1/presentation_homework.md)
### [Zadania domowe](module1/03_homework.pl.md)

___

# Build systems

## [Module 1](module1/index.en.html)

### [`make`](module1/01_make.en.md)

### [`cmake`](module1/02_cmake.en.md)

### [homework](module1/03_homework.en.md)
108 changes: 108 additions & 0 deletions module1/01_make.en.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
<!-- .slide: data-background="#111111" -->

# `make`

<a href="https://coders.school">
<img width="500" data-src="../coders_school_logo.png" alt="Coders School" class="plain">
</a>

___

## Makefiles

### The structure of the Makefile

```Makefile
VARIABLE = value

targetA: dependencyA1 dependencyA2
[TAB] command $(VARIABLE)

targetB: dependencyB1
[TAB] command
```

___

## Example - generating a presentation in LaTeX

```Makefile
TEX = pdflatex -shell-escape -interaction=nonstopmode -file-line-error
MAKE = make
CODE_DIR = src

.PHONY: all view

all: calculator pdf

view:
evince ContractProgramming.pdf

pdf: ContractProgramming.tex
$(TEX) ContractProgramming.tex

calculator:
$(MAKE) -C $(CODE_DIR)
```

___

## Compilation in C ++

### Do you remember the build phases?
<!-- .element: class="fragment fade-in" -->

```Makefile
SOURCES=$(wildcard src/*.cpp)
OBJECTS=$(patsubst %.cpp, %.o, $(SOURCES))

main: $(OBJECTS)
g++ $^ -o $@

$(OBJECTS): src/%.o : src/%.cpp src/%.hpp
g++ -c $< -o $@
```
<!-- .element: class="fragment fade-in" -->

### Variables remembering the context
<!-- .element: class="fragment fade-in" -->

* <!-- .element: class="fragment fade-in" --> <code>$@</code> - the name of the target file in the currently running rule
* <!-- .element: class="fragment fade-in" --> <code>$<</code> - first dependency name
* <!-- .element: class="fragment fade-in" --> <code>$^</code> - list of all dependencies (includes any duplicates)
* <!-- .element: class="fragment fade-in" --> <code>$?</code> - a list of all dependencies that are newer than target

___

## Exercise

In the greeter directory you will find a small program. Familiarize yourself with its code.

* Compile the program from the command line and run it.
* Write a simple Makefile for this program. Build it with `make` and run it.

### Spell of building

```bash
g++ -std=c++17 -Wall -Werror -Wextra -pedantic *.cpp -o greeter
./greeter
```

___

## `make` command

* <!-- .element: class="fragment fade-in" --> by default it looks for a Makefile in the current directory
* <!-- .element: class="fragment fade-in" --> automates activities by executing recipes saved in Makefile files
* <!-- .element: class="fragment fade-in" --> executes the first recipe by default
* <!-- .element: class="fragment fade-in" --> allows for conditional performance of activities
* <!-- .element: class="fragment fade-in" --> allows defining many dependencies
* <!-- .element: class="fragment fade-in" --> by default, it takes into account dependency modification dates and on this basis decides whether to execute a given recipe

___

## Q&A

### links

[cpp-polska.pl](https://cpp-polska.pl/post/potwor-przeszlosci-makefile-cz-2)
File renamed without changes.
Loading