1

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

Robᵩ
  • 163,533
  • 20
  • 239
  • 308
roninbv
  • 13
  • 4

2 Answers2

0

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

.o:
    yasm $(ASFLAGS) $
0

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) $<
Mat
  • 202,337
  • 40
  • 393
  • 406