[pypy-svn] r72237 - pypy/trunk/pypy/translator/platform

arigo at codespeak.net arigo at codespeak.net
Mon Mar 15 13:13:44 CET 2010


Author: arigo
Date: Mon Mar 15 13:13:43 2010
New Revision: 72237

Modified:
   pypy/trunk/pypy/translator/platform/posix.py
   pypy/trunk/pypy/translator/platform/windows.py
Log:
Tweak the Makefile to separate CFLAGS and CFLAGSEXTRA,
so that the latter gives flags available even if we type
for example 'make lldebug'.  No test, sorry.


Modified: pypy/trunk/pypy/translator/platform/posix.py
==============================================================================
--- pypy/trunk/pypy/translator/platform/posix.py	(original)
+++ pypy/trunk/pypy/translator/platform/posix.py	Mon Mar 15 13:13:43 2010
@@ -87,8 +87,10 @@
             ('LIBS', self._libs(eci.libraries)),
             ('LIBDIRS', self._libdirs(eci.library_dirs)),
             ('INCLUDEDIRS', self._includedirs(rel_includedirs)),
-            ('CFLAGS', self.cflags + list(eci.compile_extra)),
-            ('LDFLAGS', self.link_flags + list(eci.link_extra)),
+            ('CFLAGS', self.cflags),
+            ('CFLAGSEXTRA', list(eci.compile_extra)),
+            ('LDFLAGS', self.link_flags),
+            ('LDFLAGSEXTRA', list(eci.link_extra)),
             ('CC', self.cc),
             ('CC_LINK', eci.use_cpp_linker and 'g++' or '$(CC)'),
             ('LINKFILES', eci.link_files),
@@ -98,8 +100,8 @@
 
         rules = [
             ('all', '$(DEFAULT_TARGET)', []),
-            ('$(TARGET)', '$(OBJECTS)', '$(CC_LINK) $(LDFLAGS) -o $@ $(OBJECTS) $(LIBDIRS) $(LIBS) $(LINKFILES)'),
-            ('%.o', '%.c', '$(CC) $(CFLAGS) -o $@ -c $< $(INCLUDEDIRS)'),
+            ('$(TARGET)', '$(OBJECTS)', '$(CC_LINK) $(LDFLAGS) $(LDFLAGSEXTRA) -o $@ $(OBJECTS) $(LIBDIRS) $(LIBS) $(LINKFILES)'),
+            ('%.o', '%.c', '$(CC) $(CFLAGS) $(CFLAGSEXTRA) -o $@ -c $< $(INCLUDEDIRS)'),
             ]
 
         for rule in rules:
@@ -123,6 +125,7 @@
 
     def write(self, f):
         def write_list(prefix, lst):
+            lst = lst or ['']
             for i, fn in enumerate(lst):
                 fn = fn.replace('\\', '\\\\')
                 print >> f, prefix, fn,
@@ -136,9 +139,8 @@
             f.write('%s = %s\n' % (name, value.replace('\\', '\\\\')))
         else:
             write_list('%s =' % (name,), value)
-        if value:
-            f.write('\n')
-        
+        f.write('\n')
+
 class Rule(object):
     def __init__(self, target, deps, body):
         self.target = target

Modified: pypy/trunk/pypy/translator/platform/windows.py
==============================================================================
--- pypy/trunk/pypy/translator/platform/windows.py	(original)
+++ pypy/trunk/pypy/translator/platform/windows.py	Mon Mar 15 13:13:43 2010
@@ -236,8 +236,10 @@
             ('LIBS', self._libs(eci.libraries)),
             ('LIBDIRS', self._libdirs(eci.library_dirs)),
             ('INCLUDEDIRS', self._includedirs(rel_includedirs)),
-            ('CFLAGS', self.cflags + list(eci.compile_extra)),
-            ('LDFLAGS', self.link_flags + list(eci.link_extra)),
+            ('CFLAGS', self.cflags),
+            ('CFLAGSEXTRA', list(eci.compile_extra)),
+            ('LDFLAGS', self.link_flags),
+            ('LDFLAGSEXTRA', list(eci.link_extra)),
             ('CC', self.cc),
             ('CC_LINK', self.link),
             ('MASM', self.masm),
@@ -247,7 +249,7 @@
 
         rules = [
             ('all', '$(DEFAULT_TARGET)', []),
-            ('.c.obj', '', '$(CC) /nologo $(CFLAGS) /Fo$@ /c $< $(INCLUDEDIRS)'),
+            ('.c.obj', '', '$(CC) /nologo $(CFLAGS) $(CFLAGSEXTRA) /Fo$@ /c $< $(INCLUDEDIRS)'),
             ]
 
         for rule in rules:
@@ -255,10 +257,10 @@
 
         if self.version < 80:
             m.rule('$(TARGET)', '$(OBJECTS)',
-                   '$(CC_LINK) /nologo $(LDFLAGS) $(OBJECTS) /out:$@ $(LIBDIRS) $(LIBS)')
+                   '$(CC_LINK) /nologo $(LDFLAGS) $(LDFLAGSEXTRA) $(OBJECTS) /out:$@ $(LIBDIRS) $(LIBS)')
         else:
             m.rule('$(TARGET)', '$(OBJECTS)',
-                   ['$(CC_LINK) /nologo $(LDFLAGS) $(OBJECTS) /out:$@ $(LIBDIRS) $(LIBS) /MANIFESTFILE:$*.manifest',
+                   ['$(CC_LINK) /nologo $(LDFLAGS) $(LDFLAGSEXTRA) $(OBJECTS) /out:$@ $(LIBDIRS) $(LIBS) /MANIFESTFILE:$*.manifest',
                     'mt.exe -nologo -manifest $*.manifest -outputresource:$@;1',
                     ])
 



More information about the Pypy-commit mailing list