Makefile. How to add library only for the one build config? Topic is solved

Technical questions regarding the XTC tools and programming with XMOS.
Post Reply
ffomich
Experienced Member
Posts: 119
Joined: Mon Sep 15, 2014 1:32 pm

Makefile. How to add library only for the one build config?

Post by ffomich »

Hi,

my Makefile contains many build configurations:

Code: Select all

TARGET = my_board
APP_NAME = my_app

BUILD_FLAGS = -DFLASH_MAX_UPGRADE_SIZE=64*1024 -fcomment-asm -Xmapper --map -Xmapper MAPFILE -Wall -O3 -report -lquadflash -fsubword-select -save-temps -g -fxscope -DXSCOPE -DXUD_SERIES_SUPPORT=4 -march=xs2a -DUSB_TILE=tile[1] -DADAT_TX_USE_SHARED_BUFF=1 -DQUAD_SPI_FLASH=1 // General flags for all build configurations

XCC_FLAGS_config1 = $(BUILD_FLAGS) some defines
INCLUDE_ONLY_IN_config1 =

XCC_FLAGS_config2 = $(BUILD_FLAGS) some defines
INCLUDE_ONLY_IN_config2 =

USED_MODULES = module_dfu lib_i2c module_spdif_rx module_spdif_tx module_usb_audio module_usb_device module_usb_shared module_xud lib_otpinfo

config2 needs additional library.
Is it possible to build additional library only for config2?


View Solution
User avatar
infiniteimprobability
XCore Legend
Posts: 1126
Joined: Thu May 27, 2010 10:08 am
Contact:

Post by infiniteimprobability »

Does this work?

Code: Select all

ifeq ($(CONFIG),config1)
USED_MODULES += lib_awesome
endif
ffomich
Experienced Member
Posts: 119
Joined: Mon Sep 15, 2014 1:32 pm

Post by ffomich »

Yes, it works.
Thank you!
Post Reply