[iortcw] 83/152: All: Make using yacc optional (disabled by default)
Simon McVittie
smcv at debian.org
Fri Sep 8 10:40:14 UTC 2017
This is an automated email from the git hooks/post-receive script.
smcv pushed a commit to annotated tag 1.5a
in repository iortcw.
commit 2ca8aa8baaeeac5927f1de6b6dac48e3d9777790
Author: MAN-AT-ARMS <M4N4T4RMS at gmail.com>
Date: Tue Jul 19 19:12:49 2016 -0400
All: Make using yacc optional (disabled by default)
---
MP/Makefile | 20 +++++++++++++++++++
README.md | 64 +++++++++++++++++++++++++++++++------------------------------
SP/Makefile | 20 +++++++++++++++++++
3 files changed, 73 insertions(+), 31 deletions(-)
diff --git a/MP/Makefile b/MP/Makefile
index 3febcd4..54bbc25 100644
--- a/MP/Makefile
+++ b/MP/Makefile
@@ -253,6 +253,10 @@ ifndef USE_RENDERER_DLOPEN
USE_RENDERER_DLOPEN=1
endif
+ifndef USE_YACC
+USE_YACC=0
+endif
+
ifndef DEBUG_CFLAGS
DEBUG_CFLAGS=-g -O0
endif
@@ -1386,6 +1390,10 @@ ifndef TOOLS_CC
TOOLS_CC = gcc
endif
+ifndef YACC
+ YACC = yacc
+endif
+
TOOLS_OPTIMIZE = -g -Wall -fno-strict-aliasing
TOOLS_CFLAGS += $(TOOLS_OPTIMIZE) \
-DTEMPDIR=\"$(TEMPDIR)\" -DSYSTEM=\"\" \
@@ -1398,6 +1406,12 @@ ifeq ($(GENERATE_DEPENDENCIES),1)
TOOLS_CFLAGS += -MMD
endif
+define DO_YACC
+$(echo_cmd) "YACC $<"
+$(Q)$(YACC) $<
+$(Q)mv -f y.tab.c $@
+endef
+
define DO_TOOLS_CC
$(echo_cmd) "TOOLS_CC $<"
$(Q)$(TOOLS_CC) $(TOOLS_CFLAGS) -o $@ -c $<
@@ -1419,6 +1433,12 @@ LBURGOBJ= \
$(B)/tools/lburg/lburg.o \
$(B)/tools/lburg/gram.o
+# override GNU Make built-in rule for converting gram.y to gram.c
+%.c: %.y
+ifeq ($(USE_YACC),1)
+ $(DO_YACC)
+endif
+
$(B)/tools/lburg/%.o: $(LBURGDIR)/%.c
$(DO_TOOLS_CC)
diff --git a/README.md b/README.md
index 1ee191e..5a31d54 100644
--- a/README.md
+++ b/README.md
@@ -64,37 +64,39 @@ Thereafter, cross compiling is simply a case running:
The following variables may be set, either on the command line or in
Makefile.local:
- * CFLAGS - use this for custom CFLAGS
- * V - set to show cc command line when building
- * DEFAULT_BASEDIR - extra path to search for main and such
- * BUILD_SERVER - build the 'iowolfded' server binary
- * BUILD_CLIENT - build the 'iowolfmp' or 'iowolfsp' client binary
- * BUILD_BASEGAME - build the 'main' binaries
- * BUILD_GAME_SO - build the game shared libraries
- * BUILD_GAME_QVM - build the game qvms
- * BUILD_STANDALONE - build binaries suited for stand-alone games
- * SERVERBIN - rename 'iowolfded' server binary
- * CLIENTBIN - rename 'iowolfmp' or 'iowolfsp' client binary
- * BASEGAME - rename 'main'
- * BASEGAME_CFLAGS - custom CFLAGS for basegame
- * USE_OPENAL - use OpenAL where available
- * USE_OPENAL_DLOPEN - link with OpenAL at runtime
- * USE_CURL - use libcurl for http/ftp download support
- * USE_CURL_DLOPEN - link with libcurl at runtime
- * USE_CODEC_VORBIS - enable Ogg Vorbis support
- * USE_CODEC_OPUS - enable Ogg Opus support
- * USE_MUMBLE - enable Mumble support
- * USE_VOIP - enable built-in VoIP support
- * USE_INTERNAL_LIBS - build internal libraries instead of dynamically linking against system libraries; this just sets the default for USE_INTERNAL_OPUS etc. and USE_LOCAL_HEADERS
- * USE_FREETYPE - enable FreeType support for rendering fonts
- * USE_INTERNAL_ZLIB - build and link against internal zlib
- * USE_INTERNAL_JPEG - build and link against internal JPEG library
- * USE_INTERNAL_OGG - build and link against internal ogg library
- * USE_INTERNAL_OPUS - build and link against internal opus/opusfile libraries
- * USE_LOCAL_HEADERS - use headers contained within this source tree instead of system ones
- * DEBUG_CFLAGS - C compiler flags to use for building debug version
- * COPYDIR - the target installation directory
- * TEMPDIR - specify user defined directory for temp files
+ * CFLAGS - use this for custom CFLAGS
+ * V - set to show cc command line when building
+ * DEFAULT_BASEDIR - extra path to search for main and such
+ * BUILD_SERVER - build the 'iowolfded' server binary
+ * BUILD_CLIENT - build the 'iowolfmp' or 'iowolfsp' client binary
+ * BUILD_BASEGAME - build the 'main' binaries
+ * BUILD_GAME_SO - build the game shared libraries
+ * BUILD_GAME_QVM - build the game qvms
+ * BUILD_STANDALONE - build binaries suited for stand-alone games
+ * SERVERBIN - rename 'iowolfded' server binary
+ * CLIENTBIN - rename 'iowolfmp' or 'iowolfsp' client binary
+ * USE_RENDERER_DLOPEN - build and use the renderer in a library
+ * USE_YACC - use yacc to update code/tools/lcc/lburg/gram.c
+ * BASEGAME - rename 'main'
+ * BASEGAME_CFLAGS - custom CFLAGS for basegame
+ * USE_OPENAL - use OpenAL where available
+ * USE_OPENAL_DLOPEN - link with OpenAL at runtime
+ * USE_CURL - use libcurl for http/ftp download support
+ * USE_CURL_DLOPEN - link with libcurl at runtime
+ * USE_CODEC_VORBIS - enable Ogg Vorbis support
+ * USE_CODEC_OPUS - enable Ogg Opus support
+ * USE_MUMBLE - enable Mumble support
+ * USE_VOIP - enable built-in VoIP support
+ * USE_INTERNAL_LIBS - build internal libraries instead of dynamically linking against system libraries; this just sets the default for USE_INTERNAL_OPUS etc. and USE_LOCAL_HEADERS
+ * USE_FREETYPE - enable FreeType support for rendering fonts
+ * USE_INTERNAL_ZLIB - build and link against internal zlib
+ * USE_INTERNAL_JPEG - build and link against internal JPEG library
+ * USE_INTERNAL_OGG - build and link against internal ogg library
+ * USE_INTERNAL_OPUS - build and link against internal opus/opusfile libraries
+ * USE_LOCAL_HEADERS - use headers contained within this source tree instead of system ones
+ * DEBUG_CFLAGS - C compiler flags to use for building debug version
+ * COPYDIR - the target installation directory
+ * TEMPDIR - specify user defined directory for temp files
The defaults for these variables differ depending on the target platform.
diff --git a/SP/Makefile b/SP/Makefile
index a5082b3..704370c 100644
--- a/SP/Makefile
+++ b/SP/Makefile
@@ -250,6 +250,10 @@ ifndef USE_RENDERER_DLOPEN
USE_RENDERER_DLOPEN=1
endif
+ifndef USE_YACC
+USE_YACC=0
+endif
+
ifndef DEBUG_CFLAGS
DEBUG_CFLAGS=-g -O0
endif
@@ -1363,6 +1367,10 @@ ifndef TOOLS_CC
TOOLS_CC = gcc
endif
+ifndef YACC
+ YACC = yacc
+endif
+
TOOLS_OPTIMIZE = -g -Wall -fno-strict-aliasing
TOOLS_CFLAGS += $(TOOLS_OPTIMIZE) \
-DTEMPDIR=\"$(TEMPDIR)\" -DSYSTEM=\"\" \
@@ -1375,6 +1383,12 @@ ifeq ($(GENERATE_DEPENDENCIES),1)
TOOLS_CFLAGS += -MMD
endif
+define DO_YACC
+$(echo_cmd) "YACC $<"
+$(Q)$(YACC) $<
+$(Q)mv -f y.tab.c $@
+endef
+
define DO_TOOLS_CC
$(echo_cmd) "TOOLS_CC $<"
$(Q)$(TOOLS_CC) $(TOOLS_CFLAGS) -o $@ -c $<
@@ -1396,6 +1410,12 @@ LBURGOBJ= \
$(B)/tools/lburg/lburg.o \
$(B)/tools/lburg/gram.o
+# override GNU Make built-in rule for converting gram.y to gram.c
+%.c: %.y
+ifeq ($(USE_YACC),1)
+ $(DO_YACC)
+endif
+
$(B)/tools/lburg/%.o: $(LBURGDIR)/%.c
$(DO_TOOLS_CC)
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/iortcw.git
More information about the Pkg-games-commits
mailing list