now there is a C project. Suppose there are only main.c
and pattern.h
files, in which some standardized interfaces are defined
wants to achieve a function: provide the interface defined in pattern.h
to user development, and eventually there will be a lot of c files containing the header file.
for example, classmate A writes a patternA.c
to implement this interface,
classmate B writes a patternB.c
to implement this interface,
both c files have -sharpinclude "pattern.h"
and will exist in the same file directory at the same time.
finally in main.c
or makefile
, how do I choose one of them to compile the link?
for example, modify the macro definition in main.c
or run make patternA
or make patternB
is best implemented through the latter, which avoids the need for users to modify the source code during compilation