Skip to content
Advertisement

Makefile: “No rule to make … needed by ‘all'” despite all files being there

I’m having this weird problem with this makefile. Despite having all the required .c files, the compiling process stops at the first instruction, with this error.

make: *** No rule to make target 'printerTest.umps', needed by 'all'. Stop.

This exact code with the same exact files works in Debian Linux, though in Manjaro Arch Linux it return the error shown above.

Here’s the makefile.

ifneq ($(wildcard /usr/bin/umps3),)
    UMPS3_DIR_PREFIX = /usr
    LIBDIR = $(UMPS3_DIR_PREFIX)/lib/x86_64-linux-gnu/umps3
else
    UMPS3_DIR_PREFIX = /usr/local
    LIBDIR = $(UMPS3_DIR_PREFIX)/lib/umps3
endif

INCDIR = $(UMPS3_DIR_PREFIX)/include/umps3/umps
SUPDIR = $(UMPS3_DIR_PREFIX)/share/umps3

TDEFS = h/print.h h/tconst.h $(INCDIR)/libumps.e Makefile

CFLAGS = -ffreestanding -ansi -c -mips1 -mabi=32 -mfp32 -mno-gpopt -G 0 -fno-pic -mno-abicalls
# -Wall

LDAOUTFLAGS = -G 0 -nostdlib -T $(SUPDIR)/umpsaout.ldscript
LDCOREFLAGS =  -G 0 -nostdlib -T $(SUPDIR)/umpscore.ldscript

CC = mipsel-linux-gnu-gcc
LD = mipsel-linux-gnu-ld
AS = mipsel-linux-gnu-as -KPIC

EF = umps3-elf2umps
UDEV = umps3-mkdev

#main target
all: printerTest.umps strConcat.umps 
    fibEight.umps fibEleven.umps 
    terminalTest2.umps terminalTest3.umps terminalTest4.umps 
    terminalTest5.umps  
    
%.o: %.c $(TDEFS)
    $(CC) $(CFLAGS) $<
    
%.t: %.o print.o  $(LIBDIR)/crti.o
    $(LD) $(LDAOUTFLAGS) $(LIBDIR)/crti.o $< print.o $(LIBDIR)/libumps.o -o $@
    
%.t.aout.umps: %.t
    $(EF) -a $<

%.umps: %.t.aout.umps
    $(UDEV) -f $@ $<

clean:
    rm -f *.o *.t *.umps

Thanks to anyone who answers in advance 🙂

Advertisement

Answer

As mentioned in the comments of the question, the problem was that the crti.o file was located on a particular hidden folder. Big thanks to the people who helped me in the comments 🙂

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement