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

Issue253 make support more extensions #266

Merged
merged 4 commits into from
May 21, 2019

Conversation

mikebentley15
Copy link
Collaborator

Fixes #253

Description:
In Makefile.in and Makefile_bisect_binary.in, I replaced

  • Replaced usage of generic GNU Makefile rules (such as %.o: %.cpp ...) with individually created rules for each output object file from each source file.
  • Ensure flit bisect still works after this change.
  • Output files are now renamed, for example main.cpp outputs obj/main.cpp_gt.o for the gt target instead of the old name obj/main_gt.o (i.e., the extension used to be removed -- no longer the case).
  • Removed VPATH from Makefile.in since it is no longer needed. It was needed to find source files for rules of the %.o: %.cpp variety when they are spread out in different directories (think of VPATH as a search path for resolving these generic rules). Now that each file has its own individual rule, we no longer need to use VPATH.
  • Copy rules of SOURCE += $(wildcard *.cpp) and SOURCE += $(wildcard tests/*.cpp) into custom.mk. They are also found in Makefile.in for backward compatibility with old custom.mk files. A TODO was placed in Makefile.in saying that those lines in Makefile.in are deprecated and will be removed in FLiT v3.0.

The result of this change is that ANY file added to the SOURCE variable in custom.mk will be compiled with the C++ compiler. Furthermore, it is possible to have both source files main.cpp and main.cxx since the generated object file names will keep the file extension and will not collide.

Documentation:
Just a little documentation updates that were either unnecessary or inconsistent with the new changes. I did not feel there was a need to create a specific section to address this change since it is pretty much expected functionality from a user's perspective (although it was an undocumented difference from implicit expectations).

Tests:

  • Fixed broken tests from the change
  • For tests/flit_cli/flit_bisect/tst_bisect.py, rename one of the used source files from file4.cpp to file4.cxx to further test the new functionality.

No new tests were added, simply leveraging existing tests.

Instead use the list of files in SOURCE within the Makefiles.
We now create a rule for each file rather than relying on GNU
Makefile expanding implicit rules (such as %.o: %.cpp ...).

Fixed tests and bisect to work with this new framework.

Did not update documentation or add new tests
This is to additionally test the functionality of using file endings
other than .cpp.
It was needed to get the '%.o: %.cpp' rules to work with source files in
different directories.  Now that all each rule is spelled out individually,
this is unused and unnecessary extra overhead.
A few things here and there now that a few things in the Makefile
have changed.
@mikebentley15
Copy link
Collaborator Author

I prioritized this issue because the Ares project has files with .cxx and .cc. We wanted to implement this for a while, but necessity influences priority 😄

Copy link
Collaborator

@IanBriggs IanBriggs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Nice change

@IanBriggs IanBriggs merged commit 3956f48 into devel May 21, 2019
@IanBriggs IanBriggs deleted the issue253-make-support-more-extensions branch May 21, 2019 19:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Handle different file endings for source files
2 participants