Author Topic: How to add .o dependency for disp_direct.c?  (Read 349 times)

names_are_hard

  • Contributor
  • Freshman
  • *****
  • Posts: 75
  • 200D idiot
How to add .o dependency for disp_direct.c?
« on: July 11, 2019, 04:06:29 AM »
I have an ML build problem in a port in progress.  My simple brain can write 10 line makefiles.  I have added #include vram.h (and bmp.h) to disp_direct.c, and my build gets an error of:

arm-none-eabi-ld: disp_direct.o: in function `disp_set_pixel':
disp_direct.c:(.text+0x158): undefined reference to `bmp_vram_info'

I believe the cause is that the linker isn't trying to link vram.o into disp_direct.o.  How do I add this dependency?  I've tried src/Makefile.src, several variants along the line of:
disp_direct.o: $(PLATFORM_DIR)/vram.o

but no luck.  Anyone got any ideas?  There's a lot of possible makefiles to add things to, and I'm not even sure of the right way of adding this.

sombree

  • Freshman
  • **
  • Posts: 71
Re: How to add .o dependency for disp_direct.c?
« Reply #1 on: July 11, 2019, 12:39:13 PM »
Have you tried adding it to ML_SRC_EXTRA_OBJS in platform/200D.101/Makefile.platform.default? I mean something like this:
Code: [Select]
ML_SRC_EXTRA_OBJS = \
        log-d678.o \
        function_overrides.o \
        vram.o

Or you can try adding vram.o to ML_SRC_REBOOT_OBJ in src/Makefile.src:
Code: [Select]
ifndef ML_SRC_REBOOT_OBJ
ML_SRC_REBOOT_OBJ = reboot.o \
disp_direct.o font_direct.o vram.o \
strlen.o strcmp.o gcc-libgcc.a \
cache.o \
footer.o
endif

names_are_hard

  • Contributor
  • Freshman
  • *****
  • Posts: 75
  • 200D idiot
Re: How to add .o dependency for disp_direct.c?
« Reply #2 on: July 13, 2019, 02:55:49 AM »
Sadly those didn't help.  Adding vram.o to ML_SRC_EXTRA_OBJS does nothing, which makes sense to me; they've already been compiled.  Was still worth a try.  Adding to ML_SRC_REBOOT_OBJ makes it get many additional undefined reference errors in vram.o.