From f53734636df68a087c7aed5ed23937c2c6f42569 Mon Sep 17 00:00:00 2001 From: Adrien Destugues Date: Sat, 18 Jun 2011 16:00:26 +0000 Subject: [PATCH] Use $(shell ...) instead of `...` for calling the shell in variable configuration. Consequences : * This is a GNU Make extension, so it may not work with BSD Make and others * However, backticks relied on an sh shell, which may not be the case everywhere (AmigaOS comes to mind) Why did I do that : $(shell) is evaluated at variable assignment, not each time a command with the variable is executed. This is cleaner and should get the build running a little faster. git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1806 416bcca6-2ee7-4201-b75f-2eb2f807beb1 --- src/Makefile | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/src/Makefile b/src/Makefile index 91e36057..9fb267f1 100644 --- a/src/Makefile +++ b/src/Makefile @@ -50,8 +50,8 @@ ifdef COMSPEC RMDIR = rmdir --ignore-fail-on-non-empty CP = cp BIN = ../bin/grafx2.exe - COPT = -W -Wall -Wdeclaration-after-statement -O$(OPTIM) -g -ggdb `sdl-config --cflags` $(TTFCOPT) $(JOYCOPT) $(VKEYCOPT) $(LUACOPT) $(LAYERCOPT) - LOPT = `sdl-config --libs` -lSDL_image $(TTFLOPT) -lpng14 $(LUALOPT) + COPT = -W -Wall -Wdeclaration-after-statement -O$(OPTIM) -g -ggdb $(shell sdl-config --cflags) $(TTFCOPT) $(JOYCOPT) $(VKEYCOPT) $(LUACOPT) $(LAYERCOPT) + LOPT = $(shell sdl-config --libs) -lSDL_image $(TTFLOPT) -lpng14 $(LUALOPT) LUALOPT = -llua CC = gcc OBJDIR = ../obj/win32 @@ -74,8 +74,8 @@ else RMDIR = rmdir --ignore-fail-on-non-empty CP = cp BIN = ../bin/grafx2 - COPT = -Wall -c -gstabs `sdl-config --cflags` $(TTFCOPT) - LOPT = `sdl-config --libs` -lSDL_image -lpng -ljpeg -lz $(TTFLOPT) -lft2 + COPT = -Wall -c -gstabs $(shell sdl-config --cflags) $(TTFCOPT) + LOPT = $(shell sdl-config --libs) -lSDL_image -lpng -ljpeg -lz $(TTFLOPT) -lft2 CC = gcc OBJDIR = ../obj/amiga ZIP = lha @@ -100,8 +100,8 @@ else SDLCOPT = $(MACOSX_ARCH) -I$(FWDIR)/SDL.framework/Headers -I$(FWDIR)/SDL_image.framework/Headers -I$(FWDIR)/SDL_ttf.framework/Headers -D_THREAD_SAFE #-framework SDL_ttf SDLLOPT = -isysroot $(MACOSX_SYSROOT) $(MACOSX_ARCH) -L/usr/lib -framework SDL -framework SDL_image -framework Cocoa -framework Carbon -framework OpenGL - COPT = -D_DARWIN_C_SOURCE -D__macosx__ -D__linux__ -W -Wall -Wdeclaration-after-statement -O$(OPTIM) -std=c99 -c -g $(LUACOPT) $(SDLCOPT) $(TTFCOPT) -I/usr/X11/include - LOPT = $(SDLLOPT) -llua -lpng -lz + COPT = -D_DARWIN_C_SOURCE -D__macosx__ -D__linux__ -W -Wall -Wdeclaration-after-statement -O$(OPTIM) -std=c99 -c -g $(LUACOPT) $(shell sdlCOPT) $(TTFCOPT) -I/usr/X11/include + LOPT = $(shell sdlLOPT) -llua -lpng -lz # Use gcc for compiling. Use ncc to build a callgraph and analyze the code. CC = gcc #CC = nccgen -ncgcc -ncld -ncfabs @@ -119,8 +119,8 @@ else RMDIR = rmdir --ignore-fail-on-non-empty CP = cp BIN = ../bin/grafx2 - COPT = -Wall -g `sdl-config --cflags` $(TTFCOPT) - LOPT = -lSDL_image `sdl-config --libs` -lpng -ljpeg -lz $(TTFLOPT) -lfreetype2shared + COPT = -Wall -g $(shell sdl-config --cflags) $(TTFCOPT) + LOPT = -lSDL_image $(shell sdl-config --libs) -lpng -ljpeg -lz $(TTFLOPT) -lfreetype2shared CC = gcc OBJDIR = ../obj/aros STRIP = strip --strip-unneeded --remove-section .comment @@ -135,8 +135,8 @@ else RMDIR = rmdir --ignore-fail-on-non-empty CP = cp BIN = ../bin/grafx2 - COPT = -Wall -gstabs -c `sdl-config --cflags` $(TTFCOPT) - LOPT = -lSDL_image `sdl-config --libs` -lpng -ljpeg -lz $(TTFLOPT) + COPT = -Wall -gstabs -c $(shell sdl-config --cflags) $(TTFCOPT) + LOPT = -lSDL_image $(shell sdl-config --libs) -lpng -ljpeg -lz $(TTFLOPT) CC = gcc OBJDIR = ../obj/morphos ZIP = lha @@ -151,8 +151,8 @@ else RMDIR = rmdir --ignore-fail-on-non-empty CP = cp BIN = ../bin/grafx2 - COPT = -W -Wall -c -g `sdl-config --cflags` $(TTFCOPT) -I/boot/home/config/include - LOPT = `sdl-config --libs` -lSDL_image -lpng -ljpeg -lz $(TTFLOPT) + COPT = -W -Wall -c -g $(shell sdl-config --cflags) $(TTFCOPT) -I/boot/home/config/include + LOPT = $(shell sdl-config --libs) -lSDL_image -lpng -ljpeg -lz $(TTFLOPT) CC = gcc OBJDIR = ../obj/beos ZIP = zip @@ -173,8 +173,8 @@ else LUACOPT = -D__ENABLE_LUA__ LUALOPT = -llua endif - COPT = -W -Wall -c -g `sdl-config --cflags` $(TTFCOPT) -I/boot/common/include $(LUACOPT) - LOPT = `sdl-config --libs` -lSDL_image -lpng -ljpeg -lz $(TTFLOPT) -lfreetype -lbe $(LUALOPT) + COPT = -W -Wall -c -g $(shell sdl-config --cflags) $(TTFCOPT) -I/boot/common/include $(LUACOPT) + LOPT = $(shell sdl-config --libs) -lSDL_image -lpng -ljpeg -lz $(TTFLOPT) -lfreetype -lbe $(LUALOPT) CC = gcc OBJDIR = ../obj/haiku ZIP = zip @@ -187,8 +187,8 @@ else RMDIR = rmdir --ignore-fail-on-non-empty CP = cp BIN = ../bin/grafx2 - COPT = -W -Wall -Wdeclaration-after-statement -c -g `sdl-config --cflags` $(TTFCOPT) - LOPT = `sdl-config --libs` -lSDL_image -lpng -ljpeg -lz $(TTFLOPT) + COPT = -W -Wall -Wdeclaration-after-statement -c -g $(shell sdl-config --cflags) $(TTFCOPT) + LOPT = $(shell sdl-config --libs) -lSDL_image -lpng -ljpeg -lz $(TTFLOPT) CC = gcc OBJDIR = ../obj/skyos ZIP = zip @@ -203,8 +203,8 @@ else ZIP = zip PLATFORMFILES = gfx2.png BIN = ../bin/grafx2 - COPT = -W -Wall -std=c99 -c -g -gstabs -D__TRU64__ `sdl-config --cflags` $(TTFCOPT) $(LUACOPT) - LOPT = `sdl-config --libs` -lSDL_image $(TTFLOPT) -lpng $(LUALOPT) -lm + COPT = -W -Wall -std=c99 -c -g -gstabs -D__TRU64__ $(shell sdl-config --cflags) $(TTFCOPT) $(LUACOPT) + LOPT = $(shell sdl-config --libs) -lSDL_image $(TTFLOPT) -lpng $(LUALOPT) -lm OBJDIR = ../obj/unix X11LOPT = -lX11 CC = gcc @@ -250,8 +250,8 @@ else #cross compile a Win32 executable CC = i586-mingw32msvc-gcc BIN = ../bin/grafx2.exe - COPT = -W -Wall -Wdeclaration-after-statement -O$(OPTIM) -g -ggdb -Dmain=SDL_main `/usr/local/cross-tools/i386-mingw32/bin/sdl-config --cflags` $(TTFCOPT) - LOPT = -mwindows -lmingw32 -lSDLmain -lSDL -lshlwapi `/usr/local/cross-tools/i386-mingw32/bin/sdl-config --libs` -lSDL_image $(TTFLOPT) + COPT = -W -Wall -Wdeclaration-after-statement -O$(OPTIM) -g -ggdb -Dmain=SDL_main $(shell /usr/local/cross-tools/i386-mingw32/bin/sdl-config --cflags) $(TTFCOPT) + LOPT = -mwindows -lmingw32 -lSDLmain -lSDL -lshlwapi $(shell /usr/local/cross-tools/i386-mingw32/bin/sdl-config --libs) -lSDL_image $(TTFLOPT) OBJDIR = ../obj/win32 PLATFORM = win32 else