Replies: 2 comments
-
do you have any ideas how this would be implemented? |
Beta Was this translation helpful? Give feedback.
-
@jwerle unsure how we can deal with autotools and cmake. However for vanilla makefiles... after a while I came across Makefile Implicit Rules which explains why I saw some projects with very minimal makefiles that was still able to compile. It appears there is an actual convention we need to follow so we can make simple makefiles that will compile as well. Main thing is that if you type %.o: %.c
$(COMPILE.c) $(OUTPUT_OPTION) $<
%: %.o
$(LINK.o) $^ $(LOADLIBES) $(LDLIBS) -o $@
%: %.c
$(LINK.c) $^ $(LOADLIBES) $(LDLIBS) -o $@ So in our context, if the user is willing to make their root makefile adhere to specific coding pattern that makes use of the above, we could possible include a simple makefile for each libraries that represents all the source files that needs to be compiled in. (note that the limitation of relying on this implicit rule set is that all the object files is placed in the same folder as the source files. Also you would need to define your own 'clean' routine. This is likely more of a problem if we are trying to add support for compiling unit test executable, but for libraries where the user is simply integrating it to their own makefiles, that's likely not too much of an issue.) Can't guarantee everyone will be using make, so this features is best as an optional switch flag when importing. |
Beta Was this translation helpful? Give feedback.
-
Might help with some quality of life if we could during installation, autodetect if we are in an automake/cmake/etc... environment and generate configs so that it's easier to use.
Beta Was this translation helpful? Give feedback.
All reactions