From 18a86e1038b20cb6f8922beead08dcc24ba2a4d3 Mon Sep 17 00:00:00 2001 From: raven Date: Wed, 8 Apr 2026 22:51:39 -0500 Subject: rewrite and port to SDL3 --- Makefile | 34 +++++++++++++++++++--------------- 1 file changed, 19 insertions(+), 15 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 903b7e9..f6d01c7 100644 --- a/Makefile +++ b/Makefile @@ -1,22 +1,26 @@ -SDL_HEADERS=/usr/include/SDL2 +name=core -#CFLAGS=-g -Wall -fsanitize=undefined -fsanitize=address -I$(SDL_HEADERS) -CFLAGS=-g -Wall -I$(SDL_HEADERS) -#LFLAGS=-lSDL2 -fsanitize=undefined -fsanitize=address -LFLAGS=-lSDL2 -lm +CFLAGS= -g \ + $(shell pkg-config --cflags sdl3) \ + $(pkg-config --cflags sdl3-ttf) -core: core.o procfs.o memview.o - $(CC) -o $@ $^ $(LFLAGS) +LDFLAGS= \ + $(shell pkg-config --libs sdl3) \ + $(shell pkg-config --libs sdl3-ttf) -core.c: procfs.h memview.h -memview.c: procfs.h memview.h -procfs.c: procfs.h +srcs=$(shell find src -name '*.c') +objs=$(srcs:%.c=build/%.o) +deps=$(objs:.o=.d) -evilize: evilize.o +./build/$(name): $(objs) + $(CC) $(objs) -o $@ $(LDFLAGS) -.SUFFIXES: .c .o -.c.o: - $(CC) $(CFLAGS) -c -o $@ $< +./build/%.o: %.c + mkdir -p $(dir $@) + $(CC) $(CFLAGS) -MMD -MP -c $< -o $@ +.PHONY: clean clean: - rm -f *.o core + rm -rf build + +-include $(deps) -- cgit v1.2.3