aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorFilip Wandzio <contact@philw.dev>2025-12-30 02:45:11 +0100
committerFilip Wandzio <contact@philw.dev>2025-12-30 02:45:11 +0100
commit4c90d1d9e4092f9ee0106d316829144653a276ea (patch)
treecba5e7697a1334da068c5fa5e5951e00696fb903 /Makefile
parent11b1ff4691ff3e0f8346e7431fa3f90cc846fc5d (diff)
downloaddwm-4c90d1d9e4092f9ee0106d316829144653a276ea.tar.gz
dwm-4c90d1d9e4092f9ee0106d316829144653a276ea.zip
Split monolithic dwm.h into modular headers and group them by it's functionalities
The new plan of refactoring this project is to split entire monolithic codebase into separate, (kind of) independent modules. This will help with understanding the code by turning off modules and deciding which ones require some work. Signed-off-by: Filip Wandzio <contact@philw.dev>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile116
1 files changed, 86 insertions, 30 deletions
diff --git a/Makefile b/Makefile
index ad5119d..84c0b68 100644
--- a/Makefile
+++ b/Makefile
@@ -1,46 +1,95 @@
1# dwm - dynamic window manager 1# =========================
2# See LICENSE file for copyright and license details. 2# config
3# =========================
3 4
4include src/config/config.mk 5PREFIX = /usr/local
6MANPREFIX = ${PREFIX}/share/man
5 7
6SRC = src/drw/drw.c src/core/dwm.c src/util/util.c 8X11INC = /usr/X11R6/include
7OBJ = $(SRC:.c=.o) 9X11LIB = /usr/X11R6/lib
8 10
9CFLAGS += -std=c99 -pedantic -Wall -Wno-deprecated-declarations -Os \ 11FREETYPEINC = /usr/include/freetype2
10 -I/usr/X11R6/include \ 12FREETYPELIBS= -lfontconfig -lXft
11 -I/usr/include/freetype2 \ 13
12 -I./src/util \ 14XINERAMAFLAGS = -DXINERAMA
15XINERAMALIBS = -lXinerama
16
17# =========================
18# flags
19# =========================
20
21INCS = \
22 -I${X11INC} \
23 -I${FREETYPEINC} \
24 -I./src \
13 -I./src/drw \ 25 -I./src/drw \
14 -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_XOPEN_SOURCE=700L \ 26 -I./src/util
15 -DVERSION=\"6.4\" -DXINERAMA 27
28CPPFLAGS = \
29 -D_DEFAULT_SOURCE \
30 -D_BSD_SOURCE \
31 -D_XOPEN_SOURCE=700L \
32 -DVERSION=\"${VERSION}\" \
33 ${XINERAMAFLAGS}
34
35CFLAGS = \
36 -std=c99 \
37 -pedantic \
38 -Wall \
39 -Wno-deprecated-declarations \
40 -Os \
41 ${INCS} \
42 ${CPPFLAGS}
43
44LDFLAGS = \
45 -L${X11LIB} \
46 -lX11 \
47 ${XINERAMALIBS} \
48 ${FREETYPELIBS} \
49 -lX11-xcb \
50 -lxcb \
51 -lxcb-res
52
53CC = clang
54
55# =========================
56# sources
57# =========================
58
59SRC = \
60 src/core/dwm.c \
61 src/drw/drw.c \
62 src/util/util.c
63 # src/core/globals.c \
64 # src/x11/xevents.c \
65 # src/x11/xutil.c \
66 # src/wm/client.c \
67 # src/wm/monitor.c \
68 # src/wm/layout.c \
69 # src/ui/input.c \
70 # src/ui/bar.c \
71 # src/ui/systray.c \
16 72
17LDFLAGS += -L/usr/X11R6/lib -lX11 -lXinerama -lfontconfig -lXft -lX11-xcb -lxcb -lxcb-res 73
74OBJ = ${SRC:.c=.o}
75
76# =========================
77# build rules
78# =========================
18 79
19all: dwm 80all: dwm
20 81
21%.o: %.c 82%.o: %.c
22 ${CC} -c ${CFLAGS} -o $@ $< 83 ${CC} -c ${CFLAGS} -o $@ $<
23 84
24${OBJ}: src/config/config.h src/config/config.mk
25
26config.h:
27 cp src/config/config.def.h $@
28
29dwm: ${OBJ} 85dwm: ${OBJ}
30 ${CC} -o $@ ${OBJ} ${LDFLAGS} 86 ${CC} -o $@ ${OBJ} ${LDFLAGS}
31 87
32clean: 88# =========================
33 rm -f dwm ${OBJ} dwm-${VERSION}.tar.gz 89# install
90# =========================
34 91
35dist: clean 92install: dwm
36 mkdir -p dwm-${VERSION}
37 cp -R LICENSE Makefile README src/config/config.def.h src/config/config.mk \
38 src/core/dwm.1 src/drw/drw.h src/util/util.h ${SRC} /assets/dwm.png src/transient/transient.c dwm-${VERSION}
39 tar -cf dwm-${VERSION}.tar dwm-${VERSION}
40 gzip dwm-${VERSION}.tar
41 rm -rf dwm-${VERSION}
42
43install: all
44 mkdir -p ${DESTDIR}${PREFIX}/bin 93 mkdir -p ${DESTDIR}${PREFIX}/bin
45 cp -f dwm ${DESTDIR}${PREFIX}/bin 94 cp -f dwm ${DESTDIR}${PREFIX}/bin
46 chmod 755 ${DESTDIR}${PREFIX}/bin/dwm 95 chmod 755 ${DESTDIR}${PREFIX}/bin/dwm
@@ -50,6 +99,13 @@ install: all
50 99
51uninstall: 100uninstall:
52 rm -f ${DESTDIR}${PREFIX}/bin/dwm \ 101 rm -f ${DESTDIR}${PREFIX}/bin/dwm \
53 ${DESTDIR}${MANPREFIX}/man1/dwm.1 102 ${DESTDIR}${MANPREFIX}/man1/dwm.1
103
104# =========================
105# housekeeping
106# =========================
107
108clean:
109 rm -f dwm ${OBJ}
54 110
55.PHONY: all clean dist install uninstall 111.PHONY: all clean install uninstall