Question

I am working through a unix-like kernel development tutorial, and have come across a total noob problem I am sure: can anyone tell me what is wrong with this?

SOURCES=boot.o main.o

CFLAGS=-nostdlib -nostdinc -fno-builtin -fno-stack-protector
LDFLAGS=-Tlink.ld
ASFLAGS=-felf

all: $(SOURCES) link 

clean:
    -rm *.o kernel

link:
    ld $(LDFLAGS) -o kernel $(SOURCES)

.s.o:
    yasm $(ASFLAGS) $

Thanks in advance

Was it helpful?

Solution

You're using old-fashioned suffix rules, and missing some setup for that (plus an error in the very last line).

Switch to a normal pattern rule instead, no point in trying to fix the old style rule:

%.o: %.s
    yasm $(ASFLAGS) $<

OTHER TIPS

Well assuming boot.o and main.o are built using yasm your makefile lack a rule for .o

.o:
    yasm $(ASFLAGS) $
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top