diff options
author | Roland McGrath <roland@gnu.org> | 1999-10-01 17:33:22 +0000 |
---|---|---|
committer | Roland McGrath <roland@gnu.org> | 1999-10-01 17:33:22 +0000 |
commit | d02092dc5aabffed51ca5feea9b2d90c936bc3f2 (patch) | |
tree | a31e2bbce85aa74c4c6d8effc9d69f87c74acdc9 | |
parent | 09656877af9f4ed8be8e480edf4b746b4436276d (diff) |
1999-10-01 Roland McGrath <roland@baalperazim.frob.com>
* Makeconf [Decode makemode page]: Clean up variable usage in each
cases, as follows:
(installationdir): Don't test and set this directly.
(makemode-instdir): New variable, set instead for each makemode.
(linktarg): Don't this for each program-linking makemode.
(targets): Make sure this is always set, i.e. = $(target) in singular
modes.
[$(makemode) != library] (progtarg): New variable.
[$(makemode) != library] (linktarg): Set from $(progtarg), including
.static versions.
(installationdir): Test and default once, using $(makemode-instdir).
[linking and dep rules]: Use $(linktarg) and $(progtarg) as
appropriate instead of $(targets) or $(target).
-rw-r--r-- | Makeconf | 92 |
1 files changed, 47 insertions, 45 deletions
@@ -90,76 +90,87 @@ MKINSTALLDIRS = $(top_srcdir)/mkinstalldirs -# Decode makemode: - +# Decode makemode. +# After this section, $(targets) and $(progtarg) will be defined, +# and everything else should use only those and not $(target). +# targets will have all the (one or more) targets that should be installed; +# progtarg will have all the (one or more) programs that should be linked; +# linktarg will have the complete set of linked targets, including both +# .static versions of $(progtarg) and/or shared library object targets. ifeq ($(makemode),server) doinst := one - installationdir := $(hurddir) + makemode-instdir := hurd clean := yes - linktarg := $(target) + targets = $(target) + progtarg = $(targets) endif ifeq ($(makemode),utility) doinst := one - ifndef installationdir - installationdir := $(bindir) - endif + makemode-instdir := bin clean := yes - linktarg := $(target) + targets = $(target) endif ifeq ($(makemode),servers) doinst := many - installationdir := $(hurddir) + makemode-instdir := hurd clean := yes - linktarg := $(targets) + progtarg := $(targets) endif ifeq ($(makemode),utilities) doinst := many - ifndef installationdir - installationdir := $(bindir) - endif + makemode-instdir := bin clean := yes - linktarg := $(targets) + progtarg := $(targets) endif ifeq ($(makemode),library) + linktarg := $(libname).so.$(hurd-version) + clean := yes - cleantarg := $(libname).a $(libname)_p.a $(libname).so $(libname)_pic.a $(linktarg) + cleantarg := $(linktarg) $(addprefix $(libname),.a _p.a _pic.a .so) + + targets := $(libname).a $(libname).so + ifneq ($(no_pic),t) + targets += $(libname)_pic.a + endif + ifneq ($(no_prof),t) + targets += $(libname)_p.a + endif + ifndef installhdrsubdir installhdrsubdir = hurd endif - ifeq ($(no_pic),t) - ifeq ($(no_prof),t) - targets := $(libname).a $(libname).so - else - targets := $(libname).a $(libname).so $(libname)_p.a - endif - else - ifeq ($(no_prof),t) - targets := $(libname).a $(libname).so $(libname)_pic.a - else - targets := $(libname).a $(libname).so $(libname)_pic.a $(libname)_p.a - endif - endif + else - linktarg := $(linktarg) $(linktarg:=.static) + + progtarg := $(filter-out $(special-targets),$(targets)) + linktarg := $(progtarg) $(progtarg:=.static) + endif ifeq ($(makemode),misc) ifndef doinst doinst := many endif + ifeq ($(doinst),one) + targets = $(target) + endif ifndef installationdir - ifneq (,$(target)$(targets)) + ifneq (,$(targets)) ?Error subdir Makefile must define installationdir endif endif endif +ifndef installationdir +installationdir := $($(makemode-instdir)dir) +endif + ifeq ($(cleantarg),) cleantarg := $(linktarg) endif @@ -189,9 +200,6 @@ endif ifneq ($(makemode),library) # not library -ifndef targets -targets = $(target) -endif installable := $(sort $(linktarg) $(targets)) install-targets := $(targets) $(filter $(build-static:=.static),$(linktarg)) all: $(install-targets) @@ -250,14 +258,10 @@ $(installationdirlist): %: @$(MKINSTALLDIRS) $@ # Building the target -ifeq ($(doinst),many) - target = $(filter-out $(special-targets),$(targets)) -endif - ifneq ($(makemode),misc) ifeq ($(doinst),one) -$(target) $(target).static: $(OBJS) $(OTHERLIBS) $(library_deps) +$(linktarg): $(OBJS) $(OTHERLIBS) $(library_deps) endif # Determine which sort of library we should link against from whether -static @@ -285,21 +289,21 @@ $(CC) $(rpath) $(CFLAGS) $($*-CFLAGS) $(LDFLAGS) $($*-LDFLAGS) \ $(BUGADDR_REF) \ -o $@ endef -$(target): %$(target-suffix): $(BUGADDR) +$(progtarg): %$(target-suffix): $(BUGADDR) $(link-executable) \ $(filter %.o,$^) \ '-Wl,-(' $(foreach lib,$(filter-out %.o,$^),${_libsubst}) \ $($*-LDLIBS) $(LDLIBS) \ '-Wl,-)' -$(addsuffix .static,$(target)): %$(target-suffix).static: $(BUGADDR) +$(addsuffix .static,$(progtarg)): %$(target-suffix).static: $(BUGADDR) $(link-executable) -static \ '-Wl,-(' $(patsubst %.so,%.a,$^) $($*-LDLIBS) $(LDLIBS) \ '-Wl,-)' endif # Just like above, but tell how to make .prof versions of programs. -$(addsuffix .prof,$(target)): %$(target-suffix).prof: $(BUGADDR) +$(addsuffix .prof,$(progtarg)): %$(target-suffix).prof: $(BUGADDR) $(CC) -pg $(CFLAGS) $($*-CFLAGS) $(LDFLAGS) $($*-LDFLAGS) \ $(BUGADDR_REF) -static \ -o $@ \ @@ -500,11 +504,9 @@ ifneq ($(no_deps),t) -include $(subst Server.o,.migsh_d,$(filter %Server.o,$(OBJS))) /dev/null -include $(subst User.o,.miguh_d,$(filter %User.o,$(OBJS))) /dev/null -ifneq ($(makemode),library) ifneq ($(prof-depend),t) ifneq ($(no_prof),t) --include $(addsuffix .prof_d,$(target)) /dev/null -endif +-include $(addsuffix .prof_d,$(progtarg)) /dev/null endif endif @@ -538,7 +540,7 @@ endif $(MAKE) $* prof-depend=t ifeq ($(prof-depend),t) -$(target): %: FORCE +$(progtarg): %: FORCE rm -f $@.prof_d echo $@.prof: $(subst .so,_p.a,$(subst .o,_p.o,$(filter-out FORCE,$+))) > $@.prof_d endif |