<commit_before>#
# Requires:
#	- go (golang.org) (required on host to build/run, required on target to run)
#		- To add Go support on the Pi, in Raspbian:
#			sudo apt-get install golang
#	- Mercurial (hg) required by "go get":
#		- http://mercurial.selenic.com/wiki/Download, for Mac:
#			sudo port install mercurial
#	- Rebuild in linux/arm support for cross-compiling to the Pi.  On the Mac, this works:
#		cd /usr/local/go/src
#		sudo GOOS=linux GOARCH=arm ./make.bash
#		
PI=pi@raspberrypi
RUNONPI=ssh $(SSHFLAGS) -q -t $(PI) "cd rsinstall;"

VERSION:=$(shell git describe --tags --dirty)
LP_DIR=build/lessons

TGT_VAR_DIR=/var/local/raspberrystem/ide/
TGT_LESSONS_DIR=$(TGT_VAR_DIR)/website/lessons
OUT=$(abspath out)

# Final targets
LP_TAR:=$(OUT)/lesson_plans-$(VERSION).tar.gz
IM_PDF:=$(OUT)/RaspberrySTEM_Instructor_Manual-$(VERSION).pdf
SP_PDF:=$(OUT)/RaspberrySTEM_Supplementary_Projects-$(VERSION).pdf
UG_PDF:=$(OUT)/RaspberrySTEM_User_Guide-$(VERSION).pdf

TARGETS=
TARGETS+=$(LP_TAR)
#TARGETS+=$(IM_PDF)
#TARGETS+=$(SP_PDF)
#TARGETS+=$(UG_PDF)

all: $(TARGETS)

targets:
	@echo $(TARGETS)

clean:
	rm -f $(TARGETS)
	rm -rf out
	rm -rf build

install:
	scp $(LP_TAR) $(PI):/tmp
	$(RUNONPI) "cd $(TGT_LESSONS_DIR) && sudo tar xvf /tmp/$(notdir $(LP_TAR))"

$(OUT):
	mkdir -p $@

.PHONY: $(LP_TAR)
$(LP_TAR): $(shell git ls-files im)| $(OUT)
	rm -rf $(LP_DIR)
	mkdir -p $(LP_DIR)
	cp "im/RaspberrySTEM Instructor Manual.html" $(LP_DIR)/index.html
	cp im/default.css $(LP_DIR)
	cp -r im/images $(LP_DIR)
	cd $(LP_DIR) && tar cvzf $@ *<commit_msg>make now working for any im dir files<commit_after>#
# Requires:
#	- go (golang.org) (required on host to build/run, required on target to run)
#		- To add Go support on the Pi, in Raspbian:
#			sudo apt-get install golang
#	- Mercurial (hg) required by "go get":
#		- http://mercurial.selenic.com/wiki/Download, for Mac:
#			sudo port install mercurial
#	- Rebuild in linux/arm support for cross-compiling to the Pi.  On the Mac, this works:
#		cd /usr/local/go/src
#		sudo GOOS=linux GOARCH=arm ./make.bash
#		
PI=pi@raspberrypi
RUNONPI=ssh $(SSHFLAGS) -q -t $(PI) "cd rsinstall;"

VERSION:=$(shell git describe --tags --dirty)
LP_INDEX_HTML=RaspberrySTEM_Instructor_Manual.html

TGT_VAR_DIR=/var/local/raspberrystem/ide/
TGT_LESSONS_DIR=$(TGT_VAR_DIR)/website/lessons
OUT=$(abspath out)

# Final targets
LP_TAR:=$(OUT)/lesson_plans-$(VERSION).tar.gz
IM_PDF:=$(OUT)/RaspberrySTEM_Instructor_Manual-$(VERSION).pdf
SP_PDF:=$(OUT)/RaspberrySTEM_Supplementary_Projects-$(VERSION).pdf
UG_PDF:=$(OUT)/RaspberrySTEM_User_Guide-$(VERSION).pdf

TARGETS=
TARGETS+=$(LP_TAR)
#TARGETS+=$(IM_PDF)
#TARGETS+=$(SP_PDF)
#TARGETS+=$(UG_PDF)

all: $(TARGETS)

targets:
	@echo $(TARGETS)

clean:
	rm -f $(TARGETS)
	rm -rf out
	rm -rf build

install:
	scp $(LP_TAR) $(PI):/tmp
	$(RUNONPI) "cd $(TGT_LESSONS_DIR) && sudo tar xvf /tmp/$(notdir $(LP_TAR))"

$(OUT):
	mkdir -p $@

.PHONY: $(LP_TAR)
$(LP_TAR): $(shell git ls-files im)| $(OUT)
	rm -rf build/im
	@for f in $^; do \
		mkdir -p `dirname build/$$f`; \
		cp -v $$f build/$$f; \
	done
	cd build/im && mv $(LP_INDEX_HTML) index.html
	cd build/im && tar cvzf $@ *
{'fraction_non_alphanumeric': 0.1726322458029775, 'fraction_numerical': 0.0, 'mean_word_length': 4.550087873462214, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1703072', 'n_tokens_mistral': 1365, 'n_tokens_neox': 1292, 'n_words': 308}