2 # Rules to add PyMite flight plan interpreter
6 PYMITE
:= $(FLIGHTLIB
)/PyMite
7 PYMITELIB
:= $(PYMITE
)/lib
8 PYMITEPLAT
:= $(PYMITE
)/platform
/openpilot
9 PYMITETOOLS
:= $(PYMITE
)/tools
10 PYMITEVM
:= $(PYMITE
)/vm
11 PYMITEINC
:= $(PYMITEVM
)
12 PYMITEINC
+= $(PYMITEPLAT
)
13 PYMITEINC
+= $(OUTDIR
)
16 FLIGHTPLANLIB ?
= $(OPMODULEDIR
)/FlightPlan
/lib
17 FLIGHTPLANS ?
= $(OPMODULEDIR
)/FlightPlan
/flightplans
20 PYMODULES ?
= FlightPlan
23 PYSRC
+= $(foreach mod
, $(PYMODULES
), $(wildcard $(OPMODULEDIR
)/$(mod
)/*.c
))
25 # PyMite virtual machine and platform files
26 PYSRC
+= $(wildcard $(PYMITEVM
)/*.c
)
27 PYSRC
+= $(wildcard $(PYMITEPLAT
)/*.c
)
30 PYLIB
+= $(addprefix $(OUTDIR
)/, pmlib_img.c pmlib_nat.c
)
31 PYLIB
+= $(addprefix $(OUTDIR
)/, pmlibusr_img.c pmlibusr_nat.c
)
34 PYSCRIPTS
+= $(wildcard $(PYMITELIB
)/*.py
)
35 PYSCRIPTS
+= $(wildcard $(PYMITEPLAT
)/*.py
)
36 PYSCRIPTS
+= $(wildcard $(FLIGHTPLANLIB
)/*.py
)
37 PYSCRIPTS
+= $(wildcard $(FLIGHTPLANS
)/*.py
)
39 # Generate code for PyMite
40 $(PYSRC
): |
$(PYLIB
) $(OUTDIR
)/pmfeatures.h
42 $(OUTDIR
)/pmfeatures.h
: $(PYSCRIPTS
)
43 @echo
$(MSG_PYMITEINIT
) $(call toprel
, $@
)
44 $(V1
) $(PYTHON
) $(PYMITETOOLS
)/pmGenPmFeatures.py
$(PYMITEPLAT
)/pmfeatures.py
> $@
46 $(OUTDIR
)/pmlib_img.c
: |
$(OUTDIR
)/pmlib_nat.c
48 $(OUTDIR
)/pmlib_nat.c
: $(PYSCRIPTS
)
49 @echo
$(MSG_PYMITEINIT
) $(call toprel
, $@
)
50 $(V1
) $(PYTHON
) $(PYMITETOOLS
)/pmImgCreator.py
-c
-s
--memspace
=flash \
51 -f
$(PYMITEPLAT
)/pmfeatures.py \
52 -o
$(OUTDIR
)/pmlib_img.c \
53 --native-file
=$(OUTDIR
)/pmlib_nat.c \
54 $(PYMITELIB
)/list.py \
55 $(PYMITELIB
)/dict.py \
56 $(PYMITELIB
)/__bi.py \
58 $(PYMITELIB
)/string.py \
59 $(wildcard $(FLIGHTPLANLIB
)/*.py
)
61 $(OUTDIR
)/pmlibusr_img.c
: |
$(OUTDIR
)/pmlibusr_nat.c
63 $(OUTDIR
)/pmlibusr_nat.c
: $(PYSCRIPTS
)
64 @echo
$(MSG_PYMITEINIT
) $(call toprel
, $@
)
65 $(V1
) $(PYTHON
) $(PYMITETOOLS
)/pmImgCreator.py
-c
-u \
66 -f
$(PYMITEPLAT
)/pmfeatures.py \
67 -o
$(OUTDIR
)/pmlibusr_img.c \
68 --native-file
=$(OUTDIR
)/pmlibusr_nat.c \
69 $(FLIGHTPLANS
)/test.py
71 # Add to the source and include lists
74 EXTRAINCDIRS
+= $(PYMITEINC
)
75 EXTRAINCDIRS
+= $(foreach mod
, $(PYMODULES
), $(OPMODULEDIR
)/$(mod
)/inc
)