Skip to content

Commit

Permalink
Makefile: add capsense library in linked libraries
Browse files Browse the repository at this point in the history
  • Loading branch information
Clément Léger committed Apr 13, 2016
1 parent b84a191 commit a23f562
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions make/Makefile.cypress
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,14 @@ PSOC_CREATOR_DIR ?= $(error PSOC_CREATOR_DIR must be defined)
CROSS_COMPILE := arm-none-eabi-
CPU_TYPE ?= CY8C49

RELEASE_TYPE ?= Debug

# Special dir from cypress tools
CYCOMPONENT_LIB := $(PSOC_CREATOR_DIR)/psoc/content/CyComponentLibrary/CyComponentLibrary.cylib/$($(CPU_TYPE)_cpu_dir)/ARM_GCC_493/Debug/CyComponentLibrary.a
CYCOMPONENT_LIB_DIR := $(PSOC_CREATOR_DIR)/psoc/content/CyComponentLibrary/CyComponentLibrary.cylib/

CAPSENSE_LIB := $(CYCOMPONENT_LIB_DIR)/CapSense_CSD_P4_v2_30/$($(CPU_TYPE)_psoc_type)/Library/CapsenseP4Library_GCC.a
CYCOMPONENT_LIB := $(CYCOMPONENT_LIB_DIR)/$($(CPU_TYPE)_cpu_dir)/ARM_GCC_493/$(RELEASE_TYPE)/CyComponentLibrary.a
CYPRESS_LIBS := "$(CAPSENSE_LIB)" "$(CYCOMPONENT_LIB)"
CYELFTOOL := $(PSOC_CREATOR_DIR)/bin/cyelftool.exe

BUILD_DIR ?= ./build
Expand All @@ -31,8 +37,6 @@ LFLAGS := -Wl,--gc-sections -Wl,-Map,$(BUILD_DIR)/$(PROJECT_NAME).map -L$(BUILD
ASFLAGS := $(COMMON_FLAGS)
INCLUDE_CFLAGS := -I$(PROJECT_DIR)/$(GEN_SRC_DIR) -I$(PROJECT_DIR)/



SRC_C_FILES := $(wildcard $(PROJECT_DIR)/$(GEN_SRC_DIR)/*.c $(PROJECT_DIR)/*.c)
BOOTASM_GNU := $(PROJECT_DIR)/$(GEN_SRC_DIR)/CyBootAsmGnu.s

Expand All @@ -55,7 +59,7 @@ $(BUILD_DIR)/$(PROJECT_NAME).a: $(OBJ_FILES)

$(BUILD_DIR)/$(PROJECT_NAME).elf: $(BUILD_DIR)/$(PROJECT_NAME).a
@mkdir -p $(dir $@)
$(CROSS_COMPILE)gcc -specs=nano.specs $(CFLAGS) -o $@ -Wl,--start-group $^ "$(CYCOMPONENT_LIB)" -Wl,--end-group $(LFLAGS)
$(CROSS_COMPILE)gcc -specs=nano.specs $(CFLAGS) -o $@ -Wl,--start-group $^ $(CYPRESS_LIBS) -Wl,--end-group $(LFLAGS)
wine "$(CYELFTOOL)" -B $@ --flash_row_size $($(CPU_TYPE)_flash_row_size) --flash_size $($(CPU_TYPE)_flash_size) --flash_array_size $($(CPU_TYPE)_flash_array_size)
wine "$(CYELFTOOL)" -S $@

Expand Down

0 comments on commit a23f562

Please sign in to comment.