aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorphilw <dscr@duck.com>2025-04-15 01:41:05 +0200
committerphilw <dscr@duck.com>2025-04-15 01:41:05 +0200
commit8146021a2ea4130cfb0d2bf846b451ec538b1bb6 (patch)
tree3a946ef5ee4769bf4eae89b4e77858cc67b8060b /Makefile
parent515b7f3b4f048b29325e3e38f0f4a2ef898e8daa (diff)
downloaddwm-8146021a2ea4130cfb0d2bf846b451ec538b1bb6.tar.gz
dwm-8146021a2ea4130cfb0d2bf846b451ec538b1bb6.zip
Refactor the project
Refactored core logic to improve readability and maintainability. Documented the 'transient.c' file to provide clear explanations of its purpose and functions. Updated the 'util.c' file with necessary comments and improvements to existing code. Documented the 'util.h' header file to clarify function prototypes and usage. This update should improve the overall code quality and make it easier for future development. Signed-off-by: philw <dscr@duck.com>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile32
1 files changed, 21 insertions, 11 deletions
diff --git a/Makefile b/Makefile
index ffa69b4..ad5119d 100644
--- a/Makefile
+++ b/Makefile
@@ -1,20 +1,30 @@
1# dwm - dynamic window manager 1# dwm - dynamic window manager
2# See LICENSE file for copyright and license details. 2# See LICENSE file for copyright and license details.
3 3
4include config.mk 4include src/config/config.mk
5 5
6SRC = drw.c dwm.c util.c 6SRC = src/drw/drw.c src/core/dwm.c src/util/util.c
7OBJ = ${SRC:.c=.o} 7OBJ = $(SRC:.c=.o)
8
9CFLAGS += -std=c99 -pedantic -Wall -Wno-deprecated-declarations -Os \
10 -I/usr/X11R6/include \
11 -I/usr/include/freetype2 \
12 -I./src/util \
13 -I./src/drw \
14 -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_XOPEN_SOURCE=700L \
15 -DVERSION=\"6.4\" -DXINERAMA
16
17LDFLAGS += -L/usr/X11R6/lib -lX11 -lXinerama -lfontconfig -lXft -lX11-xcb -lxcb -lxcb-res
8 18
9all: dwm 19all: dwm
10 20
11.c.o: 21%.o: %.c
12 ${CC} -c ${CFLAGS} $< 22 ${CC} -c ${CFLAGS} -o $@ $<
13 23
14${OBJ}: config.h config.mk 24${OBJ}: src/config/config.h src/config/config.mk
15 25
16config.h: 26config.h:
17 cp config.def.h $@ 27 cp src/config/config.def.h $@
18 28
19dwm: ${OBJ} 29dwm: ${OBJ}
20 ${CC} -o $@ ${OBJ} ${LDFLAGS} 30 ${CC} -o $@ ${OBJ} ${LDFLAGS}
@@ -24,8 +34,8 @@ clean:
24 34
25dist: clean 35dist: clean
26 mkdir -p dwm-${VERSION} 36 mkdir -p dwm-${VERSION}
27 cp -R LICENSE Makefile README config.def.h config.mk\ 37 cp -R LICENSE Makefile README src/config/config.def.h src/config/config.mk \
28 dwm.1 drw.h util.h ${SRC} dwm.png transient.c dwm-${VERSION} 38 src/core/dwm.1 src/drw/drw.h src/util/util.h ${SRC} /assets/dwm.png src/transient/transient.c dwm-${VERSION}
29 tar -cf dwm-${VERSION}.tar dwm-${VERSION} 39 tar -cf dwm-${VERSION}.tar dwm-${VERSION}
30 gzip dwm-${VERSION}.tar 40 gzip dwm-${VERSION}.tar
31 rm -rf dwm-${VERSION} 41 rm -rf dwm-${VERSION}
@@ -35,11 +45,11 @@ install: all
35 cp -f dwm ${DESTDIR}${PREFIX}/bin 45 cp -f dwm ${DESTDIR}${PREFIX}/bin
36 chmod 755 ${DESTDIR}${PREFIX}/bin/dwm 46 chmod 755 ${DESTDIR}${PREFIX}/bin/dwm
37 mkdir -p ${DESTDIR}${MANPREFIX}/man1 47 mkdir -p ${DESTDIR}${MANPREFIX}/man1
38 sed "s/VERSION/${VERSION}/g" < dwm.1 > ${DESTDIR}${MANPREFIX}/man1/dwm.1 48 sed "s/VERSION/${VERSION}/g" < assets/dwm.1 > ${DESTDIR}${MANPREFIX}/man1/dwm.1
39 chmod 644 ${DESTDIR}${MANPREFIX}/man1/dwm.1 49 chmod 644 ${DESTDIR}${MANPREFIX}/man1/dwm.1
40 50
41uninstall: 51uninstall:
42 rm -f ${DESTDIR}${PREFIX}/bin/dwm\ 52 rm -f ${DESTDIR}${PREFIX}/bin/dwm \
43 ${DESTDIR}${MANPREFIX}/man1/dwm.1 53 ${DESTDIR}${MANPREFIX}/man1/dwm.1
44 54
45.PHONY: all clean dist install uninstall 55.PHONY: all clean dist install uninstall