summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--Makefile36
-rw-r--r--core/logging.c (renamed from src/logging.c)0
-rw-r--r--core/make.config6
-rw-r--r--include/rune_logging.h2
-rw-r--r--render-vulkan/make.config7
6 files changed, 35 insertions, 17 deletions
diff --git a/.gitignore b/.gitignore
index 29cd635..add216e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -20,6 +20,7 @@
*.out
*.patch
*.so
+*.sym
*.tar
*.xz
*.zstd
diff --git a/Makefile b/Makefile
index b6c0086..6839dd9 100644
--- a/Makefile
+++ b/Makefile
@@ -2,41 +2,45 @@ CC?=gcc
INCLUDE?=-Iinclude
CFLAGS?=-O0
LDFLAGS?=
-LIBS?=-lglfw -lvulkan
+RENDER?=render-vulkan
+PLATFORM?=linux
# -- Do not edit below this line --
VERSION:="$(shell git describe --abbrev=4 --dirty --always --tags)"
+CC:=$(CC)
INCLUDE:=$(INCLUDE)
-CFLAGS:=$(CFLAGS) -Wall -Wextra -DVERSION=\"$(VERSION)\" -ggdb -fstack-protector-all -fPIC
+CFLAGS:=$(CFLAGS) $(INCLUDE) -Wall -Wextra -DVERSION=\"$(VERSION)\" -ggdb -fstack-protector-all -fPIC
LDFLAGS:=$(LDFLAGS) -shared
-LIBS:=$(LIBS)
-ENGINE=librune.so
-ENGINE_OBJS=src/init.o \
- src/graphics.o \
- src/callbacks.o \
+COREDIR:=core
+RENDERDIR:=$(RENDER)
+ENGINE:=librune.so
-LINK_LIST=$(LDFLAGS) \
- $(ENGINE_OBJS) \
- $(LIBS) \
+include $(COREDIR)/make.config $(RENDERDIR)/make.config
+
+LDFLAGS:=$(LDFLAGS) $(RENDER_LDFLAGS) $(CORE_LDFLAGS)
+LIBS:=$(LIBS) $(RENDER_LIBS) $(CORE_LIBS)
+OBJS:=$(RENDER_OBJS) $(CORE_OBJS)
.PHONY: all clean install install-headers
.SUFFIXES: .o .c
all: $(ENGINE)
-$(ENGINE): $(ENGINE_OBJS)
- @$(CC) -o $@ $(LINK_LIST)
+$(ENGINE): $(OBJS)
+ @$(CC) -o $@ $(LIBS) $(LDFLAGS) $?
@echo [LD] $@
+ @objcopy --only-keep-debug $(ENGINE) $(ENGINE:.so=.sym)
+ @strip -s $(ENGINE)
+ @objcopy --add-gnu-debuglink=$(ENGINE:.so=.sym) $(ENGINE)
+ @echo [strip] $(ENGINE)
.c.o:
@$(CC) -MD -c $< -o $@ $(CFLAGS) $(INCLUDE)
@echo [CC] $@
clean:
- $(RM) $(ENGINE)
- $(RM) $(ENGINE_OBJS) *.o */*.o */*/*.o
- $(RM) $(ENGINE_OBJS:.o=.d) *.d */*.d */*/*.d
+ $(RM) $(OBJS) $(OBJS:o=.d)
--include $(ENGINE_OBJS:.o=.d)
+-include $(OBJS:.o=.d)
diff --git a/src/logging.c b/core/logging.c
index e755710..e755710 100644
--- a/src/logging.c
+++ b/core/logging.c
diff --git a/core/make.config b/core/make.config
new file mode 100644
index 0000000..94dce85
--- /dev/null
+++ b/core/make.config
@@ -0,0 +1,6 @@
+CORE_LDFLAGS=
+CORE_LIBS=-lglfw
+
+CORE_OBJS=$(COREDIR)/graphics.o \
+ $(COREDIR)/init.o \
+ $(COREDIR)/logging.o \
diff --git a/include/rune_logging.h b/include/rune_logging.h
index a0b9e29..f8876db 100644
--- a/include/rune_logging.h
+++ b/include/rune_logging.h
@@ -11,6 +11,6 @@ enum log_level {
LOG_DEBUG
};
-void log_output(int level, const char *fmt, ...);
+RAPI void log_output(int level, const char *fmt, ...);
#endif
diff --git a/render-vulkan/make.config b/render-vulkan/make.config
new file mode 100644
index 0000000..1999079
--- /dev/null
+++ b/render-vulkan/make.config
@@ -0,0 +1,7 @@
+RENDER_LDFLAGS=
+RENDER_LIBS=-lvulkan
+
+RENDER_OBJS=$(RENDERDIR)/vulkan_context.o \
+ $(RENDERDIR)/vulkan_debug.o \
+ $(RENDERDIR)/vulkan_device.o \
+ $(RENDERDIR)/vulkan_swapchain.o \