2 ms·
> It would be wonderful for say 10 c files compiling one way, and the 11th having a different option. You can do this by combining implicit and explicit rules:
by jacwah 7y ago
> It would be wonderful for say 10 c files compiling one way, and the 11th having a different option.
You can do this by combining implicit and explicit rules:
target: $(OBJ)
# default rule
%.o: %.c
cc -o $@ $^
# special case
special.o: special.c
specialc -o $@ $^
- Pete_D 7y agoAnother way, with target-specific variables (might be a GNUism): special.o: CFLAGS += -Wno-blah %.o: %.c echo $(CC) $(CFLAGS) -o $@ $<