topaz/makefile
h3llll 1070d03815 feat(layout)!: move /gl and /vk into rendering directory
as I was adding the audio module I realized it looks really ugly that
the audio-related stuff will be in its own directory and the renderer
modules will be scattered in root directory it makes way more sense this
way

Signed-off-by: Lorenzo Torres <lorenzo@sagittarius-a.org>
2025-11-05 19:39:44 +01:00

46 lines
940 B
Makefile

# SPDX-License-Identifier: BSD-3-Clause
include config.mk
ifeq (${DEBUG_BUILD},1)
CFLAGS += -ggdb -fsanitize=address,undefined -DDEBUG
endif
SRC:=\
topaz.c\
linear.c\
core/arena.c\
core/vector.c\
ifeq (${GRAPHICS_BACKEND},gl)
SRC += rendering/gl/gl.c\
rendering/gl/platform.c\
rendering/gl/renderer.c
endif
ifeq (${GRAPHICS_BACKEND},vk)
SRC += rendering/vk/platform.c\
rendering/vk/renderer.c\
rendering/vk/instance.c\
rendering/vk/physical_device.c\
rendering/vk/device.c
endif
OBJ:=${SRC:.c=.o}
all: ${OBJ}
${CC} ${LIBS} ${CFLAGS} ${OBJ} -o topaz
%.o: %.c
${CC} ${CFLAGS} -c $< -o $@
.PHONY: clean
clean:
@rm -rfv ${OBJ} topaz
INDENTABLE := $(shell find . -name "*.c" -o -name "*.h")
INDENTABLE := $(filter-out ./gl/gl.h,$(INDENTABLE))
INDENTABLE := $(filter-out ./rgfw.h,$(INDENTABLE))
indent: $(INDENTABLE:%=%.indent)
%.indent: %
indent $<
@rm $(notdir $<.BAK)