From 94237354ddbf2abc0f04e7f06ee3c1263dfc6b6e Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Sat, 15 Dec 2018 01:55:11 +0100 Subject: makefiles: correcting login of makefile Fixing some ordering issue with inclusion of common make.tmpl. Correcting dependency calculation Simplifying inclusive makefile --- base/Makefile | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) (limited to 'base') diff --git a/base/Makefile b/base/Makefile index 6050c3a2a..9f8bccca6 100644 --- a/base/Makefile +++ b/base/Makefile @@ -14,7 +14,7 @@ # Comment to build the advanced radix tree. #base/data-struct/radix-tree.o: CFLAGS += -DSIMPLE_RADIX_TREE -# NOTE: this include only works as 'include' for toplevel Makefile +# NOTE: this Makefile only works as 'include' for toplevel Makefile # which defined all top_* variables BASE_SOURCE=\ @@ -22,24 +22,19 @@ BASE_SOURCE=\ base/data-struct/list.c \ base/data-struct/radix-tree.c +BASE_TARGET = base/libbase.a BASE_DEPENDS = $(BASE_SOURCE:%.c=%.d) BASE_OBJECTS = $(BASE_SOURCE:%.c=%.o) CLEAN_TARGETS += $(BASE_DEPENDS) $(BASE_OBJECTS) \ $(BASE_SOURCE:%.c=%.gcda) \ - $(BASE_SOURCE:%.c=%.gcno) + $(BASE_SOURCE:%.c=%.gcno) \ + $(BASE_TARGET) -ifeq ("$(USE_TRACKING)","yes") -ifeq (,$(findstring $(MAKECMDGOALS),cscope.out cflow clean distclean lcov lcov-reset \ - help check check_local check_cluster check_lvmetad check_lvmpolld)) - -include $(BASE_DEPENDS) -endif -endif - -$(BASE_OBJECTS): INCLUDES+=-I$(top_srcdir)/base/ - -base/libbase.a: $(BASE_OBJECTS) +$(BASE_TARGET): $(BASE_OBJECTS) @echo " [AR] $@" $(Q) $(RM) $@ $(Q) $(AR) rsv $@ $(BASE_OBJECTS) > /dev/null -CLEAN_TARGETS += base/libbase.a +ifeq ("$(DEPENDS)","yes") +-include $(BASE_DEPENDS) +endif -- cgit v1.2.1