makefile
This commit is contained in:
@@ -1,3 +1,4 @@
|
|||||||
|
build/
|
||||||
absinthe
|
absinthe
|
||||||
xdg-shell-protocol.h
|
xdg-shell-protocol.h
|
||||||
wlr-layer-shell-unstable-v1-protocol.h
|
wlr-layer-shell-unstable-v1-protocol.h
|
||||||
|
|||||||
@@ -1,13 +1,28 @@
|
|||||||
include config.mk
|
include config.mk
|
||||||
|
|
||||||
all: compile
|
TARGET = absinthe
|
||||||
|
|
||||||
|
SRC_FILES != find src/ -type f
|
||||||
|
OBJ_FILES = $(SRC_FILES:src/%.c=build/%.o)
|
||||||
|
|
||||||
|
all: $(TARGET)
|
||||||
|
|
||||||
proto:
|
proto:
|
||||||
$(WAYLAND_SCANNER) server-header $(WAYLAND_PROTOCOLS)/stable/xdg-shell/xdg-shell.xml xdg-shell-protocol.h
|
$(WAYLAND_SCANNER) server-header $(WAYLAND_PROTOCOLS)/stable/xdg-shell/xdg-shell.xml xdg-shell-protocol.h
|
||||||
$(WAYLAND_SCANNER) server-header ./protocols/wlr-layer-shell-unstable-v1.xml wlr-layer-shell-unstable-v1-protocol.h
|
$(WAYLAND_SCANNER) server-header ./protocols/wlr-layer-shell-unstable-v1.xml wlr-layer-shell-unstable-v1-protocol.h
|
||||||
|
|
||||||
compile: proto
|
$(OBJ_FILES):
|
||||||
$(CC) -o absinthe src/* $(CFLAGS) $(LDFLAGS)
|
mkdir -p $(@D)
|
||||||
|
$(CC) $(CFLAGS) -o $@ -c $(@:build/%.o=src/%.c)
|
||||||
|
|
||||||
|
$(TARGET): proto $(OBJ_FILES)
|
||||||
|
$(CC) -o absinthe $(OBJ_FILES) $(LDFLAGS)
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm -rf build/
|
||||||
|
rm absinthe
|
||||||
|
rm xdg-shell-protocol.h
|
||||||
|
rm wlr-layer-shell-unstable-v1-protocol.h
|
||||||
|
|
||||||
format:
|
format:
|
||||||
find src/ -type f | xargs $(CLANG_FORMAT) -i
|
find src/ -type f | xargs $(CLANG_FORMAT) -i
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ DEVFLAGS = -g
|
|||||||
|
|
||||||
CPPFLAGS += $(XWAYLAND) -DWLR_USE_UNSTABLE -I. -I./include
|
CPPFLAGS += $(XWAYLAND) -DWLR_USE_UNSTABLE -I. -I./include
|
||||||
|
|
||||||
CFLAGS += -O2 -march=native -Wall -Wextra -Wpedantic
|
CFLAGS += -O2 -march=native -Wall -Wextra
|
||||||
CFLAGS += $(PKG_CFLAGS) $(WLR_CFLAGS)
|
CFLAGS += $(PKG_CFLAGS) $(WLR_CFLAGS)
|
||||||
CFLAGS += $(CPPFLAGS)
|
CFLAGS += $(CPPFLAGS)
|
||||||
CFLAGS += $(DEVFLAGS)
|
CFLAGS += $(DEVFLAGS)
|
||||||
|
|||||||
+5
-4
@@ -21,12 +21,13 @@ toplevel_at(absn_server *server, double lx, double ly,
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
struct wlr_scene_buffer *scene_buffer = NULL;
|
||||||
|
struct wlr_scene_surface *scene_surface = NULL;
|
||||||
|
|
||||||
switch (node->type) {
|
switch (node->type) {
|
||||||
case WLR_SCENE_NODE_BUFFER:
|
case WLR_SCENE_NODE_BUFFER:
|
||||||
struct wlr_scene_buffer *scene_buffer =
|
scene_buffer = wlr_scene_buffer_from_node(node);
|
||||||
wlr_scene_buffer_from_node(node);
|
scene_surface = wlr_scene_surface_try_from_buffer(scene_buffer);
|
||||||
struct wlr_scene_surface *scene_surface =
|
|
||||||
wlr_scene_surface_try_from_buffer(scene_buffer);
|
|
||||||
if (!scene_surface) {
|
if (!scene_surface) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user