make: -fPIC static libs that link to shared libs

This commit is contained in:
Jari Vetoniemi 2021-06-09 09:12:57 +09:00
parent ca6b903415
commit 752ab983d1

View File

@ -56,6 +56,7 @@ $(renderers): %: VERSION .git/index | $(libs)
$(bins): %: | $(libs) $(bins): %: | $(libs)
$(LINK.c) $(filter %.c %.a,$^) $(LDLIBS) -L. -lbemenu -o $@ $(LINK.c) $(filter %.c %.a,$^) $(LDLIBS) -L. -lbemenu -o $@
cdl.a: private override LDFLAGS += -fPIC
cdl.a: lib/3rdparty/cdl.c lib/3rdparty/cdl.h cdl.a: lib/3rdparty/cdl.c lib/3rdparty/cdl.h
libbemenu.so: private override LDLIBS += -ldl libbemenu.so: private override LDLIBS += -ldl
@ -84,10 +85,13 @@ lib/renderers/wayland/xdg-output-unstable-v1.h: lib/renderers/wayland/xdg-output
lib/renderers/wayland/xdg-output-unstable-v1.c: lib/renderers/wayland/xdg-output-unstable-v1.xml lib/renderers/wayland/xdg-output-unstable-v1.c: lib/renderers/wayland/xdg-output-unstable-v1.xml
wayland-scanner private-code < $^ > $@ wayland-scanner private-code < $^ > $@
xdg-shell.a: private override LDFLAGS += -fPIC
xdg-shell.a: private override CPPFLAGS += $(shell pkg-config --cflags-only-I wayland-client) xdg-shell.a: private override CPPFLAGS += $(shell pkg-config --cflags-only-I wayland-client)
xdg-shell.a: lib/renderers/wayland/xdg-shell.c xdg-shell.a: lib/renderers/wayland/xdg-shell.c
wlr-layer-shell.a: private override LDFLAGS += -fPIC
wlr-layer-shell.a: private override CPPFLAGS += $(shell pkg-config --cflags-only-I wayland-client) wlr-layer-shell.a: private override CPPFLAGS += $(shell pkg-config --cflags-only-I wayland-client)
wlr-layer-shell.a: lib/renderers/wayland/wlr-layer-shell-unstable-v1.c lib/renderers/wayland/wlr-layer-shell-unstable-v1.h wlr-layer-shell.a: lib/renderers/wayland/wlr-layer-shell-unstable-v1.c lib/renderers/wayland/wlr-layer-shell-unstable-v1.h
xdg-output.a: private override LDFLAGS += -fPIC
xdg-output.a: private override CPPFLAGS += $(shell pkg-config --cflags-only-I wayland-client) xdg-output.a: private override CPPFLAGS += $(shell pkg-config --cflags-only-I wayland-client)
xdg-output.a: lib/renderers/wayland/xdg-output-unstable-v1.c lib/renderers/wayland/xdg-output-unstable-v1.h xdg-output.a: lib/renderers/wayland/xdg-output-unstable-v1.c lib/renderers/wayland/xdg-output-unstable-v1.h
bemenu-renderer-wayland.so: private override LDLIBS += $(shell pkg-config --libs wayland-client cairo pango pangocairo xkbcommon) bemenu-renderer-wayland.so: private override LDLIBS += $(shell pkg-config --libs wayland-client cairo pango pangocairo xkbcommon)