Skip to content

Commit

Permalink
Update Makefile for workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
OrdoFlammae committed Sep 16, 2024
1 parent 5d3b502 commit 3dbc09c
Show file tree
Hide file tree
Showing 14 changed files with 16 additions and 23 deletions.
6 changes: 3 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
book.html
book.pdf
book.epub
public/book.pdf
public/book.epub
public/index.html

header.log

Expand Down
27 changes: 10 additions & 17 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
BUILD_DIR = public

CSS = book.css
HTML_TEMPLATE = template.html
TEX_HEADER = header.tex
Expand All @@ -10,34 +12,25 @@ CHAPTERS = title.txt introduction.md environment_and_booting.md \
BIB = bibliography.bib
CITATION = citation_style.csl

all: book.html book.pdf book.epub
.PHONY: all release

all: $(BUILD_DIR)/index.html $(BUILD_DIR)/book.pdf $(BUILD_DIR)/book.epub

book.epub: $(CHAPTERS) $(CSS) $(TEX_HEADER) $(BIB) $(CITATION)
$(BUILD_DIR)/book.epub: $(CHAPTERS) $(BUILD_DIR)/$(CSS) $(TEX_HEADER) $(BIB) $(CITATION)
pandoc -s -f markdown+smart --toc --toc-depth=2 -H $(TEX_HEADER) --top-level-division=chapter \
--epub-cover-image=images/cover.jpg --css=$(CSS) \
--epub-cover-image=public/images/cover.jpg --css=$(BUILD_DIR)/$(CSS) \
--bibliography $(BIB) --csl $(CITATION) \
$(CHAPTERS) -o $@

book.html: $(CHAPTERS) $(CSS) $(HTML_TEMPLATE) $(BIB) $(CITATION)
$(BUILD_DIR)/index.html: $(CHAPTERS) $(BUILD_DIR)/$(CSS) $(HTML_TEMPLATE) $(BIB) $(CITATION)
pandoc -s -f markdown+smart -t html --toc -c $(CSS) --template $(HTML_TEMPLATE) \
--bibliography $(BIB) --csl $(CITATION) --number-sections \
$(CHAPTERS) -o $@

book.pdf: $(CHAPTERS) $(TEX_HEADER) $(BIB) $(CITATION)
$(BUILD_DIR)/book.pdf: $(CHAPTERS) $(TEX_HEADER) $(BIB) $(CITATION)
pandoc --toc -H $(TEX_HEADER) --pdf-engine=pdflatex --top-level-division=chapter \
--no-highlight --bibliography $(BIB) --csl $(CITATION) \
$(CHAPTERS) -o $@

ff: book.html
firefox book.html

release: book.html book.pdf book.epub
mkdir -p ../littleosbook/images
cp images/*.png ../littleosbook/images/
cp book.epub ../littleosbook/
cp book.pdf ../littleosbook/
cp book.html ../littleosbook/index.html
cp book.css ../littleosbook/

clean:
rm -f book.pdf book.html book.epub
rm -f $(BUILD_DIR)/index.html $(BUILD_DIR)/book.pdf $(BUILD_DIR)/book.epub
2 changes: 1 addition & 1 deletion environment_and_booting.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ chain of small programs, each one more "powerful" than the previous one, where
the operating system is the last "program". See the following figure for an
example of the boot process:

![An example of the boot process. Each box is a program.](images/boot_chain.png)
![An example of the boot process. Each box is a program.](public/images/boot_chain.png)

### BIOS
When the PC is turned on, the computer will start a small program that adheres
Expand Down
2 changes: 1 addition & 1 deletion paging.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ figure, with just the page table step removed. It is possible to mix 4 MB and 4
KB pages.

![Translating virtual addresses (linear addresses) to physical addresses.
](images/intel_4_2_linear_address_translation.png)
](public/images/intel_4_2_linear_address_translation.png)

The 20 bits pointing to the current PDT is stored in the register `cr3`. The
lower 12 bits of `cr3` are used for configuration.
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes
2 changes: 1 addition & 1 deletion segmentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ the physical memory can be accessed. (See the chapter ["Paging"](#paging) for
how to enable paging.)

![Translation of logical addresses to linear addresses.
](images/intel_3_5_logical_to_linear.png)
](public/images/intel_3_5_logical_to_linear.png)

To enable segmentation you need to set up a table that describes each segment -
a _segment descriptor table_. In x86, there are two types of descriptor tables:
Expand Down

0 comments on commit 3dbc09c

Please sign in to comment.