plcopen/Makefile
author Edouard Tisserant <edouard.tisserant@gmail.com>
Thu, 26 May 2022 23:41:10 +0200
changeset 3483 e25f1cf69df9
parent 2627 3ba6a2d26507
permissions -rw-r--r--
IDE: fix exception happening in debug mode when logging process termination.
1353
fc7aab64589b Added makefile for generating xslt stylesheet from ysl2 files
Laurent Bessard
parents:
diff changeset
     1
#! gmake
fc7aab64589b Added makefile for generating xslt stylesheet from ysl2 files
Laurent Bessard
parents:
diff changeset
     2
2627
3ba6a2d26507 Moved XSLT model query python code so that XSLT part can be reused for other transformations
Edouard Tisserant
parents: 1936
diff changeset
     3
# Makefile to generate XSLT stylesheets from ysl2 files in the same directory
3ba6a2d26507 Moved XSLT model query python code so that XSLT part can be reused for other transformations
Edouard Tisserant
parents: 1936
diff changeset
     4
3ba6a2d26507 Moved XSLT model query python code so that XSLT part can be reused for other transformations
Edouard Tisserant
parents: 1936
diff changeset
     5
# This uses YML2. 
3ba6a2d26507 Moved XSLT model query python code so that XSLT part can be reused for other transformations
Edouard Tisserant
parents: 1936
diff changeset
     6
#   hg clone https://pep.foundation/dev/repos/yml2/
3ba6a2d26507 Moved XSLT model query python code so that XSLT part can be reused for other transformations
Edouard Tisserant
parents: 1936
diff changeset
     7
3ba6a2d26507 Moved XSLT model query python code so that XSLT part can be reused for other transformations
Edouard Tisserant
parents: 1936
diff changeset
     8
# It should be just fine if yml2 is cloned just asside beremiz
3ba6a2d26507 Moved XSLT model query python code so that XSLT part can be reused for other transformations
Edouard Tisserant
parents: 1936
diff changeset
     9
# otherwise, point yml2path to yml2 source directory
3ba6a2d26507 Moved XSLT model query python code so that XSLT part can be reused for other transformations
Edouard Tisserant
parents: 1936
diff changeset
    10
#   make yml2path=path/to/yml/dir
3ba6a2d26507 Moved XSLT model query python code so that XSLT part can be reused for other transformations
Edouard Tisserant
parents: 1936
diff changeset
    11
3ba6a2d26507 Moved XSLT model query python code so that XSLT part can be reused for other transformations
Edouard Tisserant
parents: 1936
diff changeset
    12
yml2path ?= $(abspath ../../yml2)
3ba6a2d26507 Moved XSLT model query python code so that XSLT part can be reused for other transformations
Edouard Tisserant
parents: 1936
diff changeset
    13
1353
fc7aab64589b Added makefile for generating xslt stylesheet from ysl2 files
Laurent Bessard
parents:
diff changeset
    14
ysl2files := $(wildcard *.ysl2)
fc7aab64589b Added makefile for generating xslt stylesheet from ysl2 files
Laurent Bessard
parents:
diff changeset
    15
xsltfiles := $(patsubst %.ysl2, %.xslt, $(ysl2files))
fc7aab64589b Added makefile for generating xslt stylesheet from ysl2 files
Laurent Bessard
parents:
diff changeset
    16
fc7aab64589b Added makefile for generating xslt stylesheet from ysl2 files
Laurent Bessard
parents:
diff changeset
    17
all:$(xsltfiles)
fc7aab64589b Added makefile for generating xslt stylesheet from ysl2 files
Laurent Bessard
parents:
diff changeset
    18
2627
3ba6a2d26507 Moved XSLT model query python code so that XSLT part can be reused for other transformations
Edouard Tisserant
parents: 1936
diff changeset
    19
%.xslt: %.ysl2 ../yslt_noindent.yml2
3ba6a2d26507 Moved XSLT model query python code so that XSLT part can be reused for other transformations
Edouard Tisserant
parents: 1936
diff changeset
    20
	$(yml2path)/yml2c -I $(yml2path):../ $< -o $@.tmp
1353
fc7aab64589b Added makefile for generating xslt stylesheet from ysl2 files
Laurent Bessard
parents:
diff changeset
    21
	xmlstarlet fo $@.tmp > $@
fc7aab64589b Added makefile for generating xslt stylesheet from ysl2 files
Laurent Bessard
parents:
diff changeset
    22
	rm $@.tmp
fc7aab64589b Added makefile for generating xslt stylesheet from ysl2 files
Laurent Bessard
parents:
diff changeset
    23
	
fc7aab64589b Added makefile for generating xslt stylesheet from ysl2 files
Laurent Bessard
parents:
diff changeset
    24
clean:
1936
b85b13b1c2ec YSLT auto indent trick is useless here, added yslt_noindent.yml2, regenerated XSLT files
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 1353
diff changeset
    25
	rm -f $(xsltfiles)