Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build fails if header files go missing #230

Closed
mikebentley15 opened this issue Oct 10, 2018 · 0 comments · Fixed by #232
Closed

Build fails if header files go missing #230

mikebentley15 opened this issue Oct 10, 2018 · 0 comments · Fixed by #232
Labels
bug make Involves touching GNU Makefiles tests Involves touching tests

Comments

@mikebentley15
Copy link
Collaborator

Bug Report

Describe the problem
The dependencies of source files to their respective included header files are generated from the compiler into .d files. These are used by the Makefile to know when to recompile a target.

On an HPC system, I am using Singularity in such a way that the make command sees a different filesystem than the compiler commands, and therefore sees different files. Ultimately, this means that make will presume those header files are missing and will complain that there is no rule to generate them. This makes doing this sort of thing tricky.

There is another biproduct, which is to say that if the user were to move or rename a header file that is directly or indirectly used by a test, then the build would fail without a cleaning first.

Suggested Fix
Add the -MP flag to the DEPFLAGS variable within data/Makefile.in.

Stated from the GCC manual:

       -MP This option instructs CPP to add a phony target for each dependency other
           than the main file, causing each to depend on nothing.  These dummy rules
           work around errors make gives if you remove header files without updating
           the Makefile to match.

           This is typical output:

                   test.o: test.c test.h

                   test.h:

We may also be interested in the -MG flag.

Alternative approaches:
Not sure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug make Involves touching GNU Makefiles tests Involves touching tests
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant