Mentions légales du service

Skip to content
Snippets Groups Projects
Commit d0a31f80 authored by VIEVILLE Thierry's avatar VIEVILLE Thierry
Browse files

sync from makefile

parent 4e629d1c
No related branches found
No related tags found
No related merge requests found
Pipeline #973499 passed
define USAGE
Usage: make [build|rebuild] i1=file1.mid i2=file2.mid
Usage: make [build|clean] i1=file1.mid i2=file2.mid
Generates a file1-file2.html file showing a sequence of intermediate sounds between file1 and file2.
endef
export USAGE
ifeq (,$(i1))
dft: usage
build: usage
else
ifeq (,$(i2))
dft: usage
build: usage
else
input1 = $(basename $(i1))
input2 = $(basename $(i2))
output = $(notdir $(input1))-$(notdir $(input2))
build:
# Creates JSON files from MIDI
build: $(output).txt
$(output).txt: $(wildcard ../../src/*.*pp) $(wildcard ../../src/*.C) $(input1).mid $(input2).mid
echo "musicmorphing demo takes about five minutes time, with some non critical caveat in midi file format converter"
$(MAKE) $(input1).json $(input2).json
# Runs the trajectory algorithm
$(MAKE) -C ../../src build_cpp
../../node_modules/.bin/json2path midi_score $(input1).json $(input2).json
# Creates the index file
../../node_modules/.bin/json2path midi_score $(input1).json $(input2).json > $(output).txt
$(MAKE) $(output).html
rebuild:
# Cleans target files to rerun each step
rm -f $(input1).json $(input2).json path-$(input1)-$(input2)-*.* $(output).html
$(MAKE)
clean:
/bin/rm -f $(input1).json $(input2).json path-$(input1)-$(input2)-*.* $(output).html $(output).txt
# Creates an index page showing the results
define PAGE0
<html>
<!-- Generated by makefile do not edit -->
......@@ -56,8 +54,7 @@ define PAGE1
<td align='center'>Final</td>
</tr><table>
endef
endif
endif
export PAGE1
define PAGE2
</body>
......
define USAGE
Usage: make [build|rebuild] i1=file1.svg i2=file2.svg
Usage: make [build|clean] i1=file1.svg i2=file2.svg
Generates a file1-file2.html file showing a sequence of intermediate images between file1 and file2.
endef
export USAGE
ifeq (,$(i1))
usage: usage
build: usage
else
ifeq (,$(i2))
usage: usage
build: usage
else
input1 = $(basename $(i1))
input2 = $(basename $(i2))
output = $(notdir $(input1))-$(notdir $(input2))
build:
# Creates JSON files from SVG
build: $(output).txt
$(output).txt: $(wildcard ../../src/*.*pp) $(wildcard ../../src/*.C) $(input1).svg $(input2).svg
$(MAKE) $(input1).json $(input2).json
# Runs the trajectory algorithm
$(MAKE) -C ../../src build_cpp
../../node_modules/.bin/json2path svg_face $(input1).json $(input2).json
# Creates the output file and the related SVG and GIF files from the JSON path outputs
../../node_modules/.bin/json2path svg_face $(input1).json $(input2).json > $(output).txt
$(MAKE) $(output).html $(output).gif
rebuild:
# Cleans target files to rerun each step
rm -f $(input1).json $(input2).json path-$(input1)-$(input2)-*.* $(output).gif $(output).html
$(MAKE)
clean:
/bin/rm -f $(input1).json $(input2).json path-$(input1)-$(input2)-*.* $(output).gif $(output).html $(output).txt
# Concatenates the trajectory images as an animated GIF
$(output).gif: $(wildcard path-$(input1)-$(input2)-*.json)
files="$(patsubst %.json,%.gif,$^)" ;\
$(MAKE) $$files OUTPUT=TRUE ;\
gifsicle -l -d 80 -O --colors 256 -o $(output).gif $$files ;\
rm -f $$files
#
# Creates an output page showing the results
define PAGE0
......
......@@ -444,6 +444,7 @@ sync:
@git pull -q ; git commit -q -a -m 'sync from makefile' ; git status -s ; git push -q 2>&1 | grep -v '^remote:' ; ok=
@$(MAKE) sync_publish
ifneq (,$(shell grep '"npm_publish" *: *true' ../package.json))
sync_publish:
@cd .. ; if wget -q --spider https://www.npmjs.com/package/$(NAME) ; then \
online_version="`wget -q --output-document - https://registry.npmjs.org/$(NAME) | sed 's/.*\"latest\": *\"\([^\"]*\).*/\1\n/'`" ;\
......@@ -453,6 +454,10 @@ sync_publish:
else echo "`npm publish --dry-run`, while https://www.npmjs.com/package/$(NAME) version is \"$$online_version\", 'npm publish' may be run" ;\
fi ;\
fi
else
sync_publish:
endif
reinstall:
@make clean ; git pull ; cd .. ; npm install ; cd src ; make build test
......
......@@ -17,11 +17,10 @@ INSTALL = Hungarian.h Hungarian.cpp
BUILD = visualmorphingdemo musicmorphingdemo
visualmorphingdemo:
$(MAKE) -C ../public/visualmorphingdemo rebuild i1=titi.svg i2=toto.svg
$(MAKE) -C ../public/visualmorphingdemo build i1=titi.svg i2=toto.svg
musicmorphingdemo:
echo "musicmorphing demo takes about five minutes time, with some non critical caveat in midi file format converter"
$(MAKE) -C ../public/musicmorphingdemo rebuild i1=au-clair-de-la-lune.mid i2=frere-jacques.mid
$(MAKE) -C ../public/musicmorphingdemo build i1=au-clair-de-la-lune.mid i2=frere-jacques.mid
### Includes aidebuild standard usage,build,test,clean,sync rules
include ./.makefile.inc
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment