hikari/Makefile

271 lines
6.6 KiB
Makefile
Raw Normal View History

.ifmake clean
WITH_ALL = YES
.endif
.ifdef WITH_ALL
WITH_XWAYLAND = YES
WITH_SCREENCOPY = YES
WITH_GAMMACONTROL = YES
WITH_LAYERSHELL = YES
WITH_VIRTUAL_INPUT = YES
.endif
2020-03-10 08:44:57 -05:00
OS != uname
VERSION ?= "CURRENT"
PREFIX ?= /usr/local
PKG_CONFIG ?= pkg-config
ETC_PREFIX ?= ${PREFIX}
2020-02-05 04:02:33 -06:00
OBJS = \
action.o \
action_config.o \
binding_config.o \
binding_group.o \
2020-02-05 04:02:33 -06:00
border.o \
command.o \
completion.o \
configuration.o \
cursor.o \
decoration.o \
dnd_mode.o \
2020-02-05 04:02:33 -06:00
exec.o \
font.o \
geometry.o \
group.o \
group_assign_mode.o \
indicator.o \
indicator_bar.o \
indicator_frame.o \
input_buffer.o \
input_grab_mode.o \
2020-02-05 04:02:33 -06:00
keyboard.o \
keyboard_config.o \
layer_shell.o \
2020-02-05 04:02:33 -06:00
layout.o \
layout_config.o \
layout_select_mode.o \
lock_indicator.o \
lock_mode.o \
2020-02-05 04:02:33 -06:00
main.o \
mark.o \
mark_assign_mode.o \
mark_select_mode.o \
maximized_state.o \
memory.o \
move_mode.o \
normal_mode.o \
output.o \
output_config.o \
pointer.o \
2020-02-05 04:02:33 -06:00
pointer_config.o \
position_config.o \
renderer.o \
2020-02-05 04:02:33 -06:00
resize_mode.o \
server.o \
sheet.o \
sheet_assign_mode.o \
2020-02-05 04:02:33 -06:00
split.o \
switch.o \
switch_config.o \
2020-02-05 04:02:33 -06:00
tile.o \
view.o \
view_config.o \
2020-02-05 04:02:33 -06:00
workspace.o \
xdg_view.o
.ifdef WITH_XWAYLAND
OBJS += \
2020-02-05 04:02:33 -06:00
xwayland_unmanaged_view.o \
xwayland_view.o
.endif
2020-02-05 04:02:33 -06:00
WAYLAND_PROTOCOLS != ${PKG_CONFIG} --variable pkgdatadir wayland-protocols
2020-02-05 04:02:33 -06:00
.PHONY: distclean clean clean-doc doc dist install uninstall
2020-02-05 04:02:33 -06:00
.PATH: src
Makefile changes to support more general builds Pull ${CFLAGS_EXTRA} and ${LDFLAGS_EXTRA} from the environment, which allows the user to specify additional CFLAGS and LDFLAGS that will be added to the respective CFLAGS and LDFLAGS variables built up by the Makefile. (Setting CFLAGS or LDFLAGS directly on the command line, at least with NetBSD make, would cause make to ignore all of the appends in the Makefile.) Add ${CFLAGS_EXTRA} and ${LDFLAGS_EXTRA} to the hikari-unlocker build command, so those flags apply when building that target (this is important in Void cross-compilation, because PAM libs and headers will not generally be in /usr/lib or /usr/include and require specification). Reorder the command-line arguments when building the hikari and hikari-unlocker targets. Some compilers, like GCC, do not properly find symbols from libraries unless the libraries are listed after the source files that reference them. Libraries should always be listed last. Add a ${DESTDIR} prefix to all install destinations, empty by default, to allow installation into a chroot environment. Drop the INSTALL_GROUP and associated -g flag to the install commands. Setting a group explicitly is probably not useful, and can either cause breakage or require manual specification for reasonable behavior. (In Void packaging environments, for example, packages are built as an unprivileged user and the default behavior of grabbing the user's primary group is not correct.) Files are executable or readable by all users anyway and writable only by the owne
2020-05-06 09:38:26 -05:00
# Allow specification of /extra/ CFLAGS and LDFLAGS
CFLAGS += ${CFLAGS_EXTRA}
LDFLAGS += ${LDFLAGS_EXTRA}
.ifdef DEBUG
2020-02-06 13:51:38 -06:00
CFLAGS += -g -O0 -fsanitize=address
2020-02-05 04:02:33 -06:00
.else
CFLAGS += -DNDEBUG
.endif
.ifdef WITH_POSIX_C_SOURCE
CFLAGS += -D_POSIX_C_SOURCE=200809L
.endif
.ifdef WITH_XWAYLAND
CFLAGS += -DHAVE_XWAYLAND=1
.endif
.ifdef WITH_GAMMACONTROL
CFLAGS += -DHAVE_GAMMACONTROL=1
.endif
.ifdef WITH_SCREENCOPY
CFLAGS += -DHAVE_SCREENCOPY=1
.endif
.ifdef WITH_LAYERSHELL
CFLAGS += -DHAVE_LAYERSHELL=1
.endif
.ifdef WITH_SUID
PERMS = 4555
.else
PERMS = 555
.endif
2020-07-21 13:58:49 -05:00
.ifdef WITH_VIRTUAL_INPUT
CFLAGS += -DHAVE_VIRTUAL_INPUT=1
.endif
CFLAGS += -Wall -I. -Iinclude -DHIKARI_ETC_PREFIX=${ETC_PREFIX}
2020-02-05 04:02:33 -06:00
WLROOTS_CFLAGS != ${PKG_CONFIG} --cflags wlroots
WLROOTS_LIBS != ${PKG_CONFIG} --libs wlroots
2020-02-05 04:02:33 -06:00
WLROOTS_CFLAGS += -DWLR_USE_UNSTABLE=1
PANGO_CFLAGS != ${PKG_CONFIG} --cflags pangocairo
PANGO_LIBS != ${PKG_CONFIG} --libs pangocairo
2020-02-05 04:02:33 -06:00
CAIRO_CFLAGS != ${PKG_CONFIG} --cflags cairo
CAIRO_LIBS != ${PKG_CONFIG} --libs cairo
2020-02-05 04:02:33 -06:00
PIXMAN_CFLAGS != ${PKG_CONFIG} --cflags pixman-1
PIXMAN_LIBS != ${PKG_CONFIG} --libs pixman-1
2020-02-05 04:02:33 -06:00
XKBCOMMON_CFLAGS != ${PKG_CONFIG} --cflags xkbcommon
XKBCOMMON_LIBS != ${PKG_CONFIG} --libs xkbcommon
2020-02-05 04:02:33 -06:00
WAYLAND_CFLAGS != ${PKG_CONFIG} --cflags wayland-server
WAYLAND_LIBS != ${PKG_CONFIG} --libs wayland-server
2020-02-05 04:02:33 -06:00
LIBINPUT_CFLAGS != ${PKG_CONFIG} --cflags libinput
LIBINPUT_LIBS != ${PKG_CONFIG} --libs libinput
2020-02-05 04:02:33 -06:00
UCL_CFLAGS != ${PKG_CONFIG} --cflags libucl
UCL_LIBS != ${PKG_CONFIG} --libs libucl
2020-02-05 04:02:33 -06:00
CFLAGS += \
${WLROOTS_CFLAGS} \
${PANGO_CFLAGS} \
${CAIRO_CFLAGS} \
${PIXMAN_CFLAGS} \
${XKBCOMMON_CFLAGS} \
${WAYLAND_CFLAGS} \
${LIBINPUT_CFLAGS} \
${UCL_CFLAGS}
LIBS = \
${WLROOTS_LIBS} \
${PANGO_LIBS} \
${CAIRO_LIBS} \
${PIXMAN_LIBS} \
${XKBCOMMON_LIBS} \
${WAYLAND_LIBS} \
${LIBINPUT_LIBS} \
${UCL_LIBS}
PROTOCOL_HEADERS = xdg-shell-protocol.h
.ifdef WITH_LAYERSHELL
PROTOCOL_HEADERS += wlr-layer-shell-unstable-v1-protocol.h
.endif
2020-02-05 04:02:33 -06:00
all: hikari hikari-unlocker
version.h:
echo "#define HIKARI_VERSION \"${VERSION}\"" >> version.h
hikari: version.h ${PROTOCOL_HEADERS} ${OBJS}
Makefile changes to support more general builds Pull ${CFLAGS_EXTRA} and ${LDFLAGS_EXTRA} from the environment, which allows the user to specify additional CFLAGS and LDFLAGS that will be added to the respective CFLAGS and LDFLAGS variables built up by the Makefile. (Setting CFLAGS or LDFLAGS directly on the command line, at least with NetBSD make, would cause make to ignore all of the appends in the Makefile.) Add ${CFLAGS_EXTRA} and ${LDFLAGS_EXTRA} to the hikari-unlocker build command, so those flags apply when building that target (this is important in Void cross-compilation, because PAM libs and headers will not generally be in /usr/lib or /usr/include and require specification). Reorder the command-line arguments when building the hikari and hikari-unlocker targets. Some compilers, like GCC, do not properly find symbols from libraries unless the libraries are listed after the source files that reference them. Libraries should always be listed last. Add a ${DESTDIR} prefix to all install destinations, empty by default, to allow installation into a chroot environment. Drop the INSTALL_GROUP and associated -g flag to the install commands. Setting a group explicitly is probably not useful, and can either cause breakage or require manual specification for reasonable behavior. (In Void packaging environments, for example, packages are built as an unprivileged user and the default behavior of grabbing the user's primary group is not correct.) Files are executable or readable by all users anyway and writable only by the owne
2020-05-06 09:38:26 -05:00
${CC} ${LDFLAGS} ${CFLAGS} ${INCLUDES} -o ${.TARGET} ${OBJS} ${LIBS}
2020-02-05 04:02:33 -06:00
xdg-shell-protocol.h:
wayland-scanner server-header ${WAYLAND_PROTOCOLS}/stable/xdg-shell/xdg-shell.xml ${.TARGET}
wlr-layer-shell-unstable-v1-protocol.h:
wayland-scanner server-header protocol/wlr-layer-shell-unstable-v1.xml ${.TARGET}
2020-02-05 04:02:33 -06:00
hikari-unlocker: hikari_unlocker.c
Makefile changes to support more general builds Pull ${CFLAGS_EXTRA} and ${LDFLAGS_EXTRA} from the environment, which allows the user to specify additional CFLAGS and LDFLAGS that will be added to the respective CFLAGS and LDFLAGS variables built up by the Makefile. (Setting CFLAGS or LDFLAGS directly on the command line, at least with NetBSD make, would cause make to ignore all of the appends in the Makefile.) Add ${CFLAGS_EXTRA} and ${LDFLAGS_EXTRA} to the hikari-unlocker build command, so those flags apply when building that target (this is important in Void cross-compilation, because PAM libs and headers will not generally be in /usr/lib or /usr/include and require specification). Reorder the command-line arguments when building the hikari and hikari-unlocker targets. Some compilers, like GCC, do not properly find symbols from libraries unless the libraries are listed after the source files that reference them. Libraries should always be listed last. Add a ${DESTDIR} prefix to all install destinations, empty by default, to allow installation into a chroot environment. Drop the INSTALL_GROUP and associated -g flag to the install commands. Setting a group explicitly is probably not useful, and can either cause breakage or require manual specification for reasonable behavior. (In Void packaging environments, for example, packages are built as an unprivileged user and the default behavior of grabbing the user's primary group is not correct.) Files are executable or readable by all users anyway and writable only by the owne
2020-05-06 09:38:26 -05:00
${CC} ${CFLAGS_EXTRA} ${LDFLAGS_EXTRA} -o hikari-unlocker hikari_unlocker.c -lpam
2020-02-05 04:02:33 -06:00
clean-doc:
@test -e _darcs && echo "cleaning manpage" ||:
@test -e _darcs && rm share/man/man1/hikari.1 2> /dev/null ||:
clean: clean-doc
@echo "cleaning headers"
@test -e _darcs && rm version.h 2> /dev/null ||:
@rm ${PROTOCOL_HEADERS} 2> /dev/null ||:
@echo "cleaning object files"
@rm ${OBJS} 2> /dev/null ||:
@echo "cleaning executables"
@rm hikari 2> /dev/null ||:
@rm hikari-unlocker 2> /dev/null ||:
2020-02-05 04:02:33 -06:00
share/man/man1/hikari.1:
2020-03-10 08:44:57 -05:00
pandoc -M title:"HIKARI(1) ${VERSION} | hikari - Wayland Compositor" -s \
--to man -o share/man/man1/hikari.1 share/man/man1/hikari.md
doc: share/man/man1/hikari.1
hikari-${VERSION}.tar.gz: version.h share/man/man1/hikari.1
@darcs revert
@tar -s "#^#hikari-${VERSION}/#" -czf hikari-${VERSION}.tar.gz \
version.h \
main.c \
hikari_unlocker.c \
include/hikari/*.h \
src/*.c \
protocol/*.xml \
Makefile \
LICENSE \
README.md \
CoC.md \
2020-05-14 10:39:09 -05:00
CHANGELOG.md \
share/man/man1/hikari.md \
share/man/man1/hikari.1 \
share/backgrounds/hikari/hikari_wallpaper.png \
share/wayland-sessions/hikari.desktop \
etc/hikari/hikari.conf \
etc/pam.d/hikari-unlocker.*
distclean: clean-doc
@test -e _darcs && echo "cleaning version.h" ||:
@test -e _darcs && rm version.h ||:
dist: distclean hikari-${VERSION}.tar.gz
install: hikari hikari-unlocker share/man/man1/hikari.1
Makefile changes to support more general builds Pull ${CFLAGS_EXTRA} and ${LDFLAGS_EXTRA} from the environment, which allows the user to specify additional CFLAGS and LDFLAGS that will be added to the respective CFLAGS and LDFLAGS variables built up by the Makefile. (Setting CFLAGS or LDFLAGS directly on the command line, at least with NetBSD make, would cause make to ignore all of the appends in the Makefile.) Add ${CFLAGS_EXTRA} and ${LDFLAGS_EXTRA} to the hikari-unlocker build command, so those flags apply when building that target (this is important in Void cross-compilation, because PAM libs and headers will not generally be in /usr/lib or /usr/include and require specification). Reorder the command-line arguments when building the hikari and hikari-unlocker targets. Some compilers, like GCC, do not properly find symbols from libraries unless the libraries are listed after the source files that reference them. Libraries should always be listed last. Add a ${DESTDIR} prefix to all install destinations, empty by default, to allow installation into a chroot environment. Drop the INSTALL_GROUP and associated -g flag to the install commands. Setting a group explicitly is probably not useful, and can either cause breakage or require manual specification for reasonable behavior. (In Void packaging environments, for example, packages are built as an unprivileged user and the default behavior of grabbing the user's primary group is not correct.) Files are executable or readable by all users anyway and writable only by the owne
2020-05-06 09:38:26 -05:00
mkdir -p ${DESTDIR}/${PREFIX}/bin
mkdir -p ${DESTDIR}/${PREFIX}/share/man/man1
mkdir -p ${DESTDIR}/${PREFIX}/share/backgrounds/hikari
mkdir -p ${DESTDIR}/${PREFIX}/share/wayland-sessions
Makefile changes to support more general builds Pull ${CFLAGS_EXTRA} and ${LDFLAGS_EXTRA} from the environment, which allows the user to specify additional CFLAGS and LDFLAGS that will be added to the respective CFLAGS and LDFLAGS variables built up by the Makefile. (Setting CFLAGS or LDFLAGS directly on the command line, at least with NetBSD make, would cause make to ignore all of the appends in the Makefile.) Add ${CFLAGS_EXTRA} and ${LDFLAGS_EXTRA} to the hikari-unlocker build command, so those flags apply when building that target (this is important in Void cross-compilation, because PAM libs and headers will not generally be in /usr/lib or /usr/include and require specification). Reorder the command-line arguments when building the hikari and hikari-unlocker targets. Some compilers, like GCC, do not properly find symbols from libraries unless the libraries are listed after the source files that reference them. Libraries should always be listed last. Add a ${DESTDIR} prefix to all install destinations, empty by default, to allow installation into a chroot environment. Drop the INSTALL_GROUP and associated -g flag to the install commands. Setting a group explicitly is probably not useful, and can either cause breakage or require manual specification for reasonable behavior. (In Void packaging environments, for example, packages are built as an unprivileged user and the default behavior of grabbing the user's primary group is not correct.) Files are executable or readable by all users anyway and writable only by the owne
2020-05-06 09:38:26 -05:00
mkdir -p ${DESTDIR}/${ETC_PREFIX}/etc/hikari
mkdir -p ${DESTDIR}/${ETC_PREFIX}/etc/pam.d
sed "s,PREFIX,${PREFIX}," etc/hikari/hikari.conf > ${DESTDIR}/${ETC_PREFIX}/etc/hikari/hikari.conf
chmod 644 ${DESTDIR}/${ETC_PREFIX}/etc/hikari/hikari.conf
install -m ${PERMS} hikari ${DESTDIR}/${PREFIX}/bin
install -m 4555 hikari-unlocker ${DESTDIR}/${PREFIX}/bin
Makefile changes to support more general builds Pull ${CFLAGS_EXTRA} and ${LDFLAGS_EXTRA} from the environment, which allows the user to specify additional CFLAGS and LDFLAGS that will be added to the respective CFLAGS and LDFLAGS variables built up by the Makefile. (Setting CFLAGS or LDFLAGS directly on the command line, at least with NetBSD make, would cause make to ignore all of the appends in the Makefile.) Add ${CFLAGS_EXTRA} and ${LDFLAGS_EXTRA} to the hikari-unlocker build command, so those flags apply when building that target (this is important in Void cross-compilation, because PAM libs and headers will not generally be in /usr/lib or /usr/include and require specification). Reorder the command-line arguments when building the hikari and hikari-unlocker targets. Some compilers, like GCC, do not properly find symbols from libraries unless the libraries are listed after the source files that reference them. Libraries should always be listed last. Add a ${DESTDIR} prefix to all install destinations, empty by default, to allow installation into a chroot environment. Drop the INSTALL_GROUP and associated -g flag to the install commands. Setting a group explicitly is probably not useful, and can either cause breakage or require manual specification for reasonable behavior. (In Void packaging environments, for example, packages are built as an unprivileged user and the default behavior of grabbing the user's primary group is not correct.) Files are executable or readable by all users anyway and writable only by the owne
2020-05-06 09:38:26 -05:00
install -m 644 share/man/man1/hikari.1 ${DESTDIR}/${PREFIX}/share/man/man1
install -m 644 share/backgrounds/hikari/hikari_wallpaper.png ${DESTDIR}/${PREFIX}/share/backgrounds/hikari/hikari_wallpaper.png
install -m 644 share/wayland-sessions/hikari.desktop ${DESTDIR}/${PREFIX}/share/wayland-sessions/hikari.desktop
Makefile changes to support more general builds Pull ${CFLAGS_EXTRA} and ${LDFLAGS_EXTRA} from the environment, which allows the user to specify additional CFLAGS and LDFLAGS that will be added to the respective CFLAGS and LDFLAGS variables built up by the Makefile. (Setting CFLAGS or LDFLAGS directly on the command line, at least with NetBSD make, would cause make to ignore all of the appends in the Makefile.) Add ${CFLAGS_EXTRA} and ${LDFLAGS_EXTRA} to the hikari-unlocker build command, so those flags apply when building that target (this is important in Void cross-compilation, because PAM libs and headers will not generally be in /usr/lib or /usr/include and require specification). Reorder the command-line arguments when building the hikari and hikari-unlocker targets. Some compilers, like GCC, do not properly find symbols from libraries unless the libraries are listed after the source files that reference them. Libraries should always be listed last. Add a ${DESTDIR} prefix to all install destinations, empty by default, to allow installation into a chroot environment. Drop the INSTALL_GROUP and associated -g flag to the install commands. Setting a group explicitly is probably not useful, and can either cause breakage or require manual specification for reasonable behavior. (In Void packaging environments, for example, packages are built as an unprivileged user and the default behavior of grabbing the user's primary group is not correct.) Files are executable or readable by all users anyway and writable only by the owne
2020-05-06 09:38:26 -05:00
install -m 644 etc/pam.d/hikari-unlocker.${OS} ${DESTDIR}/${ETC_PREFIX}/etc/pam.d/hikari-unlocker
uninstall:
Makefile changes to support more general builds Pull ${CFLAGS_EXTRA} and ${LDFLAGS_EXTRA} from the environment, which allows the user to specify additional CFLAGS and LDFLAGS that will be added to the respective CFLAGS and LDFLAGS variables built up by the Makefile. (Setting CFLAGS or LDFLAGS directly on the command line, at least with NetBSD make, would cause make to ignore all of the appends in the Makefile.) Add ${CFLAGS_EXTRA} and ${LDFLAGS_EXTRA} to the hikari-unlocker build command, so those flags apply when building that target (this is important in Void cross-compilation, because PAM libs and headers will not generally be in /usr/lib or /usr/include and require specification). Reorder the command-line arguments when building the hikari and hikari-unlocker targets. Some compilers, like GCC, do not properly find symbols from libraries unless the libraries are listed after the source files that reference them. Libraries should always be listed last. Add a ${DESTDIR} prefix to all install destinations, empty by default, to allow installation into a chroot environment. Drop the INSTALL_GROUP and associated -g flag to the install commands. Setting a group explicitly is probably not useful, and can either cause breakage or require manual specification for reasonable behavior. (In Void packaging environments, for example, packages are built as an unprivileged user and the default behavior of grabbing the user's primary group is not correct.) Files are executable or readable by all users anyway and writable only by the owne
2020-05-06 09:38:26 -05:00
-rm ${DESTDIR}/${PREFIX}/bin/hikari
-rm ${DESTDIR}/${PREFIX}/bin/hikari-unlocker
-rm ${DESTDIR}/${PREFIX}/share/man/man1/hikari.1
-rm ${DESTDIR}/${PREFIX}/share/backgrounds/hikari/hikari_wallpaper.png
2020-06-09 04:22:08 -05:00
-rm ${DESTDIR}/${PREFIX}/share/wayland-sessions/hikari.desktop
Makefile changes to support more general builds Pull ${CFLAGS_EXTRA} and ${LDFLAGS_EXTRA} from the environment, which allows the user to specify additional CFLAGS and LDFLAGS that will be added to the respective CFLAGS and LDFLAGS variables built up by the Makefile. (Setting CFLAGS or LDFLAGS directly on the command line, at least with NetBSD make, would cause make to ignore all of the appends in the Makefile.) Add ${CFLAGS_EXTRA} and ${LDFLAGS_EXTRA} to the hikari-unlocker build command, so those flags apply when building that target (this is important in Void cross-compilation, because PAM libs and headers will not generally be in /usr/lib or /usr/include and require specification). Reorder the command-line arguments when building the hikari and hikari-unlocker targets. Some compilers, like GCC, do not properly find symbols from libraries unless the libraries are listed after the source files that reference them. Libraries should always be listed last. Add a ${DESTDIR} prefix to all install destinations, empty by default, to allow installation into a chroot environment. Drop the INSTALL_GROUP and associated -g flag to the install commands. Setting a group explicitly is probably not useful, and can either cause breakage or require manual specification for reasonable behavior. (In Void packaging environments, for example, packages are built as an unprivileged user and the default behavior of grabbing the user's primary group is not correct.) Files are executable or readable by all users anyway and writable only by the owne
2020-05-06 09:38:26 -05:00
-rm ${DESTDIR}/${ETC_PREFIX}/etc/pam.d/hikari-unlocker
-rm ${DESTDIR}/${ETC_PREFIX}/etc/hikari/hikari.conf
-rmdir ${DESTDIR}/${ETC_PREFIX}/etc/hikari
-rmdir ${DESTDIR}/${PREFIX}/share/backgrounds/hikari