Makefile: use POSIX-1-2024 issue 8
This commit is contained in:
parent
bece480494
commit
90acb53069
1 changed files with 19 additions and 20 deletions
37
Makefile
37
Makefile
|
@ -1,42 +1,41 @@
|
||||||
# mew - dynamic menu
|
# mew - dynamic menu for wayland
|
||||||
# See LICENSE file for copyright and license details.
|
# See LICENSE file for copyright and license details.
|
||||||
.POSIX:
|
.POSIX:
|
||||||
|
|
||||||
# mew version
|
|
||||||
VERSION = 1.0
|
VERSION = 1.0
|
||||||
|
|
||||||
# pkg-config
|
|
||||||
PKG_CONFIG = pkg-config
|
PKG_CONFIG = pkg-config
|
||||||
|
|
||||||
# paths
|
|
||||||
PREFIX = /usr/local
|
PREFIX = /usr/local
|
||||||
MANPREFIX = $(PREFIX)/share/man
|
MANPREFIX = $(PREFIX)/share/man
|
||||||
|
|
||||||
# includes and libs
|
|
||||||
PKGS = fcft pixman-1 wayland-client xkbcommon
|
PKGS = fcft pixman-1 wayland-client xkbcommon
|
||||||
INCS = `$(PKG_CONFIG) --cflags $(PKGS)`
|
INCS != $(PKG_CONFIG) --cflags $(PKGS)
|
||||||
LIBS = `$(PKG_CONFIG) --libs $(PKGS)`
|
LIBS != $(PKG_CONFIG) --libs $(PKGS)
|
||||||
|
|
||||||
# flags
|
MWCPPFLAGS = -D_POSIX_C_SOURCE=200809L -D_GNU_SOURCE -DVERSION=\"$(VERSION)\"
|
||||||
EMCPPFLAGS = -D_POSIX_C_SOURCE=200809L -D_GNU_SOURCE -DVERSION=\"$(VERSION)\"
|
MWCFLAGS = -pedantic -Wall $(INCS) $(MWCPPFLAGS) $(CFLAGS)
|
||||||
EMCFLAGS = -pedantic -Wall $(INCS) $(EMCPPFLAGS) $(CFLAGS)
|
|
||||||
LDLIBS = $(LIBS)
|
LDLIBS = $(LIBS)
|
||||||
|
|
||||||
|
PROTO = wlr-layer-shell-unstable-v1-protocol.h xdg-activation-v1-protocol.h xdg-shell-protocol.h
|
||||||
|
SRC = mew.c $(PROTO:.h=.c)
|
||||||
|
OBJ = $(SRC:.c=.o)
|
||||||
|
|
||||||
all: mew
|
all: mew
|
||||||
|
|
||||||
.c.o:
|
.c.o:
|
||||||
$(CC) -c $(EMCFLAGS) $<
|
$(CC) -o $@ $(MWCFLAGS) -c $<
|
||||||
|
|
||||||
config.h:
|
config.h:
|
||||||
cp config.def.h $@
|
cp config.def.h $@
|
||||||
|
|
||||||
mew.o: config.h wlr-layer-shell-unstable-v1-protocol.h xdg-activation-v1-protocol.h xdg-shell-protocol.h
|
$(OBJ): config.h $(PROTO)
|
||||||
|
|
||||||
mew: wlr-layer-shell-unstable-v1-protocol.o xdg-activation-v1-protocol.o xdg-shell-protocol.o mew.o
|
mew: $(OBJ)
|
||||||
$(CC) $(LDFLAGS) -o $@ wlr-layer-shell-unstable-v1-protocol.o xdg-activation-v1-protocol.o xdg-shell-protocol.o mew.o $(LDLIBS)
|
$(CC) $(LDFLAGS) -o $@ $^ $(LDLIBS)
|
||||||
|
|
||||||
WAYLAND_PROTOCOLS = `$(PKG_CONFIG) --variable=pkgdatadir wayland-protocols`
|
WAYLAND_PROTOCOLS != $(PKG_CONFIG) --variable=pkgdatadir wayland-protocols
|
||||||
WAYLAND_SCANNER = `$(PKG_CONFIG) --variable=wayland_scanner wayland-scanner`
|
WAYLAND_SCANNER != $(PKG_CONFIG) --variable=wayland_scanner wayland-scanner
|
||||||
|
|
||||||
xdg-activation-v1-protocol.h:
|
xdg-activation-v1-protocol.h:
|
||||||
$(WAYLAND_SCANNER) client-header $(WAYLAND_PROTOCOLS)/staging/xdg-activation/xdg-activation-v1.xml $@
|
$(WAYLAND_SCANNER) client-header $(WAYLAND_PROTOCOLS)/staging/xdg-activation/xdg-activation-v1.xml $@
|
||||||
|
@ -55,7 +54,7 @@ wlr-layer-shell-unstable-v1-protocol.c:
|
||||||
wlr-layer-shell-unstable-v1-protocol.o: xdg-shell-protocol.o
|
wlr-layer-shell-unstable-v1-protocol.o: xdg-shell-protocol.o
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f mew *.o *-protocol.*
|
rm -f mew $(OBJ) $(PROTO:.h=.c) $(PROTO)
|
||||||
|
|
||||||
install: all
|
install: all
|
||||||
mkdir -p $(DESTDIR)$(PREFIX)/bin
|
mkdir -p $(DESTDIR)$(PREFIX)/bin
|
||||||
|
@ -67,8 +66,8 @@ install: all
|
||||||
chmod 644 $(DESTDIR)$(MANPREFIX)/man1/mew.1
|
chmod 644 $(DESTDIR)$(MANPREFIX)/man1/mew.1
|
||||||
|
|
||||||
uninstall:
|
uninstall:
|
||||||
rm -f $(DESTDIR)$(PREFIX)/bin/mew\
|
rm -f $(DESTDIR)$(PREFIX)/bin/mew \
|
||||||
$(DESTDIR)$(PREFIX)/bin/mew-run\
|
$(DESTDIR)$(PREFIX)/bin/mew-run \
|
||||||
$(DESTDIR)$(MANPREFIX)/man1/mew.1
|
$(DESTDIR)$(MANPREFIX)/man1/mew.1
|
||||||
|
|
||||||
.PHONY: all clean install uninstall
|
.PHONY: all clean install uninstall
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue