tinywl: Edit Makefile for bmake compatibility

- Replace 'shell' calls with '!=' assignments
- Add default target 'all'
- Don't use var '$<' for non-sources
This commit is contained in:
BiRD 2024-07-10 11:54:27 -04:00
parent 015bb8512e
commit f16a3c1180

View File

@ -1,10 +1,13 @@
PKG_CONFIG?=pkg-config PKG_CONFIG?=pkg-config
WAYLAND_PROTOCOLS=$(shell $(PKG_CONFIG) --variable=pkgdatadir wayland-protocols) WAYLAND_PROTOCOLS!=$(PKG_CONFIG) --variable=pkgdatadir wayland-protocols
WAYLAND_SCANNER=$(shell $(PKG_CONFIG) --variable=wayland_scanner wayland-scanner) WAYLAND_SCANNER!=$(PKG_CONFIG) --variable=wayland_scanner wayland-scanner
PKGS="wlroots-0.19" wayland-server xkbcommon PKGS="wlroots-0.19" wayland-server xkbcommon
CFLAGS+=$(shell $(PKG_CONFIG) --cflags $(PKGS)) CFLAGS_PKG_CONFIG!=$(PKG_CONFIG) --cflags $(PKGS)
LIBS=$(shell $(PKG_CONFIG) --libs $(PKGS)) CFLAGS+=$(CFLAGS_PKG_CONFIG)
LIBS!=$(PKG_CONFIG) --libs $(PKGS)
all: tinywl
# wayland-scanner is a tool which generates C headers and rigging for Wayland # wayland-scanner is a tool which generates C headers and rigging for Wayland
# protocols, which are specified in XML. wlroots requires you to rig these up # protocols, which are specified in XML. wlroots requires you to rig these up
@ -14,12 +17,11 @@ xdg-shell-protocol.h:
$(WAYLAND_PROTOCOLS)/stable/xdg-shell/xdg-shell.xml $@ $(WAYLAND_PROTOCOLS)/stable/xdg-shell/xdg-shell.xml $@
tinywl.o: tinywl.c xdg-shell-protocol.h tinywl.o: tinywl.c xdg-shell-protocol.h
$(CC) -g -Werror $(CFLAGS) -I. -DWLR_USE_UNSTABLE -o $@ -c $< $(CC) -c $< -g -Werror $(CFLAGS) -I. -DWLR_USE_UNSTABLE -o $@
tinywl: tinywl.o tinywl: tinywl.o
$(CC) $< -g -Werror $(CFLAGS) $(LDFLAGS) $(LIBS) -o $@ $(CC) $^ $> -g -Werror $(CFLAGS) $(LDFLAGS) $(LIBS) -o $@
clean: clean:
rm -f tinywl tinywl.o xdg-shell-protocol.h rm -f tinywl tinywl.o xdg-shell-protocol.h
.DEFAULT_GOAL=tinywl .PHONY: all clean
.PHONY: clean