nitc: clean up makefile header generation
authorAlexis Laferrière <alexis.laf@xymus.net>
Tue, 14 Mar 2017 00:20:57 +0000 (20:20 -0400)
committerAlexis Laferrière <alexis.laf@xymus.net>
Tue, 14 Mar 2017 00:20:57 +0000 (20:20 -0400)
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

src/compiler/abstract_compiler.nit

index 5a0b684..224de8b 100644 (file)
@@ -349,7 +349,14 @@ class MakefileToolchain
                end
                var debug = toolcontext.opt_debug.value
 
-               makefile.write("CC = ccache cc\nCXX = ccache c++\nCFLAGS = -g{ if not debug then " -O2 " else " "}-Wno-unused-value -Wno-switch -Wno-attributes -Wno-trigraphs\nCINCL =\nLDFLAGS ?= \nLDLIBS  ?= -lm {linker_options.join(" ")}\n\n")
+               makefile.write """
+CC = ccache cc
+CXX = ccache c++
+CFLAGS = -g {{{if not debug then "-O2" else ""}}} -Wno-unused-value -Wno-switch -Wno-attributes -Wno-trigraphs
+CINCL =
+LDFLAGS ?=
+LDLIBS  ?= -lm {{{linker_options.join(" ")}}}
+\n"""
 
                makefile.write "\n# SPECIAL CONFIGURATION FLAGS\n"
                if platform.supports_libunwind then