]> granicus.if.org Git - yasm/commitdiff
Fix #187: Add new variable CFLAGS_FOR_BUILD for CC_FOR_BUILD compiles.
authorPeter Johnson <peter@tortall.net>
Sat, 31 Oct 2009 21:52:42 +0000 (21:52 -0000)
committerPeter Johnson <peter@tortall.net>
Sat, 31 Oct 2009 21:52:42 +0000 (21:52 -0000)
Due to the need to support cross-building, CC_FOR_BUILD is used instead of
CC for tools that will be run as part of the build process.  However, it
is sometimes necessary to add custom CFLAGS for these builds; CFLAGS_FOR_BUILD
supports this cleanly.

svn path=/trunk/yasm/; revision=2234

tools/genmacro/Makefile.inc
tools/genperf/Makefile.inc
tools/re2c/Makefile.inc

index 6232b9c4c5a4bb60ba1572d16c4464baf911dbaf..c81edd1485fd305a21afac5220b83cb856914d6f 100644 (file)
@@ -11,5 +11,6 @@ genmacro_LDADD = genmacro.$(OBJEXT)
 genmacro_LINK = $(CCLD_FOR_BUILD) -o $@
 
 genmacro.$(OBJEXT): tools/genmacro/genmacro.c
-       $(CC_FOR_BUILD) $(DEFAULT_INCLUDES) $(INCLUDES) -c -o $@ `test -f tools/genmacro/genmacro.c || echo '$(srcdir)/'`tools/genmacro/genmacro.c
+       $(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(DEFAULT_INCLUDES) $(INCLUDES) \
+         -c -o $@ `test -f tools/genmacro/genmacro.c || echo '$(srcdir)/'`tools/genmacro/genmacro.c
 
index b7e80ed8820c3c1140857d8a6d1c7b033dae6bb5..d9f24afa71a55ef8e017e65a8629d788619cbba0 100644 (file)
@@ -23,17 +23,22 @@ genperf_LDADD += gp-xstrdup.$(OBJEXT)
 genperf_LINK = $(CCLD_FOR_BUILD) -o $@
 
 genperf.$(OBJEXT): tools/genperf/genperf.c
-       $(CC_FOR_BUILD) $(DEFAULT_INCLUDES) $(INCLUDES) -c -o $@ `test -f tools/genperf/genperf.c || echo '$(srcdir)/'`tools/genperf/genperf.c
+       $(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(DEFAULT_INCLUDES) $(INCLUDES) \
+         -c -o $@ `test -f tools/genperf/genperf.c || echo '$(srcdir)/'`tools/genperf/genperf.c
 
 gp-perfect.$(OBJEXT): tools/genperf/perfect.c
-       $(CC_FOR_BUILD) $(DEFAULT_INCLUDES) $(INCLUDES) -c -o $@ `test -f tools/genperf/perfect.c || echo '$(srcdir)/'`tools/genperf/perfect.c
+       $(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(DEFAULT_INCLUDES) $(INCLUDES) \
+         -c -o $@ `test -f tools/genperf/perfect.c || echo '$(srcdir)/'`tools/genperf/perfect.c
 
 gp-phash.$(OBJEXT): libyasm/phash.c
-       $(CC_FOR_BUILD) $(DEFAULT_INCLUDES) $(INCLUDES) -c -o $@ `test -f libyasm/phash.c || echo '$(srcdir)/'`libyasm/phash.c
+       $(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(DEFAULT_INCLUDES) $(INCLUDES) \
+         -c -o $@ `test -f libyasm/phash.c || echo '$(srcdir)/'`libyasm/phash.c
 
 gp-xmalloc.$(OBJEXT): libyasm/xmalloc.c
-       $(CC_FOR_BUILD) $(DEFAULT_INCLUDES) $(INCLUDES) -c -o $@ `test -f libyasm/xmalloc.c || echo '$(srcdir)/'`libyasm/xmalloc.c
+       $(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(DEFAULT_INCLUDES) $(INCLUDES) \
+         -c -o $@ `test -f libyasm/xmalloc.c || echo '$(srcdir)/'`libyasm/xmalloc.c
 
 gp-xstrdup.$(OBJEXT): libyasm/xstrdup.c
-       $(CC_FOR_BUILD) $(DEFAULT_INCLUDES) $(INCLUDES) -c -o $@ `test -f libyasm/xstrdup.c || echo '$(srcdir)/'`libyasm/xstrdup.c
+       $(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(DEFAULT_INCLUDES) $(INCLUDES) \
+         -c -o $@ `test -f libyasm/xstrdup.c || echo '$(srcdir)/'`libyasm/xstrdup.c
 
index abd2db8743dc6fcd22e83d20b1a481fc18153f39..ceff908786f41ce06f472d641d93293ab46adcca 100644 (file)
@@ -38,31 +38,40 @@ re2c_LDADD += re2c-translate.$(OBJEXT)
 re2c_LINK = $(CCLD_FOR_BUILD) -o $@
 
 re2c-main.$(OBJEXT): tools/re2c/main.c
-       $(CC_FOR_BUILD) $(DEFAULT_INCLUDES) $(INCLUDES) -c -o $@ `test -f tools/re2c/main.c || echo '$(srcdir)/'`tools/re2c/main.c
+       $(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(DEFAULT_INCLUDES) $(INCLUDES) \
+         -c -o $@ `test -f tools/re2c/main.c || echo '$(srcdir)/'`tools/re2c/main.c
 
 re2c-code.$(OBJEXT): tools/re2c/code.c
-       $(CC_FOR_BUILD) $(DEFAULT_INCLUDES) $(INCLUDES) -c -o $@ `test -f tools/re2c/code.c || echo '$(srcdir)/'`tools/re2c/code.c
+       $(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(DEFAULT_INCLUDES) $(INCLUDES) \
+         -c -o $@ `test -f tools/re2c/code.c || echo '$(srcdir)/'`tools/re2c/code.c
 
 re2c-dfa.$(OBJEXT): tools/re2c/dfa.c
-       $(CC_FOR_BUILD) $(DEFAULT_INCLUDES) $(INCLUDES) -c -o $@ `test -f tools/re2c/dfa.c || echo '$(srcdir)/'`tools/re2c/dfa.c
+       $(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(DEFAULT_INCLUDES) $(INCLUDES) \
+         -c -o $@ `test -f tools/re2c/dfa.c || echo '$(srcdir)/'`tools/re2c/dfa.c
 
 re2c-parser.$(OBJEXT): tools/re2c/parser.c
-       $(CC_FOR_BUILD) $(DEFAULT_INCLUDES) $(INCLUDES) -c -o $@ `test -f tools/re2c/parser.c || echo '$(srcdir)/'`tools/re2c/parser.c
+       $(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(DEFAULT_INCLUDES) $(INCLUDES) \
+         -c -o $@ `test -f tools/re2c/parser.c || echo '$(srcdir)/'`tools/re2c/parser.c
 
 re2c-actions.$(OBJEXT): tools/re2c/actions.c
-       $(CC_FOR_BUILD) $(DEFAULT_INCLUDES) $(INCLUDES) -c -o $@ `test -f tools/re2c/actions.c || echo '$(srcdir)/'`tools/re2c/actions.c
+       $(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(DEFAULT_INCLUDES) $(INCLUDES) \
+         -c -o $@ `test -f tools/re2c/actions.c || echo '$(srcdir)/'`tools/re2c/actions.c
 
 re2c-scanner.$(OBJEXT): tools/re2c/scanner.c
-       $(CC_FOR_BUILD) $(DEFAULT_INCLUDES) $(INCLUDES) -c -o $@ `test -f tools/re2c/scanner.c || echo '$(srcdir)/'`tools/re2c/scanner.c
+       $(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(DEFAULT_INCLUDES) $(INCLUDES) \
+         -c -o $@ `test -f tools/re2c/scanner.c || echo '$(srcdir)/'`tools/re2c/scanner.c
 
 re2c-mbo_getopt.$(OBJEXT): tools/re2c/mbo_getopt.c
-       $(CC_FOR_BUILD) $(DEFAULT_INCLUDES) $(INCLUDES) -c -o $@ `test -f tools/re2c/mbo_getopt.c || echo '$(srcdir)/'`tools/re2c/mbo_getopt.c
+       $(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(DEFAULT_INCLUDES) $(INCLUDES) \
+         -c -o $@ `test -f tools/re2c/mbo_getopt.c || echo '$(srcdir)/'`tools/re2c/mbo_getopt.c
 
 re2c-substr.$(OBJEXT): tools/re2c/substr.c
-       $(CC_FOR_BUILD) $(DEFAULT_INCLUDES) $(INCLUDES) -c -o $@ `test -f tools/re2c/substr.c || echo '$(srcdir)/'`tools/re2c/substr.c
+       $(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(DEFAULT_INCLUDES) $(INCLUDES) \
+         -c -o $@ `test -f tools/re2c/substr.c || echo '$(srcdir)/'`tools/re2c/substr.c
 
 re2c-translate.$(OBJEXT): tools/re2c/translate.c
-       $(CC_FOR_BUILD) $(DEFAULT_INCLUDES) $(INCLUDES) -c -o $@ `test -f tools/re2c/translate.c || echo '$(srcdir)/'`tools/re2c/translate.c
+       $(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(DEFAULT_INCLUDES) $(INCLUDES) \
+         -c -o $@ `test -f tools/re2c/translate.c || echo '$(srcdir)/'`tools/re2c/translate.c
 
 EXTRA_DIST += tools/re2c/CHANGELOG
 EXTRA_DIST += tools/re2c/NO_WARRANTY