This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

How to link .lib file in make file?

libalgobsec.lib

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
PROJECT_NAME := ble_app_buttonless_dfu_pca10040_s132
TARGETS := nrf52832_xxaa
OUTPUT_DIRECTORY := _build
SDK_ROOT := ../../../../../..
PROJ_DIR := ../../..
$(OUTPUT_DIRECTORY)/nrf52832_xxaa.out: \
LINKER_SCRIPT := ble_app_buttonless_dfu_gcc_nrf52.ld
# Source files common to all targets
SRC_FILES += \
$(SDK_ROOT)/components/libraries/log/src/nrf_log_backend_serial.c \
$(SDK_ROOT)/components/libraries/log/src/nrf_log_frontend.c \
$(SDK_ROOT)/components/libraries/button/app_button.c \
$(SDK_ROOT)/components/libraries/util/app_error.c \
$(SDK_ROOT)/components/libraries/util/app_error_weak.c \
$(SDK_ROOT)/components/libraries/scheduler/app_scheduler.c \
$(SDK_ROOT)/components/libraries/timer/app_timer.c \
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Hello,

I am using sdk 12.2.2 and customised nrf52 board. I am using gcc makefile to compile my code. I want to add .lib file in my code so how should I add .lib file in my makefile?

I am attaching my makefile and .lib file that I want to add.

Thanks,