Issue with makefile '%' wildcard on Mac Mojave










0















I'm doing a project in c and utilizing the unity testing framework. I've downloaded their makefile directly but have an issue with it on my Mac (Mojave). The basic conclusion is that the '%' wildcard in target definitions doesn't seem to work.



With the following rule:



PATHR = build/results/
$(PATHR)%.txt: $(PATHB)%.$(TARGET_EXTENSION)
-./$< > $@ 2>&1


I get the following make error:



make: *** No rule to make target `build/results/TestVectorCode.txt', needed by `test'. Stop.


However, if I define the rule explicitly without the '%' as follows:



build/results/TestVectorCode.txt: $(PATHB)%.$(TARGET_EXTENSION)
-./$< > $@ 2>&1


I don't get the make error. Any thoughts?










share|improve this question


























    0















    I'm doing a project in c and utilizing the unity testing framework. I've downloaded their makefile directly but have an issue with it on my Mac (Mojave). The basic conclusion is that the '%' wildcard in target definitions doesn't seem to work.



    With the following rule:



    PATHR = build/results/
    $(PATHR)%.txt: $(PATHB)%.$(TARGET_EXTENSION)
    -./$< > $@ 2>&1


    I get the following make error:



    make: *** No rule to make target `build/results/TestVectorCode.txt', needed by `test'. Stop.


    However, if I define the rule explicitly without the '%' as follows:



    build/results/TestVectorCode.txt: $(PATHB)%.$(TARGET_EXTENSION)
    -./$< > $@ 2>&1


    I don't get the make error. Any thoughts?










    share|improve this question
























      0












      0








      0








      I'm doing a project in c and utilizing the unity testing framework. I've downloaded their makefile directly but have an issue with it on my Mac (Mojave). The basic conclusion is that the '%' wildcard in target definitions doesn't seem to work.



      With the following rule:



      PATHR = build/results/
      $(PATHR)%.txt: $(PATHB)%.$(TARGET_EXTENSION)
      -./$< > $@ 2>&1


      I get the following make error:



      make: *** No rule to make target `build/results/TestVectorCode.txt', needed by `test'. Stop.


      However, if I define the rule explicitly without the '%' as follows:



      build/results/TestVectorCode.txt: $(PATHB)%.$(TARGET_EXTENSION)
      -./$< > $@ 2>&1


      I don't get the make error. Any thoughts?










      share|improve this question














      I'm doing a project in c and utilizing the unity testing framework. I've downloaded their makefile directly but have an issue with it on my Mac (Mojave). The basic conclusion is that the '%' wildcard in target definitions doesn't seem to work.



      With the following rule:



      PATHR = build/results/
      $(PATHR)%.txt: $(PATHB)%.$(TARGET_EXTENSION)
      -./$< > $@ 2>&1


      I get the following make error:



      make: *** No rule to make target `build/results/TestVectorCode.txt', needed by `test'. Stop.


      However, if I define the rule explicitly without the '%' as follows:



      build/results/TestVectorCode.txt: $(PATHB)%.$(TARGET_EXTENSION)
      -./$< > $@ 2>&1


      I don't get the make error. Any thoughts?







      makefile






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 15 '18 at 6:05









      sethseth

      1




      1






















          1 Answer
          1






          active

          oldest

          votes


















          0














          This message means that the prerequisite of your rule is not found and cannot be created (by "prerequisite" I mean $(PATHB)TestVectorCode.$(TARGET_EXTENSION)--you don't show what the values of those variables are so I can't expand them for you).



          A pattern rule suggests one possible way that a target can be built. There can be lots of patterns that can build the same target, so the fact that one of them doesn't match is not by itself fatal. Only if all of them don't match, will make give this error that it can't find any rule to build the target.



          You must have a typo in your "rule that works" example because surely it's not relying on a file actually named %, right?



          If you can't figure it out you can try running make -d build/results/TestVectorCode.txt and examine the output to see why make is rejecting your pattern rule (probably redirect the output because it will be a lot).



          Another thing is that I know that the version of GNU make that comes with Xcode is very old, and has bugs. I don't think they would cause something like this but I'm not sure. If you can you might try installing the latest version of GNU make using brew (for example) and see if you get the same behavior.






          share|improve this answer






















            Your Answer






            StackExchange.ifUsing("editor", function ()
            StackExchange.using("externalEditor", function ()
            StackExchange.using("snippets", function ()
            StackExchange.snippets.init();
            );
            );
            , "code-snippets");

            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "1"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader:
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            ,
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













            draft saved

            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53313378%2fissue-with-makefile-wildcard-on-mac-mojave%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            This message means that the prerequisite of your rule is not found and cannot be created (by "prerequisite" I mean $(PATHB)TestVectorCode.$(TARGET_EXTENSION)--you don't show what the values of those variables are so I can't expand them for you).



            A pattern rule suggests one possible way that a target can be built. There can be lots of patterns that can build the same target, so the fact that one of them doesn't match is not by itself fatal. Only if all of them don't match, will make give this error that it can't find any rule to build the target.



            You must have a typo in your "rule that works" example because surely it's not relying on a file actually named %, right?



            If you can't figure it out you can try running make -d build/results/TestVectorCode.txt and examine the output to see why make is rejecting your pattern rule (probably redirect the output because it will be a lot).



            Another thing is that I know that the version of GNU make that comes with Xcode is very old, and has bugs. I don't think they would cause something like this but I'm not sure. If you can you might try installing the latest version of GNU make using brew (for example) and see if you get the same behavior.






            share|improve this answer



























              0














              This message means that the prerequisite of your rule is not found and cannot be created (by "prerequisite" I mean $(PATHB)TestVectorCode.$(TARGET_EXTENSION)--you don't show what the values of those variables are so I can't expand them for you).



              A pattern rule suggests one possible way that a target can be built. There can be lots of patterns that can build the same target, so the fact that one of them doesn't match is not by itself fatal. Only if all of them don't match, will make give this error that it can't find any rule to build the target.



              You must have a typo in your "rule that works" example because surely it's not relying on a file actually named %, right?



              If you can't figure it out you can try running make -d build/results/TestVectorCode.txt and examine the output to see why make is rejecting your pattern rule (probably redirect the output because it will be a lot).



              Another thing is that I know that the version of GNU make that comes with Xcode is very old, and has bugs. I don't think they would cause something like this but I'm not sure. If you can you might try installing the latest version of GNU make using brew (for example) and see if you get the same behavior.






              share|improve this answer

























                0












                0








                0







                This message means that the prerequisite of your rule is not found and cannot be created (by "prerequisite" I mean $(PATHB)TestVectorCode.$(TARGET_EXTENSION)--you don't show what the values of those variables are so I can't expand them for you).



                A pattern rule suggests one possible way that a target can be built. There can be lots of patterns that can build the same target, so the fact that one of them doesn't match is not by itself fatal. Only if all of them don't match, will make give this error that it can't find any rule to build the target.



                You must have a typo in your "rule that works" example because surely it's not relying on a file actually named %, right?



                If you can't figure it out you can try running make -d build/results/TestVectorCode.txt and examine the output to see why make is rejecting your pattern rule (probably redirect the output because it will be a lot).



                Another thing is that I know that the version of GNU make that comes with Xcode is very old, and has bugs. I don't think they would cause something like this but I'm not sure. If you can you might try installing the latest version of GNU make using brew (for example) and see if you get the same behavior.






                share|improve this answer













                This message means that the prerequisite of your rule is not found and cannot be created (by "prerequisite" I mean $(PATHB)TestVectorCode.$(TARGET_EXTENSION)--you don't show what the values of those variables are so I can't expand them for you).



                A pattern rule suggests one possible way that a target can be built. There can be lots of patterns that can build the same target, so the fact that one of them doesn't match is not by itself fatal. Only if all of them don't match, will make give this error that it can't find any rule to build the target.



                You must have a typo in your "rule that works" example because surely it's not relying on a file actually named %, right?



                If you can't figure it out you can try running make -d build/results/TestVectorCode.txt and examine the output to see why make is rejecting your pattern rule (probably redirect the output because it will be a lot).



                Another thing is that I know that the version of GNU make that comes with Xcode is very old, and has bugs. I don't think they would cause something like this but I'm not sure. If you can you might try installing the latest version of GNU make using brew (for example) and see if you get the same behavior.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Nov 15 '18 at 16:59









                MadScientistMadScientist

                46.9k55267




                46.9k55267





























                    draft saved

                    draft discarded
















































                    Thanks for contributing an answer to Stack Overflow!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid


                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.

                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53313378%2fissue-with-makefile-wildcard-on-mac-mojave%23new-answer', 'question_page');

                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Top Tejano songwriter Luis Silva dead of heart attack at 64

                    ReactJS Fetched API data displays live - need Data displayed static

                    Evgeni Malkin