summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile4
-rw-r--r--include/buildrules31
-rw-r--r--lib/Makefile4
-rw-r--r--ltp/Makefile2
-rw-r--r--src/Makefile2
-rw-r--r--src/aio-dio-regress/Makefile2
6 files changed, 33 insertions, 12 deletions
diff --git a/Makefile b/Makefile
index 574e9bd5..c504e19c 100644
--- a/Makefile
+++ b/Makefile
@@ -52,7 +52,7 @@ endif
endif
# tool/lib dependencies
-src ltp: lib
+$(TOOL_SUBDIRS): $(LIB_SUBDIRS)
ifeq ($(HAVE_BUILDDEFS), yes)
include $(BUILDRULES)
@@ -77,6 +77,8 @@ endif
aclocal.m4::
aclocal --acdir=`pwd`/m4 --output=$@
+depend: include/builddefs $(addsuffix -depend,$(SUBDIRS))
+
install: default $(addsuffix -install,$(SUBDIRS))
$(INSTALL) -m 755 -d $(PKG_LIB_DIR)
$(INSTALL) -m 755 check $(PKG_LIB_DIR)
diff --git a/include/buildrules b/include/buildrules
index d8ef6b1e..c8a7c474 100644
--- a/include/buildrules
+++ b/include/buildrules
@@ -6,13 +6,20 @@ _BUILDRULES_INCLUDED_ = 1
include $(TOPDIR)/include/builddefs
+depend: $(addsuffix -depend,$(SUBDIRS))
+
+%-depend:
+ $(Q)$(MAKE) $(MAKEOPTS) -q -C $* depend || \
+ $(MAKE) $(MAKEOPTS) -C $* depend
+
clean clobber : $(addsuffix -clean,$(SUBDIRS))
$(Q)rm -f $(DIRT)
$(Q)rm -fr .libs .ltdep .dep
%-clean:
@echo "Cleaning $*"
- $(Q)$(MAKE) $(MAKEOPTS) -q -C $* clean || $(MAKE) $(MAKEOPTS) -C $* clean
+ $(Q)$(MAKE) $(MAKEOPTS) -q -C $* clean || \
+ $(MAKE) $(MAKEOPTS) -C $* clean
# Never blow away subdirs
ifdef SUBDIRS
@@ -71,21 +78,25 @@ endif # _BUILDRULES_INCLUDED_
$(_FORCE):
# dependency build is automatic, relies on gcc -MM to generate.
-.PHONY : depend ltdepend
+.PHONY : depend
MAKEDEP := $(MAKEDEPEND) $(CFLAGS)
-ltdepend: .ltdep
-
.ltdep: $(CFILES) $(HFILES)
@echo " [LTDEP]"
- $(Q)[ -n "$(CFILES)" ] && \
- $(MAKEDEP) $(CFILES) | $(SED) -e 's,^\([^:]*\)\.o,\1.lo,' > .ltdep
-
-depend: .dep
+ $(Q)if [ -n "$$( echo $(CFILES))" ]; then \
+ $(MAKEDEP) $(CFILES) | \
+ $(SED) -e 's,^\([^:]*\)\.o,\1.lo,' > .ltdep; \
+ else \
+ cp /dev/null .ltdep; \
+ fi
.dep: $(CFILES) $(HFILES)
@echo " [DEP]"
- $(Q)[ -n "$(CFILES)" ] && \
- $(MAKEDEP) $(CFILES) | $(SED) -e 's,^\([^:]*\)\.o,\1,' > .dep
+ $(Q)if [ -n "$$( echo $(CFILES))" ]; then \
+ $(MAKEDEP) $(CFILES) | \
+ $(SED) -e 's,^\([^:]*\)\.o,\1,' > .dep; \
+ else \
+ cp /dev/null .dep; \
+ fi
diff --git a/lib/Makefile b/lib/Makefile
index 094167c8..c7348ce1 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -19,10 +19,12 @@ CFILES = dataascii.c databin.c datapid.c file_lock.c forker.c \
str_to_bytes.c tlibio.c write_log.c \
random.c
-default: ltdepend $(LTLIBRARY)
+default: depend $(LTLIBRARY)
include $(BUILDRULES)
+depend: .ltdep
+
install install-dev: default
-include .ltdep
diff --git a/ltp/Makefile b/ltp/Makefile
index f3899e1c..32cd380d 100644
--- a/ltp/Makefile
+++ b/ltp/Makefile
@@ -33,6 +33,8 @@ endif
default: depend $(TARGETS)
+depend: .dep
+
include $(BUILDRULES)
$(TARGETS): $(LIBTEST)
diff --git a/src/Makefile b/src/Makefile
index 3d35e260..1162ee08 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -61,6 +61,8 @@ LDIRT = $(TARGETS)
default: depend $(TARGETS) $(SUBDIRS)
+depend: .dep
+
include $(BUILDRULES)
$(TARGETS): $(LIBTEST)
diff --git a/src/aio-dio-regress/Makefile b/src/aio-dio-regress/Makefile
index 3f9d1c26..79dd55d8 100644
--- a/src/aio-dio-regress/Makefile
+++ b/src/aio-dio-regress/Makefile
@@ -10,6 +10,8 @@ LLDLIBS = -laio -lpthread
default: depend $(TARGETS)
+depend: .dep
+
include $(BUILDRULES)
$(TARGETS):