Makefile: delegate some brlib targets to submodule Makefile
This commit is contained in:
51
Makefile
51
Makefile
@@ -85,11 +85,13 @@ DEPFLAGS = -MMD -MP -MF $(DEPDIR)/$*.d
|
|||||||
|
|
||||||
all: $(TARGET)
|
all: $(TARGET)
|
||||||
|
|
||||||
compile: libobjs objs
|
compile: brlib objs
|
||||||
|
|
||||||
clean: cleandep cleanobj cleanlib cleanlibobj cleanbin
|
libs: brlib
|
||||||
|
|
||||||
cleanall: clean cleandepdir cleanobjdir cleanlibdir cleanlibobjdir cleanbindir
|
clean: cleandep cleanobj cleanbrlib cleanbin
|
||||||
|
|
||||||
|
cleanall: clean cleandepdir cleanobjdir cleanallbrlib cleanbindir
|
||||||
|
|
||||||
##################################### cleaning functions
|
##################################### cleaning functions
|
||||||
# rmfiles - deletes a list of files in a directory if they exist.
|
# rmfiles - deletes a list of files in a directory if they exist.
|
||||||
@@ -174,43 +176,18 @@ $(OBJDIR)/%.o: $(SRCDIR)/%.c | $(OBJDIR) $(DEPDIR)
|
|||||||
@echo compiling brchess $< "->" $@.
|
@echo compiling brchess $< "->" $@.
|
||||||
@$(CC) -c $(DEPFLAGS) $(CPPFLAGS) $(CFLAGS) $< -o $@
|
@$(CC) -c $(DEPFLAGS) $(CPPFLAGS) $(CFLAGS) $< -o $@
|
||||||
|
|
||||||
##################################### brlib objects
|
|
||||||
.PHONY: libobjs cleanlibobj cleanlibobjdir
|
|
||||||
|
|
||||||
libobjs: $(LIBOBJ)
|
|
||||||
|
|
||||||
cleanlibobj:
|
|
||||||
$(call rmfiles,$(LIBOBJ),brlib object)
|
|
||||||
|
|
||||||
cleanlibobjdir:
|
|
||||||
$(call rmdir,$(LIBOBJDIR),brlib objects)
|
|
||||||
|
|
||||||
$(LIBOBJDIR)/%.o: $(LIBSRCDIR)/%.c | $(LIBOBJDIR) $(DEPDIR)
|
|
||||||
@echo compiling library $< "->" $@.
|
|
||||||
$(CC) -c $(DEPFLAGS) $(CPPFLAGS) $(CFLAGS) $< -o $@
|
|
||||||
|
|
||||||
##################################### brlib libraries
|
##################################### brlib libraries
|
||||||
.PHONY: libs cleanlib cleanlibdir
|
.PHONY: cleanbrlib cleanallbrlib libs brlib
|
||||||
|
|
||||||
cleanlib:
|
cleanbrlib:
|
||||||
$(call rmfiles,$(DLIB) $(SLIB),library)
|
$(MAKE) -C $(BRLIB) clean
|
||||||
|
@#$(call rmfiles,$(DLIB) $(SLIB),library)
|
||||||
|
|
||||||
cleanlibdir:
|
cleanallbrlib:
|
||||||
$(call rmdir,$(LIBDIR),libraries)
|
$(MAKE) -C $(BRLIB) cleanall
|
||||||
|
|
||||||
# libs: $(DLIB) $(SLIB)
|
brlib: libs
|
||||||
libs:
|
$(MAKE) -C $(BRLIB) libs
|
||||||
$(MAKE) -C $(BRLIB)
|
|
||||||
|
|
||||||
#$(DLIB): CFLAGS += -fPIC
|
|
||||||
#$(DLIB): LDFLAGS += -shared
|
|
||||||
#$(DLIB): $(LIBOBJ) | $(LIBDIR)
|
|
||||||
# @echo building $@ shared library.
|
|
||||||
# @$(CC) $(CFLAGS) $(LDFLAGS) $^ -o $@
|
|
||||||
#
|
|
||||||
#$(SLIB): $(LIBOBJ) | $(LIBDIR)
|
|
||||||
# @echo building $@ static library.
|
|
||||||
# $(AR) $(ARFLAGS) $@ $^
|
|
||||||
|
|
||||||
##################################### brchess binaries
|
##################################### brchess binaries
|
||||||
.PHONY: targets cleanbin cleanbindir
|
.PHONY: targets cleanbin cleanbindir
|
||||||
@@ -252,7 +229,7 @@ $(CCLSROOT):
|
|||||||
# also, if cclsfile is newer than sources, no need to clean objects file
|
# also, if cclsfile is newer than sources, no need to clean objects file
|
||||||
# (and to run bear).
|
# (and to run bear).
|
||||||
# maybe run cleanobj cleanlibobj in commands ?
|
# maybe run cleanobj cleanlibobj in commands ?
|
||||||
$(CCLSFILE): cleanobj cleanlibobj $(SRC) $(LIBSRC) | $(CCLSROOT)
|
$(CCLSFILE): cleanobj cleanbrlib $(SRC) $(LIBSRC) | $(CCLSROOT)
|
||||||
@echo "Generating ccls compile commands file ($@)."
|
@echo "Generating ccls compile commands file ($@)."
|
||||||
@$(BEAR) -- make compile
|
@$(BEAR) -- make compile
|
||||||
|
|
||||||
|
2
brlib
2
brlib
Submodule brlib updated: e55ac95301...635e4c8d9e
Reference in New Issue
Block a user