config.mk and bsd-compatable make
This commit is contained in:
@@ -1,16 +1,13 @@
|
||||
include config.mk
|
||||
|
||||
all: compile
|
||||
|
||||
proto:
|
||||
wayland-scanner server-header $(shell pkg-config --variable=pkgdatadir 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 $(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
|
||||
|
||||
compile: proto
|
||||
gcc -o absinthe src/* \
|
||||
-Wall -Wextra -Wpedantic \
|
||||
-DXWAYLAND \
|
||||
-I./ -I./include -DWLR_USE_UNSTABLE $(shell pkg-config wlroots-0.20 --libs --cflags) -lwayland-server -lxkbcommon \
|
||||
-O3 \
|
||||
-g
|
||||
cc -o absinthe src/* $(CFLAGS) $(LDFLAGS)
|
||||
|
||||
format:
|
||||
find src/ -type f -print0 | xargs -0 clang-format -i
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
XWAYLAND = -DXWAYLAND
|
||||
XLIBS = xcb xcb-icccm
|
||||
|
||||
# tools
|
||||
PKG_CONFIG ?= pkg-config
|
||||
CC ?= clang
|
||||
CLANG_FORMAT=clang-format22
|
||||
|
||||
PKGS = wayland-server xkbcommon libinput $(XLIBS)
|
||||
|
||||
PKG_CFLAGS != $(PKG_CONFIG) --cflags $(PKGS)
|
||||
PKG_LDFLAGS != $(PKG_CONFIG) --libs $(PKGS)
|
||||
|
||||
WAYLAND_SCANNER != $(PKG_CONFIG) --variable=wayland_scanner wayland-scanner
|
||||
WAYLAND_PROTOCOLS != $(PKG_CONFIG) --variable=pkgdatadir wayland-protocols
|
||||
|
||||
WLR_CFLAGS != $(PKG_CONFIG) --cflags wlroots-0.20
|
||||
WLR_LDFLAGS != $(PKG_CONFIG) --libs wlroots-0.20
|
||||
|
||||
DEVFLAGS = -g
|
||||
|
||||
CPPFLAGS += $(XWAYLAND) -DWLR_USE_UNSTABLE -I. -I./include
|
||||
|
||||
CFLAGS += -O2 -march=native -Wall -Wextra -Wpedantic
|
||||
CFLAGS += $(PKG_CFLAGS) $(WLR_CFLAGS)
|
||||
CFLAGS += $(CPPFLAGS)
|
||||
CFLAGS += $(DEVFLAGS)
|
||||
|
||||
LDFLAGS += $(PKG_LDFLAGS) $(WLR_LDFLAGS)
|
||||
+4
-1
@@ -1,7 +1,6 @@
|
||||
#ifndef __TYPES_H_
|
||||
#define __TYPES_H_
|
||||
|
||||
#include <linux/input-event-codes.h>
|
||||
#include <wayland-server-core.h>
|
||||
#include <wlr/backend.h>
|
||||
#include <wlr/render/allocator.h>
|
||||
@@ -22,6 +21,10 @@
|
||||
#include <xcb/xcb_icccm.h>
|
||||
#endif
|
||||
|
||||
#define BTN_LEFT 0x110
|
||||
#define BTN_RIGHT 0x111
|
||||
#define BTN_MIDDLE 0x112
|
||||
|
||||
#define MAX(A, B) (A) > (B) ? (A) : (B)
|
||||
#define MIN(A, B) (A) < (B) ? (A) : (B)
|
||||
/* macro for adding listener for event */
|
||||
|
||||
Reference in New Issue
Block a user