diff --git a/conf/airframes/microjet_example.xml b/conf/airframes/microjet_example.xml
index 80112ffede..7335062b16 100644
--- a/conf/airframes/microjet_example.xml
+++ b/conf/airframes/microjet_example.xml
@@ -163,11 +163,6 @@
-
BOARD_CFG = \"tiny_1_1.h\"
@@ -183,7 +178,6 @@ include $(CFG_FIXEDWING)/fixedwing_autopilot.makefile
include $(CFG_FIXEDWING)/subsystems/fixedwing_navigation.makefile
# IO Options
-include $(CFG_FIXEDWING)/subsystems/fixedwing_radio_control_ppm.makefile
include $(CFG_FIXEDWING)/subsystems/fixedwing_actuators_4015.makefile
# Sensors
diff --git a/conf/autopilot/subsystems/fixed_wings/radio_control_ppm.makefile b/conf/autopilot/subsystems/fixed_wings/radio_control_ppm.makefile
new file mode 100644
index 0000000000..14aaf7d78b
--- /dev/null
+++ b/conf/autopilot/subsystems/fixed_wings/radio_control_ppm.makefile
@@ -0,0 +1,2 @@
+ap.CFLAGS += -DRADIO_CONTROL
+ap.srcs += $(SRC_FIXEDWING)/radio_control.c $(SRC_ARCH)/ppm_hw.c
diff --git a/sw/tools/gen_aircraft.ml b/sw/tools/gen_aircraft.ml
index 407e85188a..a1e6dcfb54 100644
--- a/sw/tools/gen_aircraft.ml
+++ b/sw/tools/gen_aircraft.ml
@@ -101,13 +101,12 @@ let extract_makefile = fun airframe_file makefile_ac ->
fprintf f "\n# makefile target '%s' board '%s'\n\n" (Xml.attrib x "name") (Xml.attrib x "board");
fprintf f "include $(PAPARAZZI_SRC)/conf/autopilot/%s.makefile\n" (Xml.attrib x "name");
fprintf f "include $(PAPARAZZI_SRC)/conf/boards/%s.makefile\n" (Xml.attrib x "board");
+ let print_if_subsystem = (fun c ->
+ if ExtXml.tag_is c "subsystem" then begin
+ fprintf f "include $(CFG_%s)/%s_%s.makefile\n" (String.uppercase(Xml.attrib x "name")) (Xml.attrib c "name") (Xml.attrib c "type");
+ end) in
+ List.iter print_if_subsystem (Xml.children x)
with _ -> () end;
- (**
- match Xml.children x with
- [Xml.PCData s] -> fprintf f "%s\n" s
- | _ -> failwith (sprintf "Warning: wrong makefile section in '%s': %s\n" airframe_file (Xml.to_string_fmt x))
- **)
-
end)
(Xml.children xml);