-
Notifications
You must be signed in to change notification settings - Fork 73
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
Penthurion
wants to merge
27
commits into
coders-school:main
Choose a base branch
from
Penthurion:master
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Tłumaczenie #2
Changes from all commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
db0ed16
index.html translated
Penthurion 5a5ebda
presentation_cmake.md translated
Penthurion e7538e0
presentation_make.md translated
Penthurion ec9c7bf
presentation_homework.md translated
Penthurion 15cd393
changed filenames
Penthurion 771b819
changed filenames
Penthurion 078211b
merged polish and english branches
Penthurion 1cf7562
first part of minor fixes
Penthurion 6c133e8
2nd part of minor fixes
Penthurion 17bbc9a
deleted _presentation prefix from filenames
Penthurion e799e5f
deleted _presentation prefix from filenames
Penthurion f40e99b
README.md modified to have polish and english versions. Also fixed links
Penthurion e2823aa
deleted Coders School logo from english version
Penthurion 23e1e75
Update module1/index.en.html
Penthurion 328020c
Update module1/index.en.html
Penthurion 68016a3
Update module1/01_make.en.md
Penthurion 7d913f5
Update module1/02_cmake.en.md
Penthurion 2979439
Update module1/index.pl.html
Penthurion cc2c479
Update module1/index.en.html
Penthurion c45393f
Update module1/02_cmake.en.md
Penthurion ce81fdf
fixed problem with mixed english and polish in files
Penthurion d119266
Merge branch 'master' of github.com:Penthurion/cmake
Penthurion 55d3101
fixed polish/english mix problem
Penthurion 864f9fe
fixed filenames linked in index.pl.html
Penthurion f250192
Update module1/index.en.html
Penthurion f0605db
Update module1/index.en.html
Penthurion c533a46
Update module1/index.en.html
Penthurion File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
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.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.