dwm-custom/Makefile

56 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.
.PHONY: all clean install uninstall
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}
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
git -C dwm-flexipatch clean -fdx
buildroot:
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