diff --git a/conf/firmwares/subsystems/shared/imu_analog.makefile b/conf/firmwares/subsystems/shared/imu_analog.makefile index c0d084b64f7..511463438b2 100644 --- a/conf/firmwares/subsystems/shared/imu_analog.makefile +++ b/conf/firmwares/subsystems/shared/imu_analog.makefile @@ -89,9 +89,14 @@ $(error Not implemented for the stm32 yet... should be trivial, just do it...) endif -# Keep CFLAGS/Srcs for imu in separate expression so we can assign it to other targets -ap.CFLAGS += $(imu_CFLAGS) -ap.srcs += $(imu_srcs) -test_imu.CFLAG += $(imu_CFLAGS) -test_imu.srcs += $(imu_srcs) +# add it for all targets except sim, fbw and nps +ifeq (,$(findstring $(TARGET),sim fbw nps)) +$(TARGET).CFLAGS += $(imu_CFLAGS) +$(TARGET).srcs += $(imu_srcs) +endif + +# +# NPS simulator +# +include $(CFG_SHARED)/imu_nps.makefile diff --git a/conf/firmwares/subsystems/shared/imu_apogee.makefile b/conf/firmwares/subsystems/shared/imu_apogee.makefile index 0f8bfcf272b..b47f862f72d 100644 --- a/conf/firmwares/subsystems/shared/imu_apogee.makefile +++ b/conf/firmwares/subsystems/shared/imu_apogee.makefile @@ -16,11 +16,12 @@ IMU_APOGEE_CFLAGS += -DIMU_APOGEE_I2C_DEV=$(IMU_APOGEE_I2C_DEV) IMU_APOGEE_SRCS += peripherals/mpu60x0.c IMU_APOGEE_SRCS += peripherals/mpu60x0_i2c.c -ap.CFLAGS += $(IMU_APOGEE_CFLAGS) -ap.srcs += $(IMU_APOGEE_SRCS) -test_imu.CFLAGS += $(IMU_APOGEE_CFLAGS) -test_imu.srcs += $(IMU_APOGEE_SRCS) +# add it for all targets except sim, fbw and nps +ifeq (,$(findstring $(TARGET),sim fbw nps)) +$(TARGET).CFLAGS += $(IMU_APOGEE_CFLAGS) +$(TARGET).srcs += $(IMU_APOGEE_SRCS) +endif # # Simulator diff --git a/conf/firmwares/subsystems/shared/imu_ardrone2.makefile b/conf/firmwares/subsystems/shared/imu_ardrone2.makefile index cc7fa61c834..5f7a9efe9b4 100644 --- a/conf/firmwares/subsystems/shared/imu_ardrone2.makefile +++ b/conf/firmwares/subsystems/shared/imu_ardrone2.makefile @@ -11,9 +11,13 @@ imu_srcs += $(SRC_SUBSYSTEMS)/imu/imu_ardrone2_raw.c imu_srcs += $(SRC_BOARD)/navdata.c endif -# Keep CFLAGS/Srcs for imu in separate expression so we can assign it to other targets -ap.CFLAGS += $(imu_CFLAGS) -ap.srcs += $(imu_srcs) + +# add it for all targets except sim, fbw and nps +ifeq (,$(findstring $(TARGET),sim fbw nps)) +$(TARGET).CFLAGS += $(imu_CFLAGS) +$(TARGET).srcs += $(imu_srcs) +endif + # Set the AHRS propegation frequencies AHRS_PROPAGATE_FREQUENCY ?= 200 diff --git a/conf/firmwares/subsystems/shared/imu_aspirin2_i2c.makefile b/conf/firmwares/subsystems/shared/imu_aspirin2_i2c.makefile index 9a2d152c49e..78f77d6cb53 100644 --- a/conf/firmwares/subsystems/shared/imu_aspirin2_i2c.makefile +++ b/conf/firmwares/subsystems/shared/imu_aspirin2_i2c.makefile @@ -27,11 +27,12 @@ IMU_ASPIRIN2_I2C_DEV_LOWER=$(shell echo $(IMU_ASPIRIN2_I2C_DEV) | tr A-Z a-z) IMU_ASPIRIN2_CFLAGS += -DIMU_ASPIRIN2_I2C_DEV=$(IMU_ASPIRIN2_I2C_DEV_LOWER) IMU_ASPIRIN2_CFLAGS += -DUSE_$(IMU_ASPIRIN2_I2C_DEV_UPPER) -ap.CFLAGS += $(IMU_ASPIRIN2_CFLAGS) -ap.srcs += $(IMU_ASPIRIN2_SRCS) -test_imu.CFLAGS += $(IMU_ASPIRIN2_CFLAGS) -test_imu.srcs += $(IMU_ASPIRIN2_SRCS) +# add it for all targets except sim, fbw and nps +ifeq (,$(findstring $(TARGET),sim fbw nps)) +$(TARGET).CFLAGS += $(IMU_ASPIRIN2_CFLAGS) +$(TARGET).srcs += $(IMU_ASPIRIN2_SRCS) +endif # # NPS simulator diff --git a/conf/firmwares/subsystems/shared/imu_aspirin_i2c_v1.0.makefile b/conf/firmwares/subsystems/shared/imu_aspirin_i2c_v1.0.makefile index a67c9ddda67..42da221a965 100644 --- a/conf/firmwares/subsystems/shared/imu_aspirin_i2c_v1.0.makefile +++ b/conf/firmwares/subsystems/shared/imu_aspirin_i2c_v1.0.makefile @@ -24,9 +24,8 @@ include $(CFG_SHARED)/imu_aspirin_i2c_common.makefile IMU_ASPIRIN_CFLAGS += -DIMU_ASPIRIN_VERSION_1_0 -# Keep CFLAGS/Srcs for imu in separate expression so we can assign it to other targets -ap.CFLAGS += $(IMU_ASPIRIN_CFLAGS) -ap.srcs += $(IMU_ASPIRIN_SRCS) - -test_imu.CFLAGS += $(IMU_ASPIRIN_CFLAGS) -test_imu.srcs += $(IMU_ASPIRIN_SRCS) +# add it for all targets except sim, fbw and nps +ifeq (,$(findstring $(TARGET),sim fbw nps)) +$(TARGET).CFLAGS += $(IMU_ASPIRIN_CFLAGS) +$(TARGET).srcs += $(IMU_ASPIRIN_SRCS) +endif diff --git a/conf/firmwares/subsystems/shared/imu_aspirin_i2c_v1.5.makefile b/conf/firmwares/subsystems/shared/imu_aspirin_i2c_v1.5.makefile index 08f387621fd..d3234a4bbd9 100644 --- a/conf/firmwares/subsystems/shared/imu_aspirin_i2c_v1.5.makefile +++ b/conf/firmwares/subsystems/shared/imu_aspirin_i2c_v1.5.makefile @@ -24,9 +24,8 @@ include $(CFG_SHARED)/imu_aspirin_i2c_common.makefile IMU_ASPIRIN_CFLAGS += -DIMU_ASPIRIN_VERSION_1_5 -# Keep CFLAGS/Srcs for imu in separate expression so we can assign it to other targets -ap.CFLAGS += $(IMU_ASPIRIN_CFLAGS) -ap.srcs += $(IMU_ASPIRIN_SRCS) - -test_imu.CFLAGS += $(IMU_ASPIRIN_CFLAGS) -test_imu.srcs += $(IMU_ASPIRIN_SRCS) +# add it for all targets except sim, fbw and nps +ifeq (,$(findstring $(TARGET),sim fbw nps)) +$(TARGET).CFLAGS += $(IMU_ASPIRIN_CFLAGS) +$(TARGET).srcs += $(IMU_ASPIRIN_SRCS) +endif diff --git a/conf/firmwares/subsystems/shared/imu_aspirin_v1.0.makefile b/conf/firmwares/subsystems/shared/imu_aspirin_v1.0.makefile index ec0d54fe9b8..7992397da4b 100644 --- a/conf/firmwares/subsystems/shared/imu_aspirin_v1.0.makefile +++ b/conf/firmwares/subsystems/shared/imu_aspirin_v1.0.makefile @@ -24,9 +24,8 @@ include $(CFG_SHARED)/imu_aspirin_common.makefile IMU_ASPIRIN_CFLAGS += -DIMU_ASPIRIN_VERSION_1_0 -# Keep CFLAGS/Srcs for imu in separate expression so we can assign it to other targets -ap.CFLAGS += $(IMU_ASPIRIN_CFLAGS) -ap.srcs += $(IMU_ASPIRIN_SRCS) - -test_imu.CFLAGS += $(IMU_ASPIRIN_CFLAGS) -test_imu.srcs += $(IMU_ASPIRIN_SRCS) +# add it for all targets except sim, fbw and nps +ifeq (,$(findstring $(TARGET),sim fbw nps)) +$(TARGET).CFLAGS += $(IMU_ASPIRIN_CFLAGS) +$(TARGET).srcs += $(IMU_ASPIRIN_SRCS) +endif diff --git a/conf/firmwares/subsystems/shared/imu_aspirin_v1.5.makefile b/conf/firmwares/subsystems/shared/imu_aspirin_v1.5.makefile index 1d0a4e5f24c..03e04662b47 100644 --- a/conf/firmwares/subsystems/shared/imu_aspirin_v1.5.makefile +++ b/conf/firmwares/subsystems/shared/imu_aspirin_v1.5.makefile @@ -24,9 +24,8 @@ include $(CFG_SHARED)/imu_aspirin_common.makefile IMU_ASPIRIN_CFLAGS += -DIMU_ASPIRIN_VERSION_1_5 -# Keep CFLAGS/Srcs for imu in separate expression so we can assign it to other targets -ap.CFLAGS += $(IMU_ASPIRIN_CFLAGS) -ap.srcs += $(IMU_ASPIRIN_SRCS) - -test_imu.CFLAGS += $(IMU_ASPIRIN_CFLAGS) -test_imu.srcs += $(IMU_ASPIRIN_SRCS) +# add it for all targets except sim, fbw and nps +ifeq (,$(findstring $(TARGET),sim fbw nps)) +$(TARGET).CFLAGS += $(IMU_ASPIRIN_CFLAGS) +$(TARGET).srcs += $(IMU_ASPIRIN_SRCS) +endif diff --git a/conf/firmwares/subsystems/shared/imu_aspirin_v2.1.makefile b/conf/firmwares/subsystems/shared/imu_aspirin_v2.1.makefile index e34869ff12c..0574132a1df 100644 --- a/conf/firmwares/subsystems/shared/imu_aspirin_v2.1.makefile +++ b/conf/firmwares/subsystems/shared/imu_aspirin_v2.1.makefile @@ -38,8 +38,8 @@ include $(CFG_SHARED)/imu_aspirin_v2_common.makefile -ap.CFLAGS += $(IMU_ASPIRIN_2_CFLAGS) -ap.srcs += $(IMU_ASPIRIN_2_SRCS) - -test_imu.CFLAGS += $(IMU_ASPIRIN_2_CFLAGS) -test_imu.srcs += $(IMU_ASPIRIN_2_SRCS) +# add it for all targets except sim, fbw and nps +ifeq (,$(findstring $(TARGET),sim fbw nps)) +$(TARGET).CFLAGS += $(IMU_ASPIRIN_2_CFLAGS) +$(TARGET).srcs += $(IMU_ASPIRIN_2_SRCS) +endif diff --git a/conf/firmwares/subsystems/shared/imu_aspirin_v2.2.makefile b/conf/firmwares/subsystems/shared/imu_aspirin_v2.2.makefile index fd4a9e97f34..db51d1c0750 100644 --- a/conf/firmwares/subsystems/shared/imu_aspirin_v2.2.makefile +++ b/conf/firmwares/subsystems/shared/imu_aspirin_v2.2.makefile @@ -53,11 +53,8 @@ else ifeq ($(ARCH), stm32) IMU_ASPIRIN_2_CFLAGS += -DUSE_SPI_SLAVE3 endif -ap.CFLAGS += $(IMU_ASPIRIN_2_CFLAGS) -ap.srcs += $(IMU_ASPIRIN_2_SRCS) - -test_imu.CFLAGS += $(IMU_ASPIRIN_2_CFLAGS) -test_imu.srcs += $(IMU_ASPIRIN_2_SRCS) - -test_ahrs.CFLAGS += $(IMU_ASPIRIN_2_CFLAGS) -test_ahrs.srcs += $(IMU_ASPIRIN_2_SRCS) +# add it for all targets except sim, fbw and nps +ifeq (,$(findstring $(TARGET),sim fbw nps)) +$(TARGET).CFLAGS += $(IMU_ASPIRIN_2_CFLAGS) +$(TARGET).srcs += $(IMU_ASPIRIN_2_SRCS) +endif diff --git a/conf/firmwares/subsystems/shared/imu_b2_v1.0.makefile b/conf/firmwares/subsystems/shared/imu_b2_v1.0.makefile index a24859ff39e..59315ec83fa 100644 --- a/conf/firmwares/subsystems/shared/imu_b2_v1.0.makefile +++ b/conf/firmwares/subsystems/shared/imu_b2_v1.0.makefile @@ -57,9 +57,8 @@ endif endif #NO_MAG -# Keep CFLAGS/Srcs for imu in separate expression so we can assign it to other targets -ap.CFLAGS += $(imu_CFLAGS) -ap.srcs += $(imu_srcs) - -test_imu.CFLAGS += $(imu_CFLAGS) -test_imu.srcs += $(imu_srcs) +# add it for all targets except sim, fbw and nps +ifeq (,$(findstring $(TARGET),sim fbw nps)) +$(TARGET).CFLAGS += $(imu_CFLAGS) +$(TARGET).srcs += $(imu_srcs) +endif diff --git a/conf/firmwares/subsystems/shared/imu_b2_v1.1.makefile b/conf/firmwares/subsystems/shared/imu_b2_v1.1.makefile index 27441696628..cb6a06ffd04 100644 --- a/conf/firmwares/subsystems/shared/imu_b2_v1.1.makefile +++ b/conf/firmwares/subsystems/shared/imu_b2_v1.1.makefile @@ -57,9 +57,8 @@ imu_CFLAGS += -DMS2100_SLAVE_IDX=4 imu_CFLAGS += -DMS2100_SPI_DEV=spi2 endif -# Keep CFLAGS/Srcs for imu in separate expression so we can assign it to other targets -ap.CFLAGS += $(imu_CFLAGS) -ap.srcs += $(imu_srcs) - -test_imu.CFLAGS += $(imu_CFLAGS) -test_imu.srcs += $(imu_srcs) +# add it for all targets except sim, fbw and nps +ifeq (,$(findstring $(TARGET),sim fbw nps)) +$(TARGET).CFLAGS += $(imu_CFLAGS) +$(TARGET).srcs += $(imu_srcs) +endif diff --git a/conf/firmwares/subsystems/shared/imu_b2_v1.2.makefile b/conf/firmwares/subsystems/shared/imu_b2_v1.2.makefile index 6e8cceb0a57..57f201d6a52 100644 --- a/conf/firmwares/subsystems/shared/imu_b2_v1.2.makefile +++ b/conf/firmwares/subsystems/shared/imu_b2_v1.2.makefile @@ -50,9 +50,8 @@ else ifeq ($(ARCH), stm32) imu_CFLAGS += -DIMU_B2_I2C_DEV=i2c2 -DUSE_I2C2 endif -# Keep CFLAGS/Srcs for imu in separate expression so we can assign it to other targets -ap.CFLAGS += $(imu_CFLAGS) -ap.srcs += $(imu_srcs) - -test_imu.CFLAGS += $(imu_CFLAGS) -test_imu.srcs += $(imu_srcs) +# add it for all targets except sim, fbw and nps +ifeq (,$(findstring $(TARGET),sim fbw nps)) +$(TARGET).CFLAGS += $(imu_CFLAGS) +$(TARGET).srcs += $(imu_srcs) +endif diff --git a/conf/firmwares/subsystems/shared/imu_bebop.makefile b/conf/firmwares/subsystems/shared/imu_bebop.makefile index 4df31b36638..9d4d0f70790 100644 --- a/conf/firmwares/subsystems/shared/imu_bebop.makefile +++ b/conf/firmwares/subsystems/shared/imu_bebop.makefile @@ -37,11 +37,11 @@ BEBOP_MPU_I2C_DEV_LOWER=$(shell echo $(BEBOP_MPU_I2C_DEV) | tr A-Z a-z) IMU_CFLAGS += -DBEBOP_MAG_I2C_DEV=$(BEBOP_MAG_I2C_DEV_LOWER) -DBEBOP_MPU_I2C_DEV=$(BEBOP_MPU_I2C_DEV_LOWER) IMU_CFLAGS += -DUSE_$(BEBOP_MAG_I2C_DEV_UPPER)=1 -DUSE_$(BEBOP_MPU_I2C_DEV_UPPER)=1 -ap.CFLAGS += $(IMU_CFLAGS) -ap.srcs += $(IMU_SRCS) - -test_imu.CFLAGS += $(IMU_CFLAGS) -test_imu.srcs += $(IMU_SRCS) +# add it for all targets except sim, fbw and nps +ifeq (,$(findstring $(TARGET),sim fbw nps)) +$(TARGET).CFLAGS += $(IMU_CFLAGS) +$(TARGET).srcs += $(IMU_SRCS) +endif # # NPS simulator diff --git a/conf/firmwares/subsystems/shared/imu_drotek_10dof_v2.makefile b/conf/firmwares/subsystems/shared/imu_drotek_10dof_v2.makefile index 6bc352a6cde..fd9ae23592f 100644 --- a/conf/firmwares/subsystems/shared/imu_drotek_10dof_v2.makefile +++ b/conf/firmwares/subsystems/shared/imu_drotek_10dof_v2.makefile @@ -73,14 +73,11 @@ IMU_DROTEK_2_CFLAGS += -DDROTEK_2_I2C_DEV=$(DROTEK_2_I2C_DEV_LOWER) IMU_DROTEK_2_CFLAGS += -DUSE_$(DROTEK_2_I2C_DEV_UPPER) -# Keep CFLAGS/Srcs for imu in separate expression so we can assign it to other targets - -ap.CFLAGS += $(IMU_DROTEK_2_CFLAGS) -ap.srcs += $(IMU_DROTEK_2_SRCS) - -test_imu.CFLAGS += $(IMU_DROTEK_2_CFLAGS) -test_imu.srcs += $(IMU_DROTEK_2_SRCS) - +# add it for all targets except sim, fbw and nps +ifeq (,$(findstring $(TARGET),sim fbw nps)) +$(TARGET).CFLAGS += $(IMU_DROTEK_2_CFLAGS) +$(TARGET).srcs += $(IMU_DROTEK_2_SRCS) +endif # # NPS simulator diff --git a/conf/firmwares/subsystems/shared/imu_gl1.makefile b/conf/firmwares/subsystems/shared/imu_gl1.makefile index d822ab39cc3..07e9a07dd85 100644 --- a/conf/firmwares/subsystems/shared/imu_gl1.makefile +++ b/conf/firmwares/subsystems/shared/imu_gl1.makefile @@ -41,12 +41,11 @@ GL1_I2C_DEV_LOWER=$(shell echo $(GL1_I2C_DEV) | tr A-Z a-z) IMU_GL1_CFLAGS += -DGL1_I2C_DEV=$(GL1_I2C_DEV_LOWER) IMU_GL1_CFLAGS += -DUSE_$(GL1_I2C_DEV_UPPER) -# Keep CFLAGS/Srcs for imu in separate expression so we can assign it to other targets -ap.CFLAGS += $(IMU_GL1_CFLAGS) -ap.srcs += $(IMU_GL1_SRCS) - -test_imu.CFLAGS += $(IMU_GL1_CFLAGS) -test_imu.srcs += $(IMU_GL1_SRCS) +# add it for all targets except sim, fbw and nps +ifeq (,$(findstring $(TARGET),sim fbw nps)) +$(TARGET).CFLAGS += $(IMU_GL1_CFLAGS) +$(TARGET).srcs += $(IMU_GL1_SRCS) +endif # # NPS simulator diff --git a/conf/firmwares/subsystems/shared/imu_hbmini.makefile b/conf/firmwares/subsystems/shared/imu_hbmini.makefile index 88b42179459..ce58f773110 100644 --- a/conf/firmwares/subsystems/shared/imu_hbmini.makefile +++ b/conf/firmwares/subsystems/shared/imu_hbmini.makefile @@ -24,8 +24,11 @@ IMU_HBMINI_CFLAGS += -DMAX1168_EOC_VIC_SLOT=11 IMU_HBMINI_SRCS += peripherals/max1168.c IMU_HBMINI_SRCS += $(SRC_ARCH)/peripherals/max1168_arch.c -ap.CFLAGS += $(IMU_HBMINI_CFLAGS) -ap.srcs += $(IMU_HBMINI_SRCS) +# add it for all targets except sim, fbw and nps +ifeq (,$(findstring $(TARGET),sim fbw nps)) +$(TARGET).CFLAGS += $(IMU_HBMINI_CFLAGS) +$(TARGET).srcs += $(IMU_HBMINI_SRCS) +endif # # Simulator diff --git a/conf/firmwares/subsystems/shared/imu_krooz_sd.makefile b/conf/firmwares/subsystems/shared/imu_krooz_sd.makefile index cb595ee0fd1..a5fc6862816 100644 --- a/conf/firmwares/subsystems/shared/imu_krooz_sd.makefile +++ b/conf/firmwares/subsystems/shared/imu_krooz_sd.makefile @@ -18,11 +18,11 @@ IMU_KROOZ_SRCS += peripherals/mpu60x0.c IMU_KROOZ_SRCS += peripherals/mpu60x0_i2c.c IMU_KROOZ_SRCS += peripherals/hmc58xx.c -ap.CFLAGS += $(IMU_KROOZ_CFLAGS) -ap.srcs += $(IMU_KROOZ_SRCS) - -test_imu.CFLAGS += $(IMU_KROOZ_CFLAGS) -test_imu.srcs += $(IMU_KROOZ_SRCS) +# add it for all targets except sim, fbw and nps +ifeq (,$(findstring $(TARGET),sim fbw nps)) +$(TARGET).CFLAGS += $(IMU_KROOZ_CFLAGS) +$(TARGET).srcs += $(IMU_KROOZ_SRCS) +endif # # NPS simulator diff --git a/conf/firmwares/subsystems/shared/imu_krooz_sd_memsic.makefile b/conf/firmwares/subsystems/shared/imu_krooz_sd_memsic.makefile index db7e30645a3..3d1487155a0 100644 --- a/conf/firmwares/subsystems/shared/imu_krooz_sd_memsic.makefile +++ b/conf/firmwares/subsystems/shared/imu_krooz_sd_memsic.makefile @@ -23,11 +23,11 @@ IMU_KROOZ_SRCS += peripherals/mpu60x0.c IMU_KROOZ_SRCS += peripherals/mpu60x0_i2c.c IMU_KROOZ_SRCS += peripherals/hmc58xx.c -ap.CFLAGS += $(IMU_KROOZ_CFLAGS) -ap.srcs += $(IMU_KROOZ_SRCS) - -test_imu.CFLAGS += $(IMU_KROOZ_CFLAGS) -test_imu.srcs += $(IMU_KROOZ_SRCS) +# add it for all targets except sim, fbw and nps +ifeq (,$(findstring $(TARGET),sim fbw nps)) +$(TARGET).CFLAGS += $(IMU_KROOZ_CFLAGS) +$(TARGET).srcs += $(IMU_KROOZ_SRCS) +endif # # NPS simulator diff --git a/conf/firmwares/subsystems/shared/imu_lisa_m_or_mx_v2.1.makefile b/conf/firmwares/subsystems/shared/imu_lisa_m_or_mx_v2.1.makefile index b9696ba115d..1ada70b3718 100644 --- a/conf/firmwares/subsystems/shared/imu_lisa_m_or_mx_v2.1.makefile +++ b/conf/firmwares/subsystems/shared/imu_lisa_m_or_mx_v2.1.makefile @@ -63,14 +63,12 @@ IMU_ASPIRIN_2_CFLAGS += -DUSE_SPI_SLAVE2 # SLAVE3 is on PC13, which is the baro CS IMU_ASPIRIN_2_CFLAGS += -DUSE_SPI_SLAVE3 -ap.CFLAGS += $(IMU_ASPIRIN_2_CFLAGS) -ap.srcs += $(IMU_ASPIRIN_2_SRCS) -test_imu.CFLAGS += $(IMU_ASPIRIN_2_CFLAGS) -test_imu.srcs += $(IMU_ASPIRIN_2_SRCS) - -test_ahrs.CFLAGS += $(IMU_ASPIRIN_2_CFLAGS) -test_ahrs.srcs += $(IMU_ASPIRIN_2_SRCS) +# add it for all targets except sim, fbw and nps +ifeq (,$(findstring $(TARGET),sim fbw nps)) +$(TARGET).CFLAGS += $(IMU_ASPIRIN_2_CFLAGS) +$(TARGET).srcs += $(IMU_ASPIRIN_2_SRCS) +endif # # NPS simulator diff --git a/conf/firmwares/subsystems/shared/imu_lisa_s_v1.0.makefile b/conf/firmwares/subsystems/shared/imu_lisa_s_v1.0.makefile index 48caa3b4872..2c9255e1ebc 100644 --- a/conf/firmwares/subsystems/shared/imu_lisa_s_v1.0.makefile +++ b/conf/firmwares/subsystems/shared/imu_lisa_s_v1.0.makefile @@ -61,11 +61,11 @@ IMU_ASPIRIN_2_CFLAGS += -DUSE_SPI_SLAVE0 # SLAVE1 is on PC4, which is the baro CS IMU_ASPIRIN_2_CFLAGS += -DUSE_SPI_SLAVE1 -ap.CFLAGS += $(IMU_ASPIRIN_2_CFLAGS) -ap.srcs += $(IMU_ASPIRIN_2_SRCS) - -test_imu.CFLAGS += $(IMU_ASPIRIN_2_CFLAGS) -test_imu.srcs += $(IMU_ASPIRIN_2_SRCS) +# add it for all targets except sim, fbw and nps +ifeq (,$(findstring $(TARGET),sim fbw nps)) +$(TARGET).CFLAGS += $(IMU_ASPIRIN_2_CFLAGS) +$(TARGET).srcs += $(IMU_ASPIRIN_2_SRCS) +endif # # NPS simulator diff --git a/conf/firmwares/subsystems/shared/imu_mpu6000.makefile b/conf/firmwares/subsystems/shared/imu_mpu6000.makefile index 6d906a4a742..065636ac7dc 100644 --- a/conf/firmwares/subsystems/shared/imu_mpu6000.makefile +++ b/conf/firmwares/subsystems/shared/imu_mpu6000.makefile @@ -36,14 +36,12 @@ IMU_CFLAGS += -DUSE_$(IMU_MPU_SPI_DEV_UPPER) IMU_CFLAGS += -DIMU_MPU_SPI_SLAVE_IDX=$(IMU_MPU_SPI_SLAVE_IDX) IMU_CFLAGS += -DUSE_$(IMU_MPU_SPI_SLAVE_IDX) -ap.CFLAGS += $(IMU_CFLAGS) -ap.srcs += $(IMU_SRCS) -test_imu.CFLAGS += $(IMU_CFLAGS) -test_imu.srcs += $(IMU_SRCS) - -test_ahrs.CFLAGS += $(IMU_CFLAGS) -test_ahrs.srcs += $(IMU_SRCS) +# add it for all targets except sim, fbw and nps +ifeq (,$(findstring $(TARGET),sim fbw nps)) +$(TARGET).CFLAGS += $(IMU_CFLAGS) +$(TARGET).srcs += $(IMU_SRCS) +endif # # NPS simulator diff --git a/conf/firmwares/subsystems/shared/imu_mpu6000_hmc5883.makefile b/conf/firmwares/subsystems/shared/imu_mpu6000_hmc5883.makefile index bbde01098e1..d902f15fc3f 100644 --- a/conf/firmwares/subsystems/shared/imu_mpu6000_hmc5883.makefile +++ b/conf/firmwares/subsystems/shared/imu_mpu6000_hmc5883.makefile @@ -88,11 +88,12 @@ IMU_CFLAGS += -DUSE_$(IMU_MPU_SPI_DEV_UPPER) IMU_CFLAGS += -DIMU_MPU_SPI_SLAVE_IDX=$(IMU_MPU_SPI_SLAVE_IDX) IMU_CFLAGS += -DUSE_$(IMU_MPU_SPI_SLAVE_IDX) -ap.CFLAGS += $(IMU_CFLAGS) -ap.srcs += $(IMU_SRCS) -test_imu.CFLAGS += $(IMU_CFLAGS) -test_imu.srcs += $(IMU_SRCS) +# add it for all targets except sim, fbw and nps +ifeq (,$(findstring $(TARGET),sim fbw nps)) +$(TARGET).CFLAGS += $(IMU_CFLAGS) +$(TARGET).srcs += $(IMU_SRCS) +endif # # NPS simulator diff --git a/conf/firmwares/subsystems/shared/imu_mpu9250_i2c.makefile b/conf/firmwares/subsystems/shared/imu_mpu9250_i2c.makefile index e08d442631c..626d3f9d203 100644 --- a/conf/firmwares/subsystems/shared/imu_mpu9250_i2c.makefile +++ b/conf/firmwares/subsystems/shared/imu_mpu9250_i2c.makefile @@ -39,13 +39,11 @@ IMU_MPU9250_CFLAGS += -DIMU_MPU9250_I2C_DEV=$(MPU9250_I2C_DEV_LOWER) IMU_MPU9250_CFLAGS += -DUSE_$(MPU9250_I2C_DEV_UPPER) -# Keep CFLAGS/Srcs for imu in separate expression so we can assign it to other targets - -ap.CFLAGS += $(IMU_MPU9250_CFLAGS) -ap.srcs += $(IMU_MPU9250_SRCS) - -test_imu.CFLAGS += $(IMU_MPU9250_CFLAGS) -test_imu.srcs += $(IMU_MPU9250_SRCS) +# add it for all targets except sim, fbw and nps +ifeq (,$(findstring $(TARGET),sim fbw nps)) +$(TARGET).CFLAGS += $(IMU_MPU9250_CFLAGS) +$(TARGET).srcs += $(IMU_MPU9250_SRCS) +endif # diff --git a/conf/firmwares/subsystems/shared/imu_navgo.makefile b/conf/firmwares/subsystems/shared/imu_navgo.makefile index 3ab4757bfe5..0bd76349aa8 100644 --- a/conf/firmwares/subsystems/shared/imu_navgo.makefile +++ b/conf/firmwares/subsystems/shared/imu_navgo.makefile @@ -14,8 +14,11 @@ IMU_NAVGO_SRCS += peripherals/itg3200.c IMU_NAVGO_SRCS += peripherals/adxl345_i2c.c IMU_NAVGO_SRCS += peripherals/hmc58xx.c -ap.CFLAGS += $(IMU_NAVGO_CFLAGS) -ap.srcs += $(IMU_NAVGO_SRCS) +# add it for all targets except sim, fbw and nps +ifeq (,$(findstring $(TARGET),sim fbw nps)) +$(TARGET).CFLAGS += $(IMU_NAVGO_CFLAGS) +$(TARGET).srcs += $(IMU_NAVGO_SRCS) +endif # # Simulator diff --git a/conf/firmwares/subsystems/shared/imu_navstik.makefile b/conf/firmwares/subsystems/shared/imu_navstik.makefile index 861d20646a0..57353895e24 100644 --- a/conf/firmwares/subsystems/shared/imu_navstik.makefile +++ b/conf/firmwares/subsystems/shared/imu_navstik.makefile @@ -37,11 +37,12 @@ NAVSTIK_MPU_I2C_DEV_LOWER=$(shell echo $(NAVSTIK_MPU_I2C_DEV) | tr A-Z a-z) IMU_CFLAGS += -DNAVSTIK_MAG_I2C_DEV=$(NAVSTIK_MAG_I2C_DEV_LOWER) -DNAVSTIK_MPU_I2C_DEV=$(NAVSTIK_MPU_I2C_DEV_LOWER) IMU_CFLAGS += -DUSE_$(NAVSTIK_MAG_I2C_DEV_UPPER)=1 -DUSE_$(NAVSTIK_MPU_I2C_DEV_UPPER)=1 -ap.CFLAGS += $(IMU_CFLAGS) -ap.srcs += $(IMU_SRCS) -test_imu.CFLAGS += $(IMU_CFLAGS) -test_imu.srcs += $(IMU_SRCS) +# add it for all targets except sim, fbw and nps +ifeq (,$(findstring $(TARGET),sim fbw nps)) +$(TARGET).CFLAGS += $(IMU_CFLAGS) +$(TARGET).srcs += $(IMU_SRCS) +endif # # NPS simulator diff --git a/conf/firmwares/subsystems/shared/imu_ppzuav.makefile b/conf/firmwares/subsystems/shared/imu_ppzuav.makefile index 66b69c02e85..7778cd1caf6 100644 --- a/conf/firmwares/subsystems/shared/imu_ppzuav.makefile +++ b/conf/firmwares/subsystems/shared/imu_ppzuav.makefile @@ -18,8 +18,9 @@ else ifeq ($(ARCH), lpc21) IMU_PPZUAV_CFLAGS += -DIMU_PPZUAV_I2C_DEV=i2c0 endif -ap.CFLAGS += $(IMU_PPZUAV_CFLAGS) -ap.srcs += $(IMU_PPZUAV_SRCS) -test_imu.CFLAGS += $(IMU_PPZUAV_CFLAGS) -test_imu.srcs += $(IMU_PPZUAV_SRCS) +# add it for all targets except sim, fbw and nps +ifeq (,$(findstring $(TARGET),sim fbw nps)) +$(TARGET).CFLAGS += $(IMU_PPZUAV_CFLAGS) +$(TARGET).srcs += $(IMU_PPZUAV_SRCS) +endif diff --git a/conf/firmwares/subsystems/shared/imu_px4fmu_v1.7.makefile b/conf/firmwares/subsystems/shared/imu_px4fmu_v1.7.makefile index 61e3811eb80..0b7cfc4684f 100644 --- a/conf/firmwares/subsystems/shared/imu_px4fmu_v1.7.makefile +++ b/conf/firmwares/subsystems/shared/imu_px4fmu_v1.7.makefile @@ -57,13 +57,11 @@ IMU_PX4FMU_SRCS += peripherals/hmc58xx.c IMU_PX4FMU_CFLAGS += -DUSE_I2C2 -# Keep CFLAGS/Srcs for imu in separate expression so we can assign it to other targets - -ap.CFLAGS += $(IMU_PX4FMU_CFLAGS) -ap.srcs += $(IMU_PX4FMU_SRCS) - -test_imu.CFLAGS += $(IMU_PX4FMU_CFLAGS) -test_imu.srcs += $(IMU_PX4FMU_SRCS) +# add it for all targets except sim, fbw and nps +ifeq (,$(findstring $(TARGET),sim fbw nps)) +$(TARGET).CFLAGS += $(IMU_PX4FMU_CFLAGS) +$(TARGET).srcs += $(IMU_PX4FMU_SRCS) +endif # # NPS simulator diff --git a/conf/firmwares/subsystems/shared/imu_um6.makefile b/conf/firmwares/subsystems/shared/imu_um6.makefile index a5e9eb416e8..fdbd8e0ad79 100644 --- a/conf/firmwares/subsystems/shared/imu_um6.makefile +++ b/conf/firmwares/subsystems/shared/imu_um6.makefile @@ -17,5 +17,8 @@ IMU_UM6_SRCS += $(SRC_SUBSYSTEMS)/imu/imu_um6.c IMU_UM6_CFLAGS += -DUSE_$(UM6_PORT) -D$(UM6_PORT)_BAUD=$(UM6_BAUD) IMU_UM6_CFLAGS += -DUM6_LINK=$(UM6_PORT_LOWER) -ap.CFLAGS += $(IMU_UM6_CFLAGS) -ap.srcs += $(IMU_UM6_SRCS) +# add it for all targets except sim, fbw and nps +ifeq (,$(findstring $(TARGET),sim fbw nps)) +$(TARGET).CFLAGS += $(IMU_UM6_CFLAGS) +$(TARGET).srcs += $(IMU_UM6_SRCS) +endif diff --git a/conf/firmwares/subsystems/shared/imu_umarim.makefile b/conf/firmwares/subsystems/shared/imu_umarim.makefile index 84a27cc9c3c..5692804a348 100644 --- a/conf/firmwares/subsystems/shared/imu_umarim.makefile +++ b/conf/firmwares/subsystems/shared/imu_umarim.makefile @@ -13,8 +13,11 @@ IMU_UMARIM_CFLAGS += -DIMU_UMARIM_I2C_DEV=$(IMU_UMARIM_I2C_DEV) IMU_UMARIM_SRCS += peripherals/itg3200.c IMU_UMARIM_SRCS += peripherals/adxl345_i2c.c -ap.CFLAGS += $(IMU_UMARIM_CFLAGS) -ap.srcs += $(IMU_UMARIM_SRCS) +# add it for all targets except sim, fbw and nps +ifeq (,$(findstring $(TARGET),sim fbw nps)) +$(TARGET).CFLAGS += $(IMU_UMARIM_CFLAGS) +$(TARGET).srcs += $(IMU_UMARIM_SRCS) +endif # # Simulator diff --git a/conf/firmwares/subsystems/shared/imu_yai.makefile b/conf/firmwares/subsystems/shared/imu_yai.makefile index 1aec6d66a3a..1fc8004cacd 100644 --- a/conf/firmwares/subsystems/shared/imu_yai.makefile +++ b/conf/firmwares/subsystems/shared/imu_yai.makefile @@ -34,8 +34,8 @@ include $(CFG_SHARED)/imu_b2_common.makefile # No Magnetometer -ap.srcs += $(imu_srcs) -ap.CFLAGS += $(imu_CFLAGS) - -test_imu.srcs += $(imu_srcs) -test_imu.CFLAGS += $(imu_CFLAGS) +# add it for all targets except sim, fbw and nps +ifeq (,$(findstring $(TARGET),sim fbw nps)) +$(TARGET).CFLAGS += $(imu_CFLAGS) +$(TARGET).srcs += $(imu_SRCS) +endif