Makefile 1.43 KiB
MAKEFLAGS += -r
export TWEEGO_PATH=devTools/tweeGo/storyFormats
HASH := $(shell git rev-list -n 1 --abbrev-commit HEAD)
COMMIT := $(shell git rev-parse --short HEAD)
TWEEGO := $(shell command -v tweego 2>/dev/null)
ifndef TWEEGO
uname := $(shell uname -s)
arch := $(shell uname -m)
arch := $(shell if test $(arch) = x86_64 -o $(arch) = amd64; then echo 64; else echo 32; fi)
ifeq ($(uname),Linux)
ifeq ($(arch),64)
TWEEGO := devTools/tweeGo/tweego_nix64
else
TWEEGO := devTools/tweeGo/tweego_nix86
endif
else ifeq ($(uname),Darwin)
ifeq ($(arch),64)
TWEEGO := devTools/tweeGo/tweego_osx64
else
TWEEGO := devTools/tweeGo/tweego_osx86
endif
endif
endif
all: bin/FC_pregmod.html bin/resources
git: bin/FC_pregmod_$(HASH).html bin/resources
bin/resources: resources
test -L "$@" || ln -s "../$<" bin/
bin/%.html: bin/tmp
rm src/002-config/fc-version.js.commitHash.js
mv $< $@
bin/fc.js: bin/
devTools/concatFiles.sh js/ '*.js' $@
bin/tmp: bin/fc.js injectGitCommitHash
$(TWEEGO) --module=bin/fc.js --head devTools/head.html src/ > $@
rm -f bin/fc.js
injectGitCommitHash:
printf "App.Version.commitHash = '%s';\n" $(COMMIT) > src/002-config/fc-version.js.commitHash.js
bin/:
mkdir -p $@
sanity:
./sanityCheck.sh
sugarcube:
(cd submodules/sugarcube-2/ && node build.js -6 -b 2)
cp submodules/sugarcube-2/build/twine2/sugarcube-2/format.js devTools/tweeGo/storyFormats/sugarcube-2/format.js
.PHONY: all sanity git sugarcube