2006-07-13 07:32:22 +00:00
|
|
|
# dwm - dynamic window manager
|
2008-04-20 18:09:30 +00:00
|
|
|
# See LICENSE file for copyright and license details.
|
2006-07-10 14:38:18 +00:00
|
|
|
|
|
|
|
include config.mk
|
|
|
|
|
2023-05-11 11:04:24 +00:00
|
|
|
SRC = src/drw.c src/archy_dwm.c src/util.c
|
2023-05-11 00:22:27 +00:00
|
|
|
OBJ_DIR = build
|
|
|
|
OBJ = ${SRC:%.c=$(OBJ_DIR)/%.o}
|
2023-05-11 11:04:24 +00:00
|
|
|
BUILD_DIR = ${OBJ_DIR}/archy-dwm
|
2006-07-12 23:30:55 +00:00
|
|
|
|
2023-05-11 00:22:27 +00:00
|
|
|
all: options ${BUILD_DIR}
|
2006-07-10 14:38:18 +00:00
|
|
|
|
2006-07-17 16:49:13 +00:00
|
|
|
options:
|
2023-05-11 11:04:24 +00:00
|
|
|
@echo archy-dwm build options:
|
2006-07-10 14:49:43 +00:00
|
|
|
@echo "CFLAGS = ${CFLAGS}"
|
|
|
|
@echo "LDFLAGS = ${LDFLAGS}"
|
|
|
|
@echo "CC = ${CC}"
|
|
|
|
|
2023-05-11 00:22:27 +00:00
|
|
|
${OBJ_DIR}/%.o: %.c
|
|
|
|
mkdir -p $(@D)
|
|
|
|
${CC} -c ${CFLAGS} $< -o $@
|
2006-07-10 14:38:18 +00:00
|
|
|
|
2023-05-11 00:22:27 +00:00
|
|
|
${OBJ}: src/config.h config.mk
|
2006-08-02 15:49:21 +00:00
|
|
|
|
2007-09-23 09:24:12 +00:00
|
|
|
config.h:
|
2018-06-02 15:04:44 +00:00
|
|
|
cp config.def.h $@
|
2007-09-23 09:24:12 +00:00
|
|
|
|
2023-05-11 00:22:27 +00:00
|
|
|
${BUILD_DIR}: ${OBJ}
|
2018-06-02 15:04:44 +00:00
|
|
|
${CC} -o $@ ${OBJ} ${LDFLAGS}
|
2006-07-10 14:38:18 +00:00
|
|
|
|
|
|
|
clean:
|
2023-05-11 00:22:27 +00:00
|
|
|
rm -rf ${OBJ_DIR}
|
2006-07-10 14:49:43 +00:00
|
|
|
|
2023-05-11 18:46:45 +00:00
|
|
|
dist: ${BUILD_DIR} archy-dwm.desktop
|
2023-05-11 11:04:24 +00:00
|
|
|
mkdir -p archy-dwm_${VERSION}
|
2023-05-11 18:46:45 +00:00
|
|
|
cp -R LICENSE README.md ${BUILD_DIR} ${OBJ_DIR}/archy-dwm.desktop archy-dwm.1 dwm.png archy-dwm_${VERSION}
|
2023-05-11 11:04:24 +00:00
|
|
|
tar -cf archy-dwm_${VERSION}.tar archy-dwm_${VERSION}
|
|
|
|
gzip archy-dwm_${VERSION}.tar
|
|
|
|
rm -rf archy-dwm_${VERSION}
|
2023-05-11 18:46:45 +00:00
|
|
|
mkdir -p dist
|
|
|
|
mv archy-dwm_${VERSION}.tar.gz dist
|
2023-05-11 18:16:12 +00:00
|
|
|
echo "The tarball is ready."
|
2023-05-11 18:46:45 +00:00
|
|
|
printf "Tarball size: %s\n" $$(du -h dist/archy-dwm_${VERSION}.tar.gz | cut -f1)
|
|
|
|
printf "Tarball hash: %s\n" $$(sha256sum dist/archy-dwm_${VERSION}.tar.gz)
|
2006-07-10 14:49:43 +00:00
|
|
|
|
|
|
|
install: all
|
2018-06-02 15:04:44 +00:00
|
|
|
mkdir -p ${DESTDIR}${PREFIX}/bin
|
2023-05-11 00:22:27 +00:00
|
|
|
cp -f ${BUILD_DIR} ${DESTDIR}${PREFIX}/bin
|
2023-05-11 11:04:24 +00:00
|
|
|
chmod 755 ${DESTDIR}${PREFIX}/bin/archy-dwm
|
2018-06-02 15:04:44 +00:00
|
|
|
mkdir -p ${DESTDIR}${MANPREFIX}/man1
|
2023-05-11 11:04:24 +00:00
|
|
|
sed "s/VERSION/${VERSION}/g" < archy-dwm.1 > ${DESTDIR}${MANPREFIX}/man1/archy-dwm.1
|
|
|
|
chmod 644 ${DESTDIR}${MANPREFIX}/man1/archy-dwm.1
|
2006-07-10 14:49:43 +00:00
|
|
|
|
2023-05-11 18:16:12 +00:00
|
|
|
archy-dwm.desktop:
|
|
|
|
mkdir -p "$(OBJ_DIR)"
|
|
|
|
echo "[Desktop Entry]" > "$(OBJ_DIR)/archy-dwm.desktop"
|
|
|
|
echo "Type=XSession" >> "$(OBJ_DIR)/archy-dwm.desktop"
|
|
|
|
echo "Exec=$(DESTDIR)$(PREFIX)/bin/archy-dwm" >> "$(OBJ_DIR)/archy-dwm.desktop"
|
|
|
|
echo "DesktopNames=archy-dwm" >> "$(OBJ_DIR)/archy-dwm.desktop"
|
|
|
|
echo "Name=archy-dwm" >> "$(OBJ_DIR)/archy-dwm.desktop"
|
|
|
|
echo "Comment=\"A dynamic window manager for X\"" >> "$(OBJ_DIR)/archy-dwm.desktop"
|
|
|
|
|
|
|
|
desktop: archy-dwm.desktop
|
|
|
|
mkdir -p ${DESTDIR}${PREFIX}/share/xsessions
|
|
|
|
cp "$(OBJ_DIR)/archy-dwm.desktop" ${DESTDIR}${PREFIX}/share/xsessions/archy-dwm.desktop
|
2022-08-02 09:59:09 +00:00
|
|
|
|
2006-07-10 14:49:43 +00:00
|
|
|
uninstall:
|
2023-05-11 11:04:24 +00:00
|
|
|
rm -f ${DESTDIR}${PREFIX}/bin/archy-dwm \
|
2023-05-11 18:16:12 +00:00
|
|
|
${DESTDIR}${MANPREFIX}/man1/archy-dwm.1 \
|
|
|
|
${DESTDIR}${PREFIX}/share/xsessions/archy-dwm.desktop
|
2006-08-03 08:58:29 +00:00
|
|
|
|
|
|
|
.PHONY: all options clean dist install uninstall
|