2013-02-17 22:28:41 +01:00
|
|
|
#
|
2013-03-25 01:03:35 +01:00
|
|
|
# Rules to add PyMite flight plan interpreter
|
2013-02-17 22:28:41 +01:00
|
|
|
#
|
|
|
|
|
2013-03-25 01:03:35 +01:00
|
|
|
# Paths
|
|
|
|
PYMITE := $(FLIGHTLIB)/PyMite
|
|
|
|
PYMITELIB := $(PYMITE)/lib
|
|
|
|
PYMITEPLAT := $(PYMITE)/platform/openpilot
|
|
|
|
PYMITETOOLS := $(PYMITE)/tools
|
|
|
|
PYMITEVM := $(PYMITE)/vm
|
|
|
|
PYMITEINC := $(PYMITEVM)
|
|
|
|
PYMITEINC += $(PYMITEPLAT)
|
|
|
|
PYMITEINC += $(OUTDIR)
|
2013-02-17 22:28:41 +01:00
|
|
|
|
2013-03-25 01:03:35 +01:00
|
|
|
# Flight plans
|
|
|
|
FLIGHTPLANLIB ?= $(OPMODULEDIR)/FlightPlan/lib
|
|
|
|
FLIGHTPLANS ?= $(OPMODULEDIR)/FlightPlan/flightplans
|
2013-02-17 22:28:41 +01:00
|
|
|
|
2013-03-25 01:03:35 +01:00
|
|
|
# Extra modules
|
|
|
|
PYMODULES ?= FlightPlan
|
2013-02-17 22:28:41 +01:00
|
|
|
|
2013-03-25 01:03:35 +01:00
|
|
|
# Modules
|
|
|
|
PYSRC += $(foreach mod, $(PYMODULES), $(wildcard $(OPMODULEDIR)/$(mod)/*.c))
|
2013-02-17 22:28:41 +01:00
|
|
|
|
2013-03-25 01:03:35 +01:00
|
|
|
# PyMite virtual machine and platform files
|
|
|
|
PYSRC += $(wildcard $(PYMITEVM)/*.c)
|
|
|
|
PYSRC += $(wildcard $(PYMITEPLAT)/*.c)
|
2013-02-17 22:28:41 +01:00
|
|
|
|
2013-03-25 01:03:35 +01:00
|
|
|
# Autogenerated files
|
|
|
|
PYLIB += $(addprefix $(OUTDIR)/, pmlib_img.c pmlib_nat.c)
|
|
|
|
PYLIB += $(addprefix $(OUTDIR)/, pmlibusr_img.c pmlibusr_nat.c)
|
2013-02-17 22:28:41 +01:00
|
|
|
|
2013-03-25 01:03:35 +01:00
|
|
|
# Scripts
|
|
|
|
PYSCRIPTS += $(wildcard $(PYMITELIB)/*.py)
|
|
|
|
PYSCRIPTS += $(wildcard $(PYMITEPLAT)/*.py)
|
|
|
|
PYSCRIPTS += $(wildcard $(FLIGHTPLANLIB)/*.py)
|
|
|
|
PYSCRIPTS += $(wildcard $(FLIGHTPLANS)/*.py)
|
2013-02-17 22:28:41 +01:00
|
|
|
|
|
|
|
# Generate code for PyMite
|
2013-03-25 01:03:35 +01:00
|
|
|
$(PYSRC): | $(PYLIB) $(OUTDIR)/pmfeatures.h
|
|
|
|
|
|
|
|
$(OUTDIR)/pmfeatures.h: $(PYSCRIPTS)
|
|
|
|
@$(ECHO) $(MSG_PYMITEINIT) $(call toprel, $@)
|
|
|
|
$(V1) $(PYTHON) $(PYMITETOOLS)/pmGenPmFeatures.py $(PYMITEPLAT)/pmfeatures.py > $@
|
|
|
|
|
|
|
|
$(OUTDIR)/pmlib_img.c: | $(OUTDIR)/pmlib_nat.c
|
|
|
|
|
|
|
|
$(OUTDIR)/pmlib_nat.c: $(PYSCRIPTS)
|
|
|
|
@$(ECHO) $(MSG_PYMITEINIT) $(call toprel, $@)
|
|
|
|
$(V1) $(PYTHON) $(PYMITETOOLS)/pmImgCreator.py -c -s --memspace=flash \
|
|
|
|
-f $(PYMITEPLAT)/pmfeatures.py \
|
|
|
|
-o $(OUTDIR)/pmlib_img.c \
|
|
|
|
--native-file=$(OUTDIR)/pmlib_nat.c \
|
|
|
|
$(PYMITELIB)/list.py \
|
|
|
|
$(PYMITELIB)/dict.py \
|
|
|
|
$(PYMITELIB)/__bi.py \
|
|
|
|
$(PYMITELIB)/sys.py \
|
|
|
|
$(PYMITELIB)/string.py \
|
|
|
|
$(wildcard $(FLIGHTPLANLIB)/*.py)
|
|
|
|
|
|
|
|
$(OUTDIR)/pmlibusr_img.c: | $(OUTDIR)/pmlibusr_nat.c
|
|
|
|
|
|
|
|
$(OUTDIR)/pmlibusr_nat.c: $(PYSCRIPTS)
|
|
|
|
@$(ECHO) $(MSG_PYMITEINIT) $(call toprel, $@)
|
|
|
|
$(V1) $(PYTHON) $(PYMITETOOLS)/pmImgCreator.py -c -u \
|
|
|
|
-f $(PYMITEPLAT)/pmfeatures.py \
|
|
|
|
-o $(OUTDIR)/pmlibusr_img.c \
|
|
|
|
--native-file=$(OUTDIR)/pmlibusr_nat.c \
|
|
|
|
$(FLIGHTPLANS)/test.py
|
|
|
|
|
|
|
|
# Add to the source and include lists
|
|
|
|
SRC += $(PYSRC)
|
|
|
|
SRC += $(PYLIB)
|
|
|
|
EXTRAINCDIRS += $(PYMITEINC)
|
|
|
|
EXTRAINCDIRS += $(foreach mod, $(PYMODULES), $(OPMODULEDIR)/$(mod)/inc)
|