aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathan Reiner <nathan@nathanreiner.xyz>2023-04-11 09:22:25 +0200
committerNathan Reiner <nathan@nathanreiner.xyz>2023-04-11 09:22:25 +0200
commitc2d8cbf89ac97c6fba6e9cd3c5d70e0bca894e7c (patch)
tree5283671bf70ff84c5c1f933047bee6e7e80cc908
parent76f94403f0ec5b60bbd5c14e9761e0fec3e9b067 (diff)
complete Makefile
-rw-r--r--Makefile23
-rw-r--r--config.mk8
2 files changed, 21 insertions, 10 deletions
diff --git a/Makefile b/Makefile
index ec65cfe..e0e15b9 100644
--- a/Makefile
+++ b/Makefile
@@ -1,9 +1,8 @@
-VERSION = 0.0.0
+include config.mk
+
PROTOCOLS = xdg-shell-client-protocol.c
SRC = ${PROTOCOLS} swt.c drw.c util.c wayland.c term.c
OBJ = ${SRC:.c=.o}
-CFLAGS = -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/harfbuzz -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/sysprof-4 -pthread -DVERSION=\"${VERSION}\" -D_XOPEN_SOURCE=600
-LIBS = -lfreetype -lwayland-client -lrt -lxkbcommon -lm -lgrapheme
all: swt
@@ -11,24 +10,28 @@ config.h:
cp config.def.h config.h
xdg-shell-client-protocol.h:
- wayland-scanner client-header < /usr/share/wayland-protocols/stable/xdg-shell/xdg-shell.xml > xdg-shell-client-protocol.h
+ wayland-scanner client-header < ${XDG_SHELL_CLIENT_PROTOCOL} > xdg-shell-client-protocol.h
xdg-shell-client-protocol.c: xdg-shell-client-protocol.h
- wayland-scanner private-code < /usr/share/wayland-protocols/stable/xdg-shell/xdg-shell.xml > xdg-shell-client-protocol.c
+ wayland-scanner private-code < ${XDG_SHELL_CLIENT_PROTOCOL} > xdg-shell-client-protocol.c
.c.o:
- gcc -c $< ${CFLAGS}
+ ${CC} -c $< ${CFLAGS}
${OBJ}: ${PROTOCOLS} config.h
swt: ${OBJ} ${SRC}
- gcc ${OBJ} -o swt ${LIBS}
+ ${CC} ${OBJ} -o swt ${LIBS}
install: swt
- install -D ./swt /usr/local/bin/swt
+ mkdir -p ${DESTDIR}${PREFIX}/bin
+ cp -f swt ${DESTDIR}${PREFIX}/bin
+ chmod 755 ${DESTDIR}${PREFIX}/bin/swt
+ tic -sx swt.info
+ @echo Please see the README file regarding the terminfo entry of st.
-run: swt
- ./swt
+uinstall:
+ rm -f ${DESTDIR}${PREFIX}/bin/st
clean:
rm *.o swt ${PROTOCOLS} ${PROTOCOLS:.c=.h}
diff --git a/config.mk b/config.mk
new file mode 100644
index 0000000..f92717c
--- /dev/null
+++ b/config.mk
@@ -0,0 +1,8 @@
+VERSION = 0.0.0
+
+PREFIX = /usr/local
+
+XDG_SHELL_CLIENT_PROTOCOL = /usr/share/wayland-protocols/stable/xdg-shell/xdg-shell.xml
+CFLAGS = -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/harfbuzz -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/sysprof-4 -pthread -DVERSION=\"${VERSION}\" -D_XOPEN_SOURCE=600
+LIBS = -lfreetype -lwayland-client -lrt -lxkbcommon -lm -lgrapheme
+CC=cc