| Summary: | Incorrect makefile for project with multiple source files with the same name and path and different extensions | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | [Tools] CDT | Reporter: | Alex Freidin <freidin.alex> | ||||||
| Component: | cdt-build-managed | Assignee: | Project Inbox <cdt-build-managed-inbox> | ||||||
| Status: | NEW --- | QA Contact: | Jonah Graham <jonah> | ||||||
| Severity: | normal | ||||||||
| Priority: | P3 | CC: | cdtdoug, yevshif | ||||||
| Version: | 8.0 | ||||||||
| Target Milestone: | --- | ||||||||
| Hardware: | All | ||||||||
| OS: | All | ||||||||
| Whiteboard: | |||||||||
| Attachments: |
|
||||||||
|
Description
Alex Freidin
Created attachment 187411 [details]
Example project
The pattern rules can be enhanced in the following manner, without adding new variables. Suppose we have a generated rule: tests/%.o: ../tests/%.cpp The following appends a list of all relevant "tests/*.o" files to the rule, eliminating those that are not in CPP_SRCS: $(patsubst ../tests/%.cpp, tests/%.o, $(filter $(wildcard ../tests/*.cpp), $(CPP_SRCS))) : \ tests/%.o: ../tests/%.cpp Created attachment 212200 [details]
Diff patch
I used the attached patch to add the above rule to the makefile (need to convert it to GIT patch).
|