39 lines
923 B
Makefile
39 lines
923 B
Makefile
# dwm - dynamic window manager
|
|
# See LICENSE file for copyright and license details.
|
|
|
|
include config.mk
|
|
|
|
SRC = drw.c dwm.c util.c
|
|
OBJ = $(patsubst %.c,build/obj/%.c.o,$(SRC))
|
|
|
|
all: build/dwm compile_commands.json
|
|
|
|
build/obj/%.c.o: %.c
|
|
mkdir -p $(dir $@)
|
|
${CC} -c ${CFLAGS} -o $@ $<
|
|
|
|
build/dwm: ${OBJ}
|
|
${CC} -o $@ ${OBJ} ${LDFLAGS}
|
|
|
|
clean:
|
|
rm -f dwm ${OBJ} dwm-${VERSION}.tar.gz
|
|
|
|
install: all
|
|
mkdir -p ${DESTDIR}${PREFIX}/bin
|
|
cp -f build/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
|
|
cp dwm.desktop /usr/share/xsessions/dwm.desktop
|
|
|
|
uninstall:
|
|
rm -f ${DESTDIR}${PREFIX}/bin/dwm \
|
|
${DESTDIR}${MANPREFIX}/man1/dwm.1 \
|
|
/usr/share/xsessions/dwm.desktop
|
|
|
|
compile_commands.json:
|
|
compiledb -n make
|
|
|
|
.PHONY: all clean dist install uninstall
|