diff options
| author | philw <dscr@duck.com> | 2025-04-15 01:41:05 +0200 |
|---|---|---|
| committer | philw <dscr@duck.com> | 2025-04-15 01:41:05 +0200 |
| commit | 8146021a2ea4130cfb0d2bf846b451ec538b1bb6 (patch) | |
| tree | 3a946ef5ee4769bf4eae89b4e77858cc67b8060b /Makefile | |
| parent | 515b7f3b4f048b29325e3e38f0f4a2ef898e8daa (diff) | |
| download | dwm-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-- | Makefile | 32 |
1 files changed, 21 insertions, 11 deletions
| @@ -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 | ||
| 4 | include config.mk | 4 | include src/config/config.mk |
| 5 | 5 | ||
| 6 | SRC = drw.c dwm.c util.c | 6 | SRC = src/drw/drw.c src/core/dwm.c src/util/util.c |
| 7 | OBJ = ${SRC:.c=.o} | 7 | OBJ = $(SRC:.c=.o) |
| 8 | |||
| 9 | CFLAGS += -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 | |||
| 17 | LDFLAGS += -L/usr/X11R6/lib -lX11 -lXinerama -lfontconfig -lXft -lX11-xcb -lxcb -lxcb-res | ||
| 8 | 18 | ||
| 9 | all: dwm | 19 | all: 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 | ||
| 16 | config.h: | 26 | config.h: |
| 17 | cp config.def.h $@ | 27 | cp src/config/config.def.h $@ |
| 18 | 28 | ||
| 19 | dwm: ${OBJ} | 29 | dwm: ${OBJ} |
| 20 | ${CC} -o $@ ${OBJ} ${LDFLAGS} | 30 | ${CC} -o $@ ${OBJ} ${LDFLAGS} |
| @@ -24,8 +34,8 @@ clean: | |||
| 24 | 34 | ||
| 25 | dist: clean | 35 | dist: 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 | ||
| 41 | uninstall: | 51 | uninstall: |
| 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 |
