Replies: 1 comment
-
Your Makefile should look like this:
CIRCLEHOME = ..
OBJS = main.o kernel.o tests.o MiniScript/MiniscriptInterpreter.o
LIBS = $(CIRCLEHOME)/lib/usb/libusb.a \
$(CIRCLEHOME)/lib/input/libinput.a \
$(CIRCLEHOME)/lib/fs/libfs.a \
$(CIRCLEHOME)/lib/libcircle.a
INCLUDE += -I MiniScript
EXTRACLEAN += MiniScript/*.o MiniScript/*.d
include ../Rules.mk
…-include $(DEPS)
syslogserver.c in sample/33-syslog is an external Linux program, which is not
linked into the kernel image. That's why it has a custom rule.
|
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
JoeStrout
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Please forgive the newbie question... the Rules.mk system in Circle is elegant but way above my understanding of make. So I've been struggling for a while now to get it to compile and link files which I have in a subdirectory. I'm sure this will seem simple for folks who know what they're doing!
My file structure looks like this:
I created my project in a "MiniScript-Pi" subdirectory within circle. Under that I have source files for main, kernel, and tests. So far so good — I'm able to build and link that much with no problem. Then I added a subdirectory called MiniScript, containing a bunch of .cpp and .h files. And this is where I'm getting into trouble. As long as tests.cpp only references things defined in header files, I'm fine; but as soon as I need to link a .cpp file, it fails.
I studied how other makefiles in the samples directory manage extra files, but none that I could find have them in a subdirectory. And even for extra files at the sample-project level, methods vary: sample 33 defines EXTRACLEAN and a custom rule for syslogserver.c, while sample 34 adds oscillator.o to OBJS and has no custom rule.
I tried this:
But it doesn't work; the INCLUDE line was meant to fix a "Requested include file not found" error, but instead just caused three errors of its own.
Can anyone suggest how to properly set up the makefile to build and link in everything in the MiniScript subdirectory?
Beta Was this translation helpful? Give feedback.
All reactions