dwm-custom/Makefile

59 lines
1.5 KiB
Makefile
Raw Normal View History

2024-05-19 00:20:43 +02:00
# dwm - dynamic window manager
# See LICENSE file for copyright and license details.
2024-05-22 15:48:50 +02:00
.PHONY: all submodule clean dist install uninstall
2024-05-19 00:20:43 +02:00
include config.mk
SRC = drw.c dwm.c util.c
OBJ = ${SRC:.c=.o}
all: dwm
.c.o:
${CC} -c ${CFLAGS} $<
config.mk:
cp config/config.mk config.mk
2024-05-19 00:21:28 +02:00
2024-05-19 00:20:43 +02:00
config.h:
cp config/config.h config.h
2024-05-19 00:21:28 +02:00
${SRC}: buildroot
2024-05-19 00:20:43 +02:00
${OBJ}: config.h config.mk
2024-05-19 00:21:28 +02:00
dwm: ${OBJ}
2024-05-19 00:20:43 +02:00
${CC} -o $@ ${OBJ} ${LDFLAGS}
2024-05-22 16:36:04 +02:00
submodule:
git submodule update --init
2024-05-19 00:20:43 +02:00
clean:
find . -maxdepth 1 -type f | grep -Pv "^\./\.|Makefile$$" | xargs -r rm
rm -r tmp patch 2>/dev/null || true
git -C dwm-flexipatch reset --hard HEAD
2024-05-21 01:05:09 +02:00
git -C dwm-flexipatch clean -ffdx
2024-05-19 00:20:43 +02:00
2024-05-22 16:36:04 +02:00
buildroot: submodule
2024-05-19 00:20:43 +02:00
cp config/patches.h dwm-flexipatch/patches.h
flexipatch-finalizer/flexipatch-finalizer.sh -r -d dwm-flexipatch -o tmp
rm -r tmp/Makefile tmp/config.mk patch 2>/dev/null || true
mv tmp/* ./
for patch in config/patches/*.diff; do patch <"$$patch"; done
install: all
mkdir -p ${DESTDIR}${PREFIX}/bin
cp -f dwm ${DESTDIR}${PREFIX}/bin
chmod 755 ${DESTDIR}${PREFIX}/bin/dwm
mkdir -p ${DESTDIR}${MANPREFIX}/man1
sed "s/VERSION/${VERSION}/g" < dwm.1 > ${DESTDIR}${MANPREFIX}/man1/dwm.1
chmod 644 ${DESTDIR}${MANPREFIX}/man1/dwm.1
mkdir -p ${DESTDIR}${PREFIX}/share/xsessions
test -f ${DESTDIR}${PREFIX}/share/xsessions/dwm.desktop || cp -n dwm.desktop ${DESTDIR}${PREFIX}/share/xsessions
chmod 644 ${DESTDIR}${PREFIX}/share/xsessions/dwm.desktop
uninstall:
rm -f ${DESTDIR}${PREFIX}/bin/dwm\
${DESTDIR}${MANPREFIX}/man1/dwm.1\
${DESTDIR}${PREFIX}/share/xsessions/dwm.desktop