paparazzi-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[paparazzi-commits] [4597] add the possibility to choose the type of fla


From: Gautier Hattenberger
Subject: [paparazzi-commits] [4597] add the possibility to choose the type of flag in modules makefile part
Date: Thu, 25 Feb 2010 14:55:55 +0000

Revision: 4597
          http://svn.sv.gnu.org/viewvc/?view=rev&root=paparazzi&revision=4597
Author:   gautier
Date:     2010-02-25 14:55:55 +0000 (Thu, 25 Feb 2010)
Log Message:
-----------
add the possibility to choose the type of flag in modules makefile part

Modified Paths:
--------------
    paparazzi3/trunk/sw/tools/gen_aircraft.ml

Modified: paparazzi3/trunk/sw/tools/gen_aircraft.ml
===================================================================
--- paparazzi3/trunk/sw/tools/gen_aircraft.ml   2010-02-25 14:53:58 UTC (rev 
4596)
+++ paparazzi3/trunk/sw/tools/gen_aircraft.ml   2010-02-25 14:55:55 UTC (rev 
4597)
@@ -113,19 +113,23 @@
             List.iter (fun field ->
               match String.lowercase (Xml.tag field) with
                 "flag" -> 
-                 List.iter
-                   (fun target -> 
-                     let value = try "="^(Xml.attrib field "value") with _ -> 
""
-                     and name = Xml.attrib field "name" in
-                     fprintf f "%s.CFLAGS += -D%s%s\n" target name value)
-                   targets
+                  List.iter
+                  (fun target -> 
+                    let value = try "="^(Xml.attrib field "value") with _ -> ""
+                    and name = Xml.attrib field "name" in
+                    let flag_type = match (ExtXml.attrib_or_default field 
"type" "define") with
+                        "define" | "D" -> "D"
+                      | "include" | "I" -> "I"
+                      | _ -> "D" in
+                    fprintf f "%s.CFLAGS += -%s%s%s\n" target flag_type name 
value)
+                  targets
               | "file" -> 
-                 let name = Xml.attrib field "name" in
-                 List.iter (fun target -> fprintf f "%s.srcs += $(%s)/%s\n" 
target dir_name name) targets
+                  let name = Xml.attrib field "name" in
+                  List.iter (fun target -> fprintf f "%s.srcs += $(%s)/%s\n" 
target dir_name name) targets
               | "define" -> 
-                 let value = Xml.attrib field "value"
-                 and name = Xml.attrib field "name" in
-                 fprintf f "%s = %s\n" name value
+                  let value = Xml.attrib field "value"
+                  and name = Xml.attrib field "name" in
+                  fprintf f "%s = %s\n" name value
               | "raw" ->
                   begin match Xml.children field with
                     [Xml.PCData s] -> fprintf f "%s\n" s





reply via email to

[Prev in Thread] Current Thread [Next in Thread]