/notes/Makefile (15438e84dd50bef62c0b893731d965307ce80692) (4698 bytes) (mode 100644) (type blob)

#########################
# Tutorials on Makefile #
#########################

# http://www.gnu.org/software/make/manual/make.html
# http://nuclear.mutantstargoat.com/articles/make/


###########################
# Makefile global options #
###########################

MAKEFLAGS:= -j
# Maximize parallel execution whenever possible
OPTIONSPANDOC:= --toc --filter pandoc-numbering --citeproc --filter pandoc-include-code --top-level-division=chapter -M date="$$(LANG=en_us_88591 date '+%B  %e, %Y (%r)')" --lua-filter filters/default-code-class.lua -M default-code-class=sqlmysql
# Options common to all invokations of pandoc. Cf https://pandoc.org/MANUAL.html to understand them.
# -citeproc used to be --filter pandoc-citeproc
OPTIONSPANDOCODT:= $(OPTIONSPANDOC) --default-image-extension=svg 
OPTIONSPANDOCHTML:= $(OPTIONSPANDOC) --css=style/style.css -B style/foldable_toc.html -B style/anchors_header.html -A style/anchors_footer.html --section-divs --toc-depth=2 --self-contained --default-image-extension=svg
OPTIONSPANDOCPDF:= $(OPTIONSPANDOC) --pdf-engine=xelatex --pdf-engine-opt=-shell-escape -V links-as-notes --default-image-extension=pdf
# Options for (respectively) the odt, html and pdf outputs.
.DEFAULT_GOAL:= all
# By default, we construct all the files.
FIG_FOLDER = fig/*/
# Folder where source code for figures are present.
FIG_SOURCE = $(FIG_FOLDER)*.tex
# Source code for figures
FIG_PDF = $(FIG_FOLDER)*.pdf
# Figures in pdf format
JAVA_CODE = code/java/*.java
# Java source code
SQL_CODE = code/sql/*.sql
# SQL source code


#########
# Rules #
#########

# "Phony" rule to compile the figures into pdf using latexmk
# This must be run before compiling the pdf.

.PHONY: fig $(FIG_SOURCE)
fig: $(FIG_SOURCE)
$(FIG_SOURCE):
	latexmk -silent -cd -pdf $@
# latexmk automates and simplifies the latex compilation of the figures.

# "Phony" rule to convert the pdf figures to svg (for better integration in htm and odt output).
# This must be run before compiling the odt or html.

.PHONY: fig_svg $(FIG_PDF)
fig_svg: $(FIG_PDF)
$(FIG_PDF): $(FIG_SOURCE)
# $(FIG_SOURCE) is an "order-only" pre-requisite. Cf. http://www.gnu.org/software/make/manual/make.html#Types-of-Prerequisites
# This means that we force fig to be executed before executing fig_svg
	pdf2svg $@ $(addsuffix .svg,$(basename $@))
# To understand this syntax, cf. https://www.gnu.org/software/make/manual/html_node/File-Name-Functions.html#File-Name-Functions

###
# Rule for the lecture notes.
###

# Rule to compile to html

html: lectures_notes.md
	pandoc $(OPTIONSPANDOCHTML) -o lectures_notes.html $<


# Rule to compile to odt

odt: lectures_notes.md
	pandoc $(OPTIONSPANDOCODT) -o lectures_notes.odt $<


# Rule to compile to pdf

pdf: lectures_notes.md
	pandoc $(OPTIONSPANDOCPDF) -o lectures_notes.pdf $<

###
# Rule for the example.md file, to test your installation.
###

example: example.md
	latexmk -silent -cd -pdf fig/er/abstract.tex fig/fd/course.tex fig/misc/schema_design.tex fig/rel_mod/actor.tex fig/uml_class/hand.tex fig/uml_activity/teaching.tex
	pdf2svg fig/er/abstract.pdf fig/er/abstract.svg
	pdf2svg fig/fd/course.pdf fig/fd/course.svg
	pdf2svg fig/misc/schema_design.pdf fig/misc/schema_design.svg
	pdf2svg fig/rel_mod/actor.pdf fig/rel_mod/actor.svg
	pdf2svg fig/uml_class/hand.pdf fig/uml_class/hand.svg	
	pdf2svg fig/uml_activity/teaching.pdf fig/uml_activity/teaching.svg
	pandoc $(OPTIONSPANDOCHTML) -o example.html $<
	pandoc $(OPTIONSPANDOCODT) -o example.odt $<
	pandoc $(OPTIONSPANDOCPDF) -o example.pdf $<

###
# Rule to compile a temporary file, for testing purposes
###

temp: temp.md
	pandoc $(OPTIONSPANDOCHTML) -o temp.html $<
	pandoc $(OPTIONSPANDOCODT) -o temp.odt $<
	pandoc $(OPTIONSPANDOCPDF) -o temp.pdf $<

# "Phony" rule to compile all three versions (html, odt, pdf) of the document and the "auxiliary" files (readme, contrib, licence and known_bugs, instalation guides).

.PHONY: all
all: pdf odt html aux example

###
# "Phony" rule to indent properly the latex files
###

#.PHONY: clean_latex $(FIG_SOURCE)
#clean_latex: $(FIG_SOURCE)
#$(FIG_SOURCE):
#	latexindent -w -s $@

###
# "Phony" rule to beautify the java code
###

.PHONY: clean_java $(JAVA_CODE)
clean_java: $(JAVA_CODE)
$(JAVA_CODE):
	java -jar lib/google-java-format-1.9-all-deps.jar -i $@

###
# "Phony" rule to beautify the SQL code
###

.PHONY: clean_sql $(SQL_CODE)
clean_sql: $(SQL_CODE)
$(SQL_CODE):
	pg_format -s 2 -t -U 2 -w 60 -W 1 -C -B -p 'https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&//=]*)' -i $@

###
# Rules to call makefile from parent directory.
###

aux:
	@make -C ../ aux
clean:
	@make -C ../ clean
push:
	@make -C ../ push


Mode Type Size Ref File
100644 blob 15398 ee75155d2d99639acd17d31b2cc23cd752078e7e CONTRIB.md
100644 blob 20625 25b8e45e7f103089fb70fae5a219f09a29ef5312 KNOWN_BUGS.md
100644 blob 17217 e5c1f9f898cca948da42333b100e331d62b61d3c LICENSE.md
100644 blob 1997 f8801648fd4ba5843a2cbca8b10e4f69ba5d9b25 Makefile
100644 blob 6695 0b91924ffc7b73e2d36150369d4fd41a44b099c5 README.md
040000 tree - eb7afc38251ada69e1967e1ce3e49967eca2267c install
040000 tree - f16b283429b64b620b3bd7681a446ff54d504f84 notes
Hints:
Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://rocketgit.com/user/caubert/CSCI_3410

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@ssh.rocketgit.com/user/caubert/CSCI_3410

Clone this repository using git:
git clone git://git.rocketgit.com/user/caubert/CSCI_3410

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a merge request:
... clone the repository ...
... make some changes and some commits ...
git push origin main