Datasheet
152 PSoC Designer IDE Guide, Document # 001-42655 Rev *B
B.4.3 Add External Files to the Project
This is a trick for local.mk to have a ‘custom’ rule to build/add files outside of the project folder.
# CSRCS is used by makedepends to get the external headers/dependencies
CSRCS:=$(CSRCS) ../common/foo.c
OBJECT_SOURCES:=$(OBJECT_SOURCES) foo.c
# new rule to tell MAKE to get C files from ../common
# DON'T have files in COMMON with the same name as this project's Source
# Files because we won't know which file MAKE will build last.
obj/%.o : ../common/%.c
ifeq ($(ECHO_COMMANDS),novice)
echo $(call correct_path,$<)
endif
$(CCMD) $(CFLAGS) $(CDEFINES) $(INCLUDEFLAGS) $(DEFAULTCFLAGS) -o $@
$(call correct_path,$<)
B.4.4 Change Link Order
# The CSRCS and ASMSRCS lists are found in project.mk.
# project.mk is generated by psocmakemake.exe and reflects
# the project settings (e.g. files, linker options, part family)
# Alter the filter patterns to change the
# link order.
C_MY_SORT=$(filter s%.c, $(CSRCS))
C_MY_SORT+=$(filter m%.c, $(CSRCS))
C_THE_REST= $(filter-out $(C_MY_SORT), $(CSRCS))
C_ORDER =$(C_MY_SORT) $(C_THE_REST)
ASM_MY_SORT=$(filter j%.asm, $(ASMSRCS))
ASM_MY_SORT+=$(filter h%.asm, $(ASMSRCS))
ASM_THE_REST=$(filter-out $(ASM_MY_SORT), $(ASMSRCS))
ASM_ORDER=$(ASM_MY_SORT) $(ASM_THE_REST)
OBJECT_SOURCES=$(C_ORDER) $(ASM_ORDER)
# Note: Changes/edits to this file will not re-link
# the project since this file is not a prerequisite
# condition for the Link 'target'.