p≡p engine
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

48 lines
1.2 KiB

# This file is under GNU General Public License 3.0
# see LICENSE.txt
include ../Makefile.conf
.PHONY: all clean
all: .copy
mkdir -p $@
statemachines := $(patsubst %.fsm,%.fsm.gen,$(wildcard *.fsm))
actions := $(patsubst %.act,%.act.gen,$(wildcard *.act))
dot := $(patsubst %.fsm,%.dot,$(wildcard *.fsm))
%.fsm.gen: %.fsm gen_statemachine.ysl2 fsm.yml2 functions.ysl2 | generated
$(YML2_PROC) -y gen_statemachine.ysl2 $< > /dev/null
$(YML2_PROC) -y gen_codec.ysl2 $< > /dev/null
$(YML2_PROC) -y gen_messages.ysl2 $< > /dev/null
$(YML2_PROC) -y gen_message_func.ysl2 $< -o $@
%.act.gen: %.act %.fsm gen_actions.ysl2 fsm.yml2 functions.ysl2 | generated
echo 'define actfile = "./$<";' | $(YML2_PROC) - gen_actions.ysl2 | \
$(YML2_PROC) -X - $(subst .act,.fsm,$<) -o $@
rm -rf generated *.gen
rm -f *.xml *.xsl .copy *.dot *.svg
.copy: $(actions) $(statemachines) $(dot)
cp -f generated/*.c generated/*.h ../src
cp -f generated/*.asn1 ../asn.1
touch .copy
%.xml: %.fsm
$(YML2_PROC) $< -o $@
svg: $(patsubst %.dot,%.svg,$(wildcard *.dot))
%.dot: %.fsm gen_dot.ysl2
$(YML2_PROC) -y gen_dot.ysl2 $< -o $@
%.svg: %.dot
dot -Tsvg $< -o $@ > /dev/null