From 3a02a0ee8a8ef369e33103bc2a5a2a5bb96e633b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?b=CA=B0edoh=E2=82=82=20sw=C3=A9?= Date: Sun, 29 Dec 2024 13:08:56 +0500 Subject: [PATCH] Get rid of nasty GNU Make extensions. --- Makefile | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index d0a614a..abd9f7a 100644 --- a/Makefile +++ b/Makefile @@ -1,14 +1,15 @@ +.SUFFIXES: .c .o SRCS = boot.c LDFLAGS = -flto -T linker.ld -nostdlib -Os CFLAGS = -flto -ffreestanding -fno-builtin -fno-pie -Wall -std=c2x -m16 -nostdlib -Os -nostartfiles -r -%.o: %.c - $(CC) $^ -o $@ $(CFLAGS) +.c.o: + $(CC) $< -o $@ $(CFLAGS) bin: $(SRCS:.c=.o) - $(CC) $(LDFLAGS) -o bin $^ + $(CC) $(LDFLAGS) -o bin $(SRCS:.c=.o) all: bin clean: - $(RM) $(SRCS:.c=.o) bin + rm -f $(SRCS:.c=.o) bin