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

Technical questions regarding the xTIMEcomposer, xSOFTip Explorer and Programming with XMOS.
ffomich
Experienced Member
Posts: 105
Joined: Mon Sep 15, 2014 1:32 pm

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

Postby ffomich » Mon Nov 27, 2017 1:51 pm

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 Expert
Posts: 1018
Joined: Thu May 27, 2010 10:08 am

Postby infiniteimprobability » Wed Nov 29, 2017 6:19 pm

Does this work?

Code: Select all

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

Postby ffomich » Thu Nov 30, 2017 9:51 am

Yes, it works.
Thank you!

Who is online

Users browsing this forum: Bogdanqqc, Bogdanrsd, Bogdanvin and 12 guests