Use shell Makefile function to avoid repeatedly calling pkg-config
authorJames Le Cuirot <chewi@gentoo.org>
Mon, 2 Sep 2019 21:51:52 +0000 (22:51 +0100)
committerJames Le Cuirot <chewi@gentoo.org>
Mon, 2 Sep 2019 22:07:07 +0000 (23:07 +0100)
It was being called many times when using backticks.

Makefile
src/sdl/Makefile

index b7bb68036164e8887ab7e3ca874c5f20649cf57e..236330dea7daa73045da659961bec4aea6251f2d 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -207,7 +207,7 @@ endif
 SDL_DIR = $(SRCDIR)/sdl
 SDL_LIB = $(SDL_DIR)/frotz_sdl.a
 export SDL_PKGS = libpng libjpeg sdl2 SDL2_mixer freetype2 zlib
-SDL_LDFLAGS += `$(PKG_CONFIG) $(SDL_PKGS) --libs` -lm
+SDL_LDFLAGS += $(shell $(PKG_CONFIG) $(SDL_PKGS) --libs) -lm
 
 DOS_DIR = $(SRCDIR)/dos
 
index d8043ef3c72aba21777c3a107de57171a6528f8a..bdc12dd93989fb981d157a9eff2e1d59d33b525f 100644 (file)
@@ -8,7 +8,7 @@ CC = gcc
 #CC = clang
 
 PKG_CONFIG ?= pkg-config
-override CFLAGS += `$(PKG_CONFIG) $(SDL_PKGS) --cflags`
+override CFLAGS += $(shell $(PKG_CONFIG) $(SDL_PKGS) --cflags)
 
 SOURCES = sf_fonts.c sf_msg_en.c sf_resource.c sf_util.c \
        sf_deffont.c sf_ftype.c sf_osfdlg.c sf_sig.c sf_video.c \