Skip to content
Snippets Groups Projects

Fix path for .eva targets

1 unresolved thread

Running make 2048.eva from the repository root would loop infinitely with make re-calling itself at the same path. This Change should fix this issue.

Merge request reports

Checking pipeline status.

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Author Developer

    It seems I can't assign people but I can ping @maroneze

  • assigned to @virgile

    • @virgile, do you use this specific %.eva target yourself? Otherwise I think it could be removed (I don't use it myself, I didn't notice it existed...).

    • Oh wait, maybe it's used by SARIF.

    • Well, at each directory level probably, but not for the global Makefile. It seems to me that the original rule was meant to launch specific analyses, e.g. make 2048/2048.eva, probably in case you have more than one analysis configured in a given directory, e.g. make miniz/miniz-example3.eva. Of course, for 2048, you can only do make 2048/2048.eva, thus it's less useful, and I agree that it is confusing and would deserve at least some documentation if we are to keep it that way.

    • @maroneze, I let you decide what to do here.

    • Hum, indeed, the old rule allowed things such as make miniz/.frama-c/miniz-example3.eva. So you still need to add the .frama-c (at least I had to, otherwise it didn't do much). The proposed fix will disable that.

      It seems that if I replace the rule with:

      %.eva: .FORCE
      	$(MAKE) -C $(dir $@)/.frama-c $(notdir $@)

      This should allow running make miniz/miniz-example3.eva, and would prevent make 2048.eva from accidentally looping.

      Do you think this would be better? Do you see a use case that my proposed change would break?

    • You're right, we don't want to type explicitly .frama-c on the command line. I'm wondering if this target (as originally written) was ever used. I'm OK with the change, though, but I think that it would be even better to have a proper error message if $(dir @) is empty, i.e.

      %.eva: .FORCE
      	$(if $(subst ./,,$(dir $@)),\
      	$(MAKE) -C $(dir $@)/.frama-c $(notdir $@),\
      	$(error "Usage: make dir/target.eva"))
    • (NB: technically dir returns at least ./. Now that I think of it, we should do $(MAKE) -C $(dir @).frama-c since the / is included anyway.

    • Please register or sign in to reply
  • Virgile Prevosto assigned to @maroneze and unassigned @virgile

    assigned to @maroneze and unassigned @virgile

Please register or sign in to reply
Loading