makefile - make, write a rule for single file -
i need file have dedicated rule use special flags. use
$(objdir)/%.$(oe): special_file.c $(echo) "compiling file $< => $@" $(cc) $(cflags) $(cflags_special) $(defines) $(include) $< -o $@ $(objdir)/%.$(oe): %.c $(objdir) $(echo) "compiling file $< => $@" $(cc) $(cflags) $(defines) $(include) $< -o $@
but isn't working special_file.c. seems path not known, when comment special rule , let make files, file compiling fine.
how divert make rule 1 file?
thanks in advance,
you should use target-specific variable values:
$(objdir)/special_file.$(oe): cflags += --specific_flags $(objdir)/special_file.$(oe): special_file.c $(objdir)/%.$(oe): %.c $(objdir) $(echo) "compiling file $< => $@" $(cc) $(cflags) $(defines) $(include) $< -o $@
Comments
Post a Comment