forked from jzbor/moonwm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
74 lines (57 loc) · 2.31 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# moonwm - my own outstandingly named window manager
# See LICENSE file for copyright and license details.
include config.mk
VPATH = src
SRC = drw.c moonwm.c util.c
OBJ = ${SRC:.c=.o}
all: options moonwm moonctl
options:
@echo moonwm build options:
@echo "CFLAGS = ${CFLAGS}"
@echo "LDFLAGS = ${LDFLAGS}"
@echo "CC = ${CC}"
.c.o:
${CC} -c ${CFLAGS} $<
${OBJ}: config.h config.mk
config.h:
cp config.def.h $@
moonwm: ${OBJ}
${CC} -g -o $@ ${OBJ} ${LDFLAGS}
moonctl: moonctl.c
${CC} -g -o $@ src/moonctl.c ${LDFLAGS}
clean:
rm -f moonctl moonwm ${OBJ} moonwm-${VERSION}.tar.gz
dist: clean
mkdir -p moonwm-${VERSION}
cp -R LICENSE Makefile CHANGELOG.md README.md config.def.h config.mk\
moonwm.1 drw.h util.h ${SRC} moonwm.png transient.c moonwm-${VERSION}
tar -cf moonwm-${VERSION}.tar moonwm-${VERSION}
gzip moonwm-${VERSION}.tar
rm -rf moonwm-${VERSION}
install: all
install -Dm755 moonwm moonctl -t ${DESTDIR}${PREFIX}/bin
mkdir -p ${DESTDIR}${MANPREFIX}/man1
sed "s/VERSION/${VERSION}/g" < moonwm.1 > ${DESTDIR}${MANPREFIX}/man1/moonwm.1
chmod 644 ${DESTDIR}${MANPREFIX}/man1/moonwm.1
install -Dm644 CHANGELOG.md README.md -t ${DESTDIR}${DOCPREFIX}/moonwm/
mkdir -p ${DESTDIR}${PREFIX}/share/xsessions/
sed "s/PREFIX/$(shell echo "${PREFIX}" | sed 's/\//\\\//g')/g" < moonwm.desktop > ${DESTDIR}${PREFIX}/share/xsessions/moonwm.desktop
install -Dm644 moonwm-wallpaper.desktop -t ${DESTDIR}${PREFIX}/share/applications/
uninstall:
rm -f ${DESTDIR}${PREFIX}/bin/moonwm \
${DESTDIR}${MANPREFIX}/man1/moonwm.1 \
${DESTDIR}${PREFIX}/bin/moonctl
rm -f ${DESTDIR}${PREFIX}/share/xsessions/moonwm.desktop \
${DESTDIR}${PREFIX}/share/applications/moonwm-wallpaper.desktop
install-scripts:
install -Dm755 scripts/moonwm-helper scripts/moonwm-menu scripts/moonwm-status scripts/moonwm-util scripts/moonwm-xdg-xmenu -t ${DESTDIR}${PREFIX}/bin
uninstall-scripts:
rm -f ${DESTDIR}${PREFIX}/bin/moonwm-helper
rm -f ${DESTDIR}${PREFIX}/bin/moonwm-menu
rm -f ${DESTDIR}${PREFIX}/bin/moonwm-status
rm -f ${DESTDIR}${PREFIX}/bin/moonwm-util
rm -f ${DESTDIR}${PREFIX}/bin/moonwm-xdg-xmenu
pull-xdg-xmenu:
wget https://raw.githubusercontent.com/jzbor/mashup/master/utils/xdg-xmenu
mv xdg-xmenu scripts/moonwm-xdg-xmenu
.PHONY: all options clean dist install install-scripts uninstall uninstall-scripts pull-xdg-xmenu