sync/Makefile
branchmake-cleanup
changeset 3257 02ef5b3ce34a
parent 3204 fa2e7ead0f4e
child 3444 b02aedcd6a50
     1.1 --- a/sync/Makefile	Wed Jan 23 15:31:29 2019 +0100
     1.2 +++ b/sync/Makefile	Thu Jan 31 23:58:58 2019 +0100
     1.3 @@ -3,39 +3,39 @@
     1.4  
     1.5  include ../Makefile.conf
     1.6  
     1.7 -all: .codegen
     1.8 +all: copy
     1.9  
    1.10 -.codegen: .statemachines .actions .codecs .messages
    1.11 -	-mkdir -p generated
    1.12 -	touch .codegen
    1.13 -	$(MAKE) copy
    1.14 +generated:
    1.15 +	mkdir -p $@
    1.16  
    1.17 -.actions: sync.fsm gen_actions.ysl2 fsm.yml2 functions.ysl2 $(wildcard cond_act_*.yml2)
    1.18 +.actions: sync.fsm gen_actions.ysl2 fsm.yml2 functions.ysl2 $(wildcard cond_act_*.yml2) | generated
    1.19  	$(YML2_PROC) -y gen_actions.ysl2 $< -o $@
    1.20  
    1.21 -.statemachines: sync.fsm gen_statemachine.ysl2 fsm.yml2 functions.ysl2
    1.22 +.statemachines: sync.fsm gen_statemachine.ysl2 fsm.yml2 functions.ysl2 | generated
    1.23  	$(YML2_PROC) -y gen_statemachine.ysl2 $< -o $@
    1.24  
    1.25 -.codecs: sync.fsm gen_codec.ysl2 fsm.yml2 functions.ysl2
    1.26 +.codecs: sync.fsm gen_codec.ysl2 fsm.yml2 functions.ysl2 | generated
    1.27  	$(YML2_PROC) -y gen_codec.ysl2 $< -o $@
    1.28  
    1.29 -.messages: sync.fsm gen_messages.ysl2 gen_message_func.ysl2 fsm.yml2 functions.ysl2
    1.30 +.messages: sync.fsm gen_messages.ysl2 gen_message_func.ysl2 fsm.yml2 functions.ysl2 | generated
    1.31  	$(YML2_PROC) -y gen_messages.ysl2 $< -o $@
    1.32  	$(YML2_PROC) -y gen_message_func.ysl2 $< -o $@
    1.33  
    1.34 -.PHONY: clean copy
    1.35 +.PHONY: clean
    1.36 +clean:
    1.37 +	rm -rf generated
    1.38 +	rm -f *.xml *.xsl .statemachines .actions .codecs .messages *.dot *.svg
    1.39  
    1.40 -clean:
    1.41 -	rm -f *.xml *.xsl generated/* .statemachines .actions .codecs .messages .codegen *.dot *.svg
    1.42 -
    1.43 -copy:
    1.44 +.PHONY: copy
    1.45 +copy: .actions .statemachines .codecs .messages
    1.46  	cp -f generated/*.c generated/*.h ../src
    1.47  
    1.48  %.xml: %.fsm
    1.49  	yml2c $< -o $@
    1.50  
    1.51  %.dot: sync.fsm gen_dot.ysl2
    1.52 -	yml2proc -y gen_dot.ysl2 $<
    1.53 +	$(YML2_PROC) -y gen_dot.ysl2 $<
    1.54  
    1.55  %.svg: %.dot
    1.56  	dot -Tsvg -o $@ $<
    1.57 +