Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Although there where some suggestions on how to do what I initially asked for <a href="https://stackoverflow.com/questions/3236145/force-gnu-make-to-rebuild-objects-affected-by-compiler-definition/3237349#3237349">here</a> (as pointed to by <a href="https://stackoverflow.com/users/371234/slowdog">slowdog</a>), I took the decision to take <a href="https://stackoverflow.com/users/128940/beta">Beta</a>'s different-names-schema one step further and put all objects for the various variants in subdirectories following the description in <a href="https://stackoverflow.com/users/128940/beta">Beta</a>'s second suggestion in his answer to <a href="https://stackoverflow.com/questions/2597462/vpath-in-makefile-issue">this question</a>.</p> <p>In essence that made my Makefile look like:</p> <pre><code>A : AOBJDIR = .a AOBJECTS = $(addprefix $(AOBJDIR)/,$(ASRCS:.c=.o)) $(AOBJECTS): $(AOBJDIR)/%o: %.c $(CC) $(CFLAGS) -MMD -o $@ -c $&lt; $(AOBJDIR) : @mkdir $(AOBJDIR) -include $(AOBJECTS:.o=.d) a: $(AOBJDIR) $(AOBJECTS) $(LINK) ... </code></pre> <p>So the first part names a subdirectory to be used for object files of 'a' and creates a list of object files in that directory by converting the source filenames and adding the subdirectory prefix.</p> <p>Then follows the default rule for those object files (with dependency generation thrown in for good measure).</p> <p>Next two are ensuring that the subdirectory exists, and that the dependency information is included.</p> <p>Finally the link rule with an extra dependency on the subdirectory itself to ensure that it is created if it does not exist.</p> <p>This block can be repeated for b, in my example, by exchanging all a's. So if I only could figure out how to package this block into something more general that can be parameterized I would be happy.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload