Compare commits
No commits in common. "51e5de1c8bc11c853e7dbf8d0c44e5a783e8a364" and "ab4cb6e28365cf8754d6d3bdd293c05abfc27e26" have entirely different histories.
51e5de1c8b
...
ab4cb6e283
13 changed files with 21 additions and 135 deletions
60
Makefile
60
Makefile
|
|
@ -1,11 +1,10 @@
|
||||||
.POSIX:
|
.POSIX:
|
||||||
.SUFFIXES:
|
.SUFFIXES:
|
||||||
.DEFAULT_GOAL := all
|
|
||||||
|
|
||||||
include config.mk
|
include config.mk
|
||||||
|
|
||||||
# flags for compiling
|
# flags for compiling
|
||||||
DWLCPPFLAGS = -I$(INCLUDE) -DWLR_USE_UNSTABLE -D_POSIX_C_SOURCE=200809L \
|
DWLCPPFLAGS = -I. -DWLR_USE_UNSTABLE -D_POSIX_C_SOURCE=200809L \
|
||||||
-DVERSION=\"$(VERSION)\" $(XWAYLAND)
|
-DVERSION=\"$(VERSION)\" $(XWAYLAND)
|
||||||
DWLDEVCFLAGS = -g -Wpedantic -Wall -Wextra -Wdeclaration-after-statement \
|
DWLDEVCFLAGS = -g -Wpedantic -Wall -Wextra -Wdeclaration-after-statement \
|
||||||
-Wno-unused-parameter -Wshadow -Wunused-macros -Werror=strict-prototypes \
|
-Wno-unused-parameter -Wshadow -Wunused-macros -Werror=strict-prototypes \
|
||||||
|
|
@ -17,31 +16,13 @@ PKGS = wayland-server xkbcommon libinput $(XLIBS)
|
||||||
DWLCFLAGS = `$(PKG_CONFIG) --cflags $(PKGS)` $(WLR_INCS) $(DWLCPPFLAGS) $(DWLDEVCFLAGS) $(CFLAGS)
|
DWLCFLAGS = `$(PKG_CONFIG) --cflags $(PKGS)` $(WLR_INCS) $(DWLCPPFLAGS) $(DWLDEVCFLAGS) $(CFLAGS)
|
||||||
LDLIBS = `$(PKG_CONFIG) --libs $(PKGS)` $(WLR_LIBS) -lm $(LIBS)
|
LDLIBS = `$(PKG_CONFIG) --libs $(PKGS)` $(WLR_LIBS) -lm $(LIBS)
|
||||||
|
|
||||||
# macros to relevant path definitions
|
all: dwl
|
||||||
define mkbin
|
dwl: dwl.o util.o
|
||||||
$(addprefix $(BIN)/,$1)
|
$(CC) dwl.o util.o $(DWLCFLAGS) $(LDFLAGS) $(LDLIBS) -o $@
|
||||||
endef
|
dwl.o: dwl.c client.h config.h config.mk cursor-shape-v1-protocol.h \
|
||||||
define mkobj
|
|
||||||
$(addprefix $(OBJ)/,$1)
|
|
||||||
endef
|
|
||||||
define mkinclude
|
|
||||||
$(addprefix $(INCLUDE)/,$1)
|
|
||||||
endef
|
|
||||||
define mksrc
|
|
||||||
$(addprefix $(SRC)/,$1)
|
|
||||||
endef
|
|
||||||
|
|
||||||
.PHONY: setup
|
|
||||||
setup:
|
|
||||||
mkdir -p $(BIN) $(BUILD) $(INCLUDE) $(OBJ)
|
|
||||||
|
|
||||||
all: setup $(call mkbin,dwl)
|
|
||||||
$(BIN)/dwl: $(call mkobj,dwl.o util.o)
|
|
||||||
$(CC) $^ $(DWLCFLAGS) $(LDFLAGS) $(LDLIBS) -o $@
|
|
||||||
$(OBJ)/dwl.o: $(call mksrc,dwl.c client.h) config.mk $(call mkinclude,config.h cursor-shape-v1-protocol.h \
|
|
||||||
pointer-constraints-unstable-v1-protocol.h wlr-layer-shell-unstable-v1-protocol.h \
|
pointer-constraints-unstable-v1-protocol.h wlr-layer-shell-unstable-v1-protocol.h \
|
||||||
wlr-output-power-management-unstable-v1-protocol.h xdg-shell-protocol.h)
|
wlr-output-power-management-unstable-v1-protocol.h xdg-shell-protocol.h
|
||||||
$(OBJ)/util.o: $(call mksrc,util.c util.h)
|
util.o: util.c util.h
|
||||||
|
|
||||||
# wayland-scanner is a tool which generates C headers and rigging for Wayland
|
# wayland-scanner is a tool which generates C headers and rigging for Wayland
|
||||||
# protocols, which are specified in XML. wlroots requires you to rig these up
|
# protocols, which are specified in XML. wlroots requires you to rig these up
|
||||||
|
|
@ -49,39 +30,39 @@ $(OBJ)/util.o: $(call mksrc,util.c util.h)
|
||||||
WAYLAND_SCANNER = `$(PKG_CONFIG) --variable=wayland_scanner wayland-scanner`
|
WAYLAND_SCANNER = `$(PKG_CONFIG) --variable=wayland_scanner wayland-scanner`
|
||||||
WAYLAND_PROTOCOLS = `$(PKG_CONFIG) --variable=pkgdatadir wayland-protocols`
|
WAYLAND_PROTOCOLS = `$(PKG_CONFIG) --variable=pkgdatadir wayland-protocols`
|
||||||
|
|
||||||
$(INCLUDE)/cursor-shape-v1-protocol.h:
|
cursor-shape-v1-protocol.h:
|
||||||
$(WAYLAND_SCANNER) enum-header \
|
$(WAYLAND_SCANNER) enum-header \
|
||||||
$(WAYLAND_PROTOCOLS)/staging/cursor-shape/cursor-shape-v1.xml $@
|
$(WAYLAND_PROTOCOLS)/staging/cursor-shape/cursor-shape-v1.xml $@
|
||||||
$(INCLUDE)/pointer-constraints-unstable-v1-protocol.h:
|
pointer-constraints-unstable-v1-protocol.h:
|
||||||
$(WAYLAND_SCANNER) enum-header \
|
$(WAYLAND_SCANNER) enum-header \
|
||||||
$(WAYLAND_PROTOCOLS)/unstable/pointer-constraints/pointer-constraints-unstable-v1.xml $@
|
$(WAYLAND_PROTOCOLS)/unstable/pointer-constraints/pointer-constraints-unstable-v1.xml $@
|
||||||
$(INCLUDE)/wlr-layer-shell-unstable-v1-protocol.h:
|
wlr-layer-shell-unstable-v1-protocol.h:
|
||||||
$(WAYLAND_SCANNER) enum-header \
|
$(WAYLAND_SCANNER) enum-header \
|
||||||
protocols/wlr-layer-shell-unstable-v1.xml $@
|
protocols/wlr-layer-shell-unstable-v1.xml $@
|
||||||
$(INCLUDE)/wlr-output-power-management-unstable-v1-protocol.h:
|
wlr-output-power-management-unstable-v1-protocol.h:
|
||||||
$(WAYLAND_SCANNER) server-header \
|
$(WAYLAND_SCANNER) server-header \
|
||||||
protocols/wlr-output-power-management-unstable-v1.xml $@
|
protocols/wlr-output-power-management-unstable-v1.xml $@
|
||||||
$(INCLUDE)/xdg-shell-protocol.h:
|
xdg-shell-protocol.h:
|
||||||
$(WAYLAND_SCANNER) server-header \
|
$(WAYLAND_SCANNER) server-header \
|
||||||
$(WAYLAND_PROTOCOLS)/stable/xdg-shell/xdg-shell.xml $@
|
$(WAYLAND_PROTOCOLS)/stable/xdg-shell/xdg-shell.xml $@
|
||||||
|
|
||||||
$(INCLUDE)/config.h:
|
config.h:
|
||||||
cp $(SRC)/config.def.h $@
|
cp config.def.h $@
|
||||||
clean:
|
clean:
|
||||||
rm -rf $(INCLUDE) $(OBJ) $(BUILD) $(BIN)
|
rm -f dwl *.o *-protocol.h
|
||||||
|
|
||||||
dist: clean
|
dist: clean
|
||||||
mkdir -p dwl-$(VERSION)
|
mkdir -p dwl-$(VERSION)
|
||||||
cp -R LICENSE Makefile CHANGELOG.md README.md src \
|
cp -R LICENSE* Makefile CHANGELOG.md README.md client.h config.def.h \
|
||||||
config.mk protocols dwl.1 dwl.desktop \
|
config.mk protocols dwl.1 dwl.c util.c util.h dwl.desktop \
|
||||||
dwl-$(VERSION)
|
dwl-$(VERSION)
|
||||||
tar -caf dwl-$(VERSION).tar.gz dwl-$(VERSION)
|
tar -caf dwl-$(VERSION).tar.gz dwl-$(VERSION)
|
||||||
rm -rf dwl-$(VERSION)
|
rm -rf dwl-$(VERSION)
|
||||||
|
|
||||||
install: $(BIN)/dwl
|
install: dwl
|
||||||
mkdir -p $(DESTDIR)$(PREFIX)/bin
|
mkdir -p $(DESTDIR)$(PREFIX)/bin
|
||||||
rm -f $(DESTDIR)$(PREFIX)/bin/dwl
|
rm -f $(DESTDIR)$(PREFIX)/bin/dwl
|
||||||
cp -f $(BIN)/dwl $(DESTDIR)$(PREFIX)/bin
|
cp -f dwl $(DESTDIR)$(PREFIX)/bin
|
||||||
chmod 755 $(DESTDIR)$(PREFIX)/bin/dwl
|
chmod 755 $(DESTDIR)$(PREFIX)/bin/dwl
|
||||||
mkdir -p $(DESTDIR)$(MANDIR)/man1
|
mkdir -p $(DESTDIR)$(MANDIR)/man1
|
||||||
cp -f dwl.1 $(DESTDIR)$(MANDIR)/man1
|
cp -f dwl.1 $(DESTDIR)$(MANDIR)/man1
|
||||||
|
|
@ -93,5 +74,6 @@ uninstall:
|
||||||
rm -f $(DESTDIR)$(PREFIX)/bin/dwl $(DESTDIR)$(MANDIR)/man1/dwl.1 \
|
rm -f $(DESTDIR)$(PREFIX)/bin/dwl $(DESTDIR)$(MANDIR)/man1/dwl.1 \
|
||||||
$(DESTDIR)$(DATADIR)/wayland-sessions/dwl.desktop
|
$(DESTDIR)$(DATADIR)/wayland-sessions/dwl.desktop
|
||||||
|
|
||||||
%.c %.o:
|
.SUFFIXES: .c .o
|
||||||
|
.c.o:
|
||||||
$(CC) $(CPPFLAGS) $(DWLCFLAGS) -o $@ -c $<
|
$(CC) $(CPPFLAGS) $(DWLCFLAGS) -o $@ -c $<
|
||||||
|
|
|
||||||
|
|
@ -8,12 +8,6 @@ PREFIX = /usr/local
|
||||||
MANDIR = $(PREFIX)/share/man
|
MANDIR = $(PREFIX)/share/man
|
||||||
DATADIR = $(PREFIX)/share
|
DATADIR = $(PREFIX)/share
|
||||||
|
|
||||||
SRC = src
|
|
||||||
BUILD = build
|
|
||||||
OBJ = $(BUILD)/obj
|
|
||||||
INCLUDE = $(BUILD)/include
|
|
||||||
BIN = bin
|
|
||||||
|
|
||||||
WLR_INCS = `$(PKG_CONFIG) --cflags wlroots-0.19`
|
WLR_INCS = `$(PKG_CONFIG) --cflags wlroots-0.19`
|
||||||
WLR_LIBS = `$(PKG_CONFIG) --libs wlroots-0.19`
|
WLR_LIBS = `$(PKG_CONFIG) --libs wlroots-0.19`
|
||||||
|
|
||||||
|
|
|
||||||
27
flake.lock
generated
27
flake.lock
generated
|
|
@ -1,27 +0,0 @@
|
||||||
{
|
|
||||||
"nodes": {
|
|
||||||
"nixpkgs": {
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1755922037,
|
|
||||||
"narHash": "sha256-wY1+2JPH0ZZC4BQefoZw/k+3+DowFyfOxv17CN/idKs=",
|
|
||||||
"owner": "nixos",
|
|
||||||
"repo": "nixpkgs",
|
|
||||||
"rev": "b1b3291469652d5a2edb0becc4ef0246fff97a7c",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "nixos",
|
|
||||||
"ref": "nixos-25.05",
|
|
||||||
"repo": "nixpkgs",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"root": {
|
|
||||||
"inputs": {
|
|
||||||
"nixpkgs": "nixpkgs"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"root": "root",
|
|
||||||
"version": 7
|
|
||||||
}
|
|
||||||
63
flake.nix
63
flake.nix
|
|
@ -1,63 +0,0 @@
|
||||||
{
|
|
||||||
description = "DWL Development Shell";
|
|
||||||
|
|
||||||
inputs = {
|
|
||||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-25.05";
|
|
||||||
};
|
|
||||||
|
|
||||||
outputs = {nixpkgs, ...}: let
|
|
||||||
system = "x86_64-linux";
|
|
||||||
enableXWayland = false;
|
|
||||||
in {
|
|
||||||
devShells."${system}".default = let
|
|
||||||
pkgs = import nixpkgs {
|
|
||||||
inherit system;
|
|
||||||
};
|
|
||||||
lib = nixpkgs.lib;
|
|
||||||
stdenv = pkgs.stdenv;
|
|
||||||
in
|
|
||||||
pkgs.mkShell {
|
|
||||||
packages = with pkgs;
|
|
||||||
[
|
|
||||||
# NativeBuildInputs
|
|
||||||
installShellFiles
|
|
||||||
pkg-config
|
|
||||||
wayland-scanner
|
|
||||||
|
|
||||||
# BuildInputs
|
|
||||||
libinput
|
|
||||||
xorg.libxcb
|
|
||||||
libxkbcommon
|
|
||||||
pixman
|
|
||||||
wayland
|
|
||||||
wayland-protocols
|
|
||||||
wlroots_0_19
|
|
||||||
]
|
|
||||||
++ lib.optionals enableXWayland
|
|
||||||
[
|
|
||||||
# XWayland
|
|
||||||
xorg.libX11
|
|
||||||
xorg.xcbutilwm
|
|
||||||
xwayland
|
|
||||||
];
|
|
||||||
|
|
||||||
shellHook = let
|
|
||||||
makeFlags =
|
|
||||||
lib.strings.concatStringsSep " "
|
|
||||||
([
|
|
||||||
"PKG_CONFIG=${stdenv.cc.targetPrefix}pkg-config"
|
|
||||||
"WAYLAND_SCANNER=wayland-scanner"
|
|
||||||
# "PREFIX=$(out)"
|
|
||||||
# "MANDIR=$(man)/share/man"
|
|
||||||
]
|
|
||||||
++ lib.optionals enableXWayland [
|
|
||||||
''XWAYLAND="-DXWAYLAND"''
|
|
||||||
''XLIBS="xcb xcb-icccm"''
|
|
||||||
]);
|
|
||||||
in ''
|
|
||||||
TERM=xterm-256color
|
|
||||||
alias mk='${makeFlags} make'
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue