sync/Makefile
author Volker Birk <vb@pep.foundation>
Mon, 03 Sep 2018 21:57:00 +0200
branchsync
changeset 2922 0c2a16e87852
parent 2921 8bae76a4f918
child 2926 f7b7072036c2
permissions -rw-r--r--
better Makefile
vb@2829
     1
# This file is under GNU General Public License 3.0
krista@2271
     2
# see LICENSE.txt
krista@2271
     3
krista@2271
     4
include ../default.conf
krista@2271
     5
krista@2271
     6
all: .codegen
krista@2271
     7
vb@2922
     8
.codegen: makedir .statemachines .actions .codecs .messages
vb@2829
     9
	touch .codegen
vb@2830
    10
	make copy
krista@2271
    11
vb@2844
    12
.actions: sync.fsm gen_actions.ysl2 fsm.yml2 functions.ysl2 $(wildcard cond_act_*.yml2)
vb@2829
    13
	$(YML2_PROC) -y gen_actions.ysl2 $< -o $@
krista@2271
    14
vb@2829
    15
.statemachines: sync.fsm gen_statemachine.ysl2 fsm.yml2 functions.ysl2
vb@2829
    16
	$(YML2_PROC) -y gen_statemachine.ysl2 $< -o $@
krista@2271
    17
vb@2840
    18
.codecs: sync.fsm gen_codec.ysl2 fsm.yml2 functions.ysl2
vb@2840
    19
	$(YML2_PROC) -y gen_codec.ysl2 $< -o $@
vb@2840
    20
vb@2840
    21
.messages: sync.fsm gen_messages.ysl2 gen_message_func.ysl2 fsm.yml2 functions.ysl2
vb@2840
    22
	$(YML2_PROC) -y gen_messages.ysl2 $< -o $@
vb@2829
    23
	$(YML2_PROC) -y gen_message_func.ysl2 $< -o $@
vb@2829
    24
vb@2922
    25
.PHONY: clean copy makedir
vb@2829
    26
krista@2271
    27
clean:
vb@2922
    28
	rm -f *.xml *.xsl generated/* .statemachines .actions .codecs .messages *.dot *.svg
krista@2271
    29
vb@2830
    30
copy:
vb@2830
    31
	cp -f generated/*.c generated/*.h ../src
vb@2830
    32
vb@2922
    33
makedir:
vb@2922
    34
	-mkdir -p generated
vb@2922
    35
krista@2271
    36
%.xml: %.fsm
vb@2829
    37
	yml2c $< -o $@
krista@2271
    38
vb@2829
    39
%.dot: sync.fsm gen_dot.ysl2
vb@2829
    40
	yml2proc -y gen_dot.ysl2 $<
krista@2271
    41
krista@2271
    42
%.svg: %.dot
krista@2271
    43
	dot -Tsvg -o $@ $<