From: Nathael Pajani Date: Wed, 15 Feb 2023 00:07:51 +0000 (+0100) Subject: Modify main Makefile to allow easy "per project" libs shared among apps of a single... X-Git-Url: http://git.techno-innov.fr/?a=commitdiff_plain;h=6562bf28c8038684ab1f45bab80d1ff3fb0df959;p=soft%2Flpc122x%2Fcore Modify main Makefile to allow easy "per project" libs shared among apps of a single project. --- diff --git a/Makefile b/Makefile index f81bb81..843a48a 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,7 @@ # Makefile for LPC122x micro-controller based boards TARGET_DIR = apps/$(MODULE)/$(NAME) +TARGET_LIB = apps/$(MODULE)/$(NAME)/lib # If you use another of the LPC122x micro-controllers, copy the lpc_link_lpc1224.ld file # to match you LPC micro-controller model and modify the memory sizes definitions at the @@ -25,7 +26,7 @@ LDFLAGS = -static $(LD_DEBUG) -nostartfiles -nostdlib -Tlpc_link_$(LPC).ld \ -Wl,-Map=$(TARGET_DIR)/lpc_map_$(LPC).map -APPS = $(subst apps/,,$(wildcard apps/*/[!host]*/)) +APPS = $(subst apps/,,$(wildcard apps/*/[!host,!lib]*/)) .PHONY: all $(APPS) all: $(APPS) @@ -46,8 +47,8 @@ A_SRC += $(wildcard lib/protocols/*/*.s) OBJS = ${C_SRC:%.c=${OBJDIR}/%.o} ${A_SRC:%.s=${OBJDIR}/%.o} DEPS = ${OBJS:%.o=$(OBJDIR)/%.d} -NAME_SRC = $(wildcard $(TARGET_DIR)/*.c) -NAME_A_SRC = $(wildcard $(TARGET_DIR)/*.s) +NAME_SRC = $(wildcard $(TARGET_DIR)/*.c) $(wildcard $(TARGET_LIB)/*.c) +NAME_A_SRC = $(wildcard $(TARGET_DIR)/*.s) $(wildcard $(TARGET_LIB)/*.s) NAME_OBJS = ${NAME_SRC:%.c=${OBJDIR}/%.o} ${NAME_A_SRC:%.s=${OBJDIR}/%.o} NAME_DEPS = ${NAME_OBJS:%.o=$(OBJDIR)/%.d}