In a makefile, what is the difference in meaning between include
and -include
?
Examples:
-include $(APPINCLUDES) include $(CONTIKI)/platform/$(TARGET)/Makefile.$(TARGET)
The include directive tells make to suspend reading the current makefile and read one or more other makefiles before continuing. The directive is a line in the makefile that looks like this: include filenames ... filenames can contain shell file name patterns.
":=" is for defining simply expanded variable, which is expanded once and for all.
If you use more than one ' -f ' or ' --file ' option, you can specify several makefiles. All the makefiles are effectively concatenated in the order specified. The default makefile names GNUmakefile , makefile and Makefile are not checked automatically if you specify ' -f ' or ' --file '.
LDFLAGS: Extra flags to give to compilers when they are supposed to invoke the linker, 'ld', such as -L. Libraries (-lfoo) should be added to the LDLIBS variable instead. LDLIBS: Library flags or names given to compilers when they are supposed to invoke the linker, 'ld'.
The difference is that -include
won't generate an error if the include file doesn't exist.
The -
prefix can be used many places in the Makefile
to perform actions that you don't mind if they fail.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With