From: Garrett C. <yab...@us...> - 2009-11-30 08:36:50
|
Update of /cvsroot/ltp/ltp/include/mk In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv14118/include/mk Modified Files: env_pre.mk functions.mk Log Message: env_pre.mk: Check in, at bare minimum, the needed pieces to point people in the right direction as far as the make 3.81 requirement is concerned. functions.mk: Add some make 3.80 compatibility functions. Makefile: Remove make 3.81-ism's. Signed-off-by: Garrett Cooper <yan...@gm...> Index: env_pre.mk =================================================================== RCS file: /cvsroot/ltp/ltp/include/mk/env_pre.mk,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** env_pre.mk 11 Oct 2009 02:33:10 -0000 1.4 --- env_pre.mk 30 Nov 2009 08:36:42 -0000 1.5 *************** *** 28,36 **** --- 28,59 ---- ENV_PRE_LOADED = 1 + ifndef MAKE_VERSION_CHECK + export MAKE_VERSION_CHECK = 1 + ifneq ($(MAKE_VERSION),3.81) + $(error Only make 3.81 is supported at this time. Please read the Requirements section in INSTALL) + endif + # XXX (garrcoop): Junk for later... + #ifneq ($(firstword $(sort 3.80 $(MAKE_VERSION))),3.80) + #$(error Your version of make $(MAKE_VERSION) is too old. Upgrade to at least 3.80 (3.81+ preferred)) + #else + #ifeq ($(MAKE_VERSION),3.80) + #$(warning make 3.80 is not currently supported in LTP) + #$(error I apologize for the inconvenience, but I am working on it as quickly as I can! -Garrett) + #export MAKE_3_80_COMPAT := 1 + #endif # make 3.80? + #endif # At least make 3.80? + endif # MAKE_VERSION_CHECK + # Get the absolute path for the source directory. top_srcdir ?= $(error You must define top_srcdir before including this file) + include $(top_srcdir)/include/mk/functions.mk + # Where's the root source directory? + ifdef MAKE_3_80_COMPAT + abs_top_srcdir := $(call MAKE_3_80_abspath,$(top_srcdir)) + else abs_top_srcdir := $(abspath $(top_srcdir)) + endif # *************** *** 43,47 **** --- 66,74 ---- # We need the absolute path... + ifdef MAKE_3_80_COMPAT + abs_top_builddir := $(call MAKE_3_80_abspath,$(top_builddir)) + else abs_top_builddir := $(abspath $(top_builddir)) + endif # Where's the root object directory? *************** *** 50,60 **** abs_builddir := $(CURDIR) # Where's the source located at? Squish all of the / away by using abspath... ! abs_srcdir := $(abspath $(abs_top_srcdir)/$(subst $(abs_top_builddir),,$(abs_builddir))) ! srcdir := $(or $(subst $(abs_top_srcdir)/,,$(abs_srcdir)),.) ifneq ($(abs_builddir),$(abs_srcdir)) ! export OUT_OF_BUILD_TREE := 1 endif --- 77,97 ---- abs_builddir := $(CURDIR) + cwd_rel_from_top := $(subst $(abs_top_builddir),,$(abs_builddir)) + # Where's the source located at? Squish all of the / away by using abspath... ! ifdef MAKE_3_80_COMPAT ! abs_srcdir := $(call MAKE_3_80_abspath,$(abs_top_srcdir)/$(cwd_rel_from_top)) ! else ! abs_srcdir := $(abspath $(abs_top_srcdir)/$(cwd_rel_from_top)) ! endif ! srcdir := $(strip $(subst $(abs_top_srcdir)/,,$(abs_srcdir))) ! ! ifeq ($(srcdir),) ! srcdir := . ! endif ifneq ($(abs_builddir),$(abs_srcdir)) ! OUT_OF_BUILD_TREE := 1 endif Index: functions.mk =================================================================== RCS file: /cvsroot/ltp/ltp/include/mk/functions.mk,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** functions.mk 11 Oct 2009 01:01:24 -0000 1.3 --- functions.mk 30 Nov 2009 08:36:42 -0000 1.4 *************** *** 21,24 **** --- 21,30 ---- # + SQUOTE := ' + + # ' # to keep colorized editors from going nuts + + MAKE_3_80_abspath = $(shell readlink -f '$(subst $(SQUOTE),\\$(SQUOTE),$(1))') + # # Generate the directory install dependency separate from generate_install_rule *************** *** 31,38 **** # define generate_install_rule_dir_dep ! ! $$(abspath $(DESTDIR)/$(1)/$(2)): mkdir -p "$$@" - endef --- 37,47 ---- # define generate_install_rule_dir_dep ! ifdef MAKE_3_80_COMPAT ! DIR := $$(call MAKE_3_80_abspath,$(DESTDIR)/$(1)/$(2)) ! else ! DIR := $$(abspath $(DESTDIR)/$(1)/$(2)) ! endif ! $$(DIR): mkdir -p "$$@" endef *************** *** 51,57 **** # env_post.mk. I can revisit this `enhancement' later. #CLEAN_TARGETS += $$(INSTALL_FILE) INSTALL_FILES += $$(abspath $(DESTDIR)/$(3)/$(1)) ! $$(abspath $(DESTDIR)/$(3)/$(1)): $$(abspath $$(dir $(DESTDIR)/$(3)/$(1))) ifdef INSTALL_PRE @echo "Executing preinstall command." --- 60,77 ---- # env_post.mk. I can revisit this `enhancement' later. #CLEAN_TARGETS += $$(INSTALL_FILE) + + ifdef MAKE_3_80_COMPAT + INSTALL_FILES += $$(call MAKE_3_80_abspath,$(DESTDIR)/$(3)/$(1)) + else INSTALL_FILES += $$(abspath $(DESTDIR)/$(3)/$(1)) + endif # MAKE_3_80_COMPAT ! ifdef MAKE_3_80_COMPAT ! $$(call MAKE_3_80_abspath,$(DESTDIR)/$(3)/$(1)): \ ! $$(call MAKE_3_80_abspath,$$(dir $(DESTDIR)/$(3)/$(1))) ! else ! $$(abspath $(DESTDIR)/$(3)/$(1)): \ ! $$(abspath $$(dir $(DESTDIR)/$(3)/$(1))) ! endif # MAKE_3_80_COMPAT ifdef INSTALL_PRE @echo "Executing preinstall command." *************** *** 72,76 **** --- 92,104 ---- # define generate_vpath_rule + ifdef MAKE_3_80_COMPAT + ifeq ($$(strip $(2)),) + vpath %.$(1) $(abs_srcdir) + else + vpath %.$(1) $(2) + endif # End $$(strip $(2)) + else vpath %.$(1) $$(if $(2),$(2),$(abs_srcdir)) + endif # End ifdef MAKE_3_80_COMPAT endef |