The document discusses what a Makefile is and why it is useful to use one. A Makefile defines dependencies between source files and specifies the build process or commands that are executed to build targets. It allows automating compiling and building projects by running make commands. Key benefits mentioned are that it saves time and makes the build process easier by handling dependencies and only rebuilding what is necessary.
2. CO TO JE?CO TO JE?
soubor, který:
určuje postup utility make při překladu a
definuje závislosti mezi zdrojovými soubory
CC=gcc
CFLAGS=-I.
DEPS = hellomake.h
%.o: %.c $(DEPS)
$(CC) -c -o $@ $< $(CFLAGS)
hellomake: hellomake.o hellofunc.o
$(CC) -o hellomake hellomake.o hellofunc.o
3. CO TO JE MAKE?CO TO JE MAKE?
Program make je utilita pro automatizaci překladu
zdrojových kódů do binárních souborů
https://cs.wikipedia.org/wiki/Make
8. TATO PREZENTACETATO PREZENTACE
...
reveal: ## reveal-md presentation
@/home/ikar/ctvrtkon/node_modules/.bin/reveal-md
--host 0.0.0.0
--watch
--theme white
--port 2019
README.md
$ make reveal
Reveal-server started at http://0.0.0.0:2019
15. EXPORT DO PDFEXPORT DO PDF
...
pdf:
@/home/ikar/ctvrtkon/node_modules/.bin/reveal-md
--print ctvrtkon.pdf
README.md
$ time make pdf
Attempting to print "README.md?print-pdf"
to filename "ctvrtkon.pdf" as PDF.
real 0m2,089s
user 0m1,287s
sys 0m0,191s
16. EXPORT DO PDFEXPORT DO PDF
...
pdf: ctvrtkon.pdf
@echo "Done ✓"
ctvrtkon.pdf: README.md
@/home/ikar/ctvrtkon/node_modules/.bin/reveal-md
--print ctvrtkon.pdf
README.md
$ time make pdf
Done ✓
real 0m0,007s
user 0m0,004s
sys 0m0,003s
18. NPM / YARN INSTALLNPM / YARN INSTALL
$ time make install
yarn install v1.12.3
[1/4] Resolving packages...
success Already up-to-date.
Done in 0.28s.
All deps satisfied!
real 0m0,723s
user 0m0,770s
sys 0m0,050s
$ time make install
All deps satisfied!
real 0m0,007s
user 0m0,007s
sys 0m0,000s
19. TATO PREZENTACETATO PREZENTACE
...
reveal: install run ## reveal-md presentation
run:
@/home/ikar/ctvrtkon/node_modules/.bin/reveal-md
--host 0.0.0.0 --watch --theme white --port 2019
README.md
install: .yarn.success
@echo "All deps satisfied!"
...
$ make reveal
All deps satisfied!
Reveal-server started at http://0.0.0.0:2019