From 833770a5f79c193336d53627b93d1fa34e6fa225 Mon Sep 17 00:00:00 2001 From: Petr Baudis Date: Thu, 15 Sep 2005 23:28:56 +0200 Subject: [PATCH] Implicit recursiveness and clean rule All objects defining $(OBJS) will get them and *.a deleted during make clean. The all, clean and install rules now implicitly imply their -recursive counterparts - those will just do nothing in case of $(SUBDIRS) not defined, so that's ok. --- Makefile | 6 +----- Makefile.config.in | 8 ++++++++ Makefile.lib | 9 +++++++++ src/cache/Makefile | 3 --- src/config/Makefile | 3 --- src/ecmascript/Makefile | 6 ++---- src/ecmascript/spidermonkey/Makefile | 3 --- src/formhist/Makefile | 3 --- src/globhist/Makefile | 3 --- src/session/Makefile | 3 --- 10 files changed, 20 insertions(+), 27 deletions(-) diff --git a/Makefile b/Makefile index 60de7457..164fbfd5 100644 --- a/Makefile +++ b/Makefile @@ -8,11 +8,7 @@ path_to_top = .. SUBDIRS = doc po src -all: all-recursive - -clean: clean-recursive +clean: rm -rf features.log -install: install-recursive - -include Makefile.lib diff --git a/Makefile.config.in b/Makefile.config.in index dbfe8f1c..3c7ec31d 100644 --- a/Makefile.config.in +++ b/Makefile.config.in @@ -103,3 +103,11 @@ LIBS = @LIBS@ INCLUDES = -I$(top_builddir) -I$(top_srcdir)/src COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CFLAGS) $(CFLAGS) + + +### This is here because Makefile.config is usually the first thing +### we get and sometimes the all rule can be implicit, yet we want +### it always as the default one. So this should make sure it always +### comes first. +all: + diff --git a/Makefile.lib b/Makefile.lib index 43ac340e..94a3d0af 100644 --- a/Makefile.lib +++ b/Makefile.lib @@ -58,6 +58,11 @@ endif %.a: $(call cmd,archive) +ifdef $(OBJS) +clean: + rm -f $(OBJS) *.a +endif + # Recursion: @@ -68,5 +73,9 @@ all-recursive install-recursive clean-recursive: $(call ncmd,recmake) || exit 1; \ done +all: all-recursive +install: install-recursive +clean: clean-recursive + # vim:syntax=make diff --git a/src/cache/Makefile b/src/cache/Makefile index 2c272a47..e70eebd0 100644 --- a/src/cache/Makefile +++ b/src/cache/Makefile @@ -5,7 +5,4 @@ OBJS = cache.o dialogs.o all: libcache.a libcache.a: $(OBJS) -clean: - rm -f *.o *.a - -include ../../Makefile.lib diff --git a/src/config/Makefile b/src/config/Makefile index 64aa297a..55c9d35b 100644 --- a/src/config/Makefile +++ b/src/config/Makefile @@ -5,7 +5,4 @@ OBJS = cmdline.o conf.o dialogs.o home.o kbdbind.o options.o opttypes.o timer.o all: libconfig.a libconfig.a: $(OBJS) -clean: - rm -f *.o *.a - -include ../../Makefile.lib diff --git a/src/ecmascript/Makefile b/src/ecmascript/Makefile index 378d7ab5..9e8e7600 100644 --- a/src/ecmascript/Makefile +++ b/src/ecmascript/Makefile @@ -2,13 +2,11 @@ INCLUDES += $(SPIDERMONKEY_CFLAGS) SUBDIRS = spidermonkey + SM_OBJS = document.o form.o location.o navigator.o unibar.o window.o OBJS = ecmascript.o spidermonkey.o $(foreach obj,$(SM_OBJS),spidermonkey/$(obj)) -all: all-recursive libecmascript.a +all: libecmascript.a libecmascript.a: $(OBJS) -clean: - rm -f *.o *.a - -include ../../Makefile.lib diff --git a/src/ecmascript/spidermonkey/Makefile b/src/ecmascript/spidermonkey/Makefile index eb16efdd..d337a7de 100644 --- a/src/ecmascript/spidermonkey/Makefile +++ b/src/ecmascript/spidermonkey/Makefile @@ -6,7 +6,4 @@ OBJS = document.o form.o location.o navigator.o unibar.o window.o all: $(OBJS) -clean: - rm -f *.o *.a - -include ../../../Makefile.lib diff --git a/src/formhist/Makefile b/src/formhist/Makefile index ec9b3069..280ab317 100644 --- a/src/formhist/Makefile +++ b/src/formhist/Makefile @@ -5,7 +5,4 @@ OBJS = formhist.o dialogs.o all: libformhist.a libformhist.a: $(OBJS) -clean: - rm -f *.o *.a - -include ../../Makefile.lib diff --git a/src/globhist/Makefile b/src/globhist/Makefile index baad9fae..1b208406 100644 --- a/src/globhist/Makefile +++ b/src/globhist/Makefile @@ -5,7 +5,4 @@ OBJS = globhist.o dialogs.o all: libglobhist.a libglobhist.a: $(OBJS) -clean: - rm -f *.o *.a - -include ../../Makefile.lib diff --git a/src/session/Makefile b/src/session/Makefile index 2893ce0f..3d06faf3 100644 --- a/src/session/Makefile +++ b/src/session/Makefile @@ -5,7 +5,4 @@ OBJS = download.o history.o location.o session.o task.o all: libsession.a libsession.a: $(OBJS) -clean: - rm -f *.o *.a - -include ../../Makefile.lib