Page 1 of 1

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

Posted: Mon Nov 27, 2017 1:51 pm
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?

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

Posted: Wed Nov 29, 2017 6:19 pm
by infiniteimprobability
Does this work?

Code: Select all

ifeq ($(CONFIG),config1)
USED_MODULES += lib_awesome
endif

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

Posted: Thu Nov 30, 2017 9:51 am
by ffomich
Yes, it works.
Thank you!