Makefile: add dependency on brlib file

This commit is contained in:
2024-08-08 08:40:42 +02:00
parent f7a6e582ed
commit 7ae6604e10

View File

@@ -39,7 +39,9 @@ OBJ := $(addprefix $(OBJDIR)/,$(SRC_FN:.c=.o))
TSTSRC := $(wildcard $(TSTDIR)/*.c) TSTSRC := $(wildcard $(TSTDIR)/*.c)
LIB := br_$(shell uname -m) # library name LIB := br_$(shell uname -m) # library name
LIBS := $(strip -l$(LIB)) LIB := $(strip $(LIB))
LIBFILE := ${BRLIBDIR}/lib$(strip ${LIB}).a
LIBS := $(addprefix -l,$(strip $(LIB)))
DEP_FN := $(SRC_FN) DEP_FN := $(SRC_FN)
DEP := $(addprefix $(DEPDIR)/,$(DEP_FN:.c=.d)) DEP := $(addprefix $(DEPDIR)/,$(DEP_FN:.c=.d))
@@ -344,6 +346,7 @@ brlib:
$(info calling with build=$(build)) $(info calling with build=$(build))
$(MAKE) -e -C $(BRLIB) lib-static $(MAKE) -e -C $(BRLIB) lib-static
unexport build unexport build
##################################### brchess binaries ##################################### brchess binaries
.PHONY: targets cleanbin cleanbindir .PHONY: targets cleanbin cleanbindir
@@ -355,9 +358,9 @@ cleanbin:
cleanbindir: cleanbindir:
$(call rmdir,$(BINDIR),binaries) $(call rmdir,$(BINDIR),binaries)
$(TARGET): libs $(OBJ) | $(BINDIR) $(TARGET): $(LIBFILE) $(OBJ) | $(BINDIR) libs
@echo linking $@. @echo linking $@.
$(CC) $(LDFLAGS) $(OBJ) $(LIBS) -o $@ $(CC) $(ALL_LDFLAGS) $(OBJ) -o $@
##################################### pre-processed (.i) and assembler (.s) output ##################################### pre-processed (.i) and assembler (.s) output
.PHONY: cleanasmcpp .PHONY: cleanasmcpp
@@ -490,6 +493,7 @@ wtf:
@#echo LIBSRC=$(LIBSRC) @#echo LIBSRC=$(LIBSRC)
zob: zob:
echo $(LIBFILE)
@#$(CC) $(LDFLAGS) $(CPPFLAGS) $(CFLAGS) $< $(LIBS) src/util.c -o util @#$(CC) $(LDFLAGS) $(CPPFLAGS) $(CFLAGS) $< $(LIBS) src/util.c -o util
##################################### End of multi-targets ##################################### End of multi-targets