Skip to content
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

BAPC and Make unified notes. #10

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 3 additions & 0 deletions make/BAPCMakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
notes: problem_statement/notes.ipe
mkdir -p build
ipetoipe -pdf -export "problem_statement/notes.ipe" "build/notes.pdf" 2> /dev/null
12 changes: 9 additions & 3 deletions make/ContestMakefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,15 @@ TOOLS_MAKE_DIR=$(REPO_ROOT)/tools/make
PROBLEMS=$(shell find -L . -mindepth 1 -maxdepth 1 -type d | sort)

.PHONY: notes
notes:
$(foreach p,$(PROBLEMS),'$(MAKE)' -C $(p) notes;)
pdfjam -q -o notes.pdf --fitpaper true --rotateoversize true $(foreach p,$(PROBLEMS),'$(p)/build/notes.pdf')
notes: $(foreach p,$(PROBLEMS),$(p)/notes.pdf)
pdfjam --landscape -q -o notes.pdf $(foreach p,$(PROBLEMS),'$(p)/notes.pdf')

%/notes.pdf: %
printf "Building notes for Problem $< with "
if [ -f "$</Makefile" ];\
then echo "make" && $(MAKE) -C "$<" notes && ln -sf build/notes.pdf "$</notes.pdf";\
else echo "bt" && bt solutions --problem "$<" && pdfjam --landscape -q -o "$</notes.pdf" "$</solution.en.pdf";\
fi

.PHONY: clean
clean:
Expand Down