X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=stepmake%2Fstepmake%2Fgeneric-vars.make;h=146d1d25b7eee8948cb2018d3d75f4d03aa84217;hb=339ec2c5d3556ac255833d8cabc35fce6046be41;hp=4bebe73e922919738688b6391d30f78f2693be8c;hpb=3cd7af22819b8374310156db6c4ae8baf878715c;p=lilypond.git diff --git a/stepmake/stepmake/generic-vars.make b/stepmake/stepmake/generic-vars.make index 4bebe73e92..146d1d25b7 100644 --- a/stepmake/stepmake/generic-vars.make +++ b/stepmake/stepmake/generic-vars.make @@ -1,81 +1,66 @@ -# title generic variables -# file make/Variables.make -# -# do not change this file for site-wide extensions; please use -# make/$(outdir)/Site.make; -# -# Any change in files in this directory (make/) would be distributed, if -# you do make dist +top-build-dir = $(shell cd $(depth) && pwd) +build-dir = $(shell cd . && pwd) +tree-dir = $(subst $(top-build-dir),,$(build-dir)) -# directory names: +ifneq ($(configure-srcdir),.) +srcdir-build = 1 +endif -# depth from group-dir -# internal, not normally used -DEPTH = $(depth)/$(package-depth) +ifndef srcdir-build +src-depth = $(depth) +else +src-depth = $(configure-srcdir) +endif + +top-src-dir := $(shell cd $(src-depth); pwd) -ifeq ($(topdir),) -topdir := $(shell cd $(depth); pwd) +ifndef srcdir-build +src-dir = . +else +src-dir = $(top-src-dir)$(tree-dir) +VPATH = $(src-dir) endif -pwd := $(shell pwd) -# $(depth) is deprecated, for most cases you'll want $(src-depth) -# -# Well, on second thought. -# It can do no harm, but using src-depth iso depth is only necessary -# for broken rules that do -# cd $(outdir) && foo $(depth) ... -src-depth = $(depth)/$(srcdir) +.UNEXPORT: build-dir src-dir tree-dir + +src-wildcard = $(subst $(src-dir)/,,$(wildcard $(src-dir)/$(1))) -# derived names ifeq ($(distdir),) - distdir = $(topdir)/$(outdir)/$(DIST_NAME) + distdir = $(top-src-dir)/$(outdir)/$(DIST_NAME) DIST_NAME = $(package)-$(TOPLEVEL_VERSION) endif distname = $(package)-$(TOPLEVEL_VERSION) -# obsolete? -#makeout = $(depth)/make/$(outdir) -#docout = $(depth)/Documentation/$(outdir) -#binout = $(depth)/bin/$(outdir) - doc-dir = $(src-depth)/Documentation po-dir = $(src-depth)/po - -# sort-out which of these are still needed -# -$(package)_bindir = $(depth)/bin step-bindir = $(stepmake)/bin -group-dir = $(shell cd $(DEPTH)/..; pwd) +# stepmake package support. +DEPTH = $(depth)/$(package-depth) + +group-dir = $(shell cd $(DEPTH);pwd)/.. release-dir = $(group-dir)/releases patch-dir = $(group-dir)/patches -# -# i have in $HOME/.rpmrc -# topdir: /home/fred/usr/src/Redhat -# rpm-sources = $(release-dir) rpm-build = $(group-dir)/RedHat/BUILD -# - +package-icon = $(outdir)/$(package)-icon.xpm -# need to be defined in local Makefiles: -# -FOOBAR = -# the version: -# -ifneq ($(MY_PATCH_LEVEL),$(FOOBAR)) +ifneq ($(strip $(MY_PATCH_LEVEL)),) VERSION=$(MAJOR_VERSION).$(MINOR_VERSION).$(PATCH_LEVEL).$(MY_PATCH_LEVEL) else VERSION=$(MAJOR_VERSION).$(MINOR_VERSION).$(PATCH_LEVEL) endif -ifneq ($(TOPLEVEL_MY_PATCH_LEVEL),$(FOOBAR)) +ifneq ($(strip $(TOPLEVEL_MY_PATCH_LEVEL)),) TOPLEVEL_VERSION=$(TOPLEVEL_MAJOR_VERSION).$(TOPLEVEL_MINOR_VERSION).$(TOPLEVEL_PATCH_LEVEL).$(TOPLEVEL_MY_PATCH_LEVEL) else TOPLEVEL_VERSION=$(TOPLEVEL_MAJOR_VERSION).$(TOPLEVEL_MINOR_VERSION).$(TOPLEVEL_PATCH_LEVEL) endif +# no local settings in the build process. +LANG= +export LANG # clean file lists: # @@ -83,64 +68,39 @@ ERROR_LOG = 2> /dev/null SILENT_LOG = 2>&1 > /dev/null date := $(shell date +%x) #duplicated? -# compile and link options: -# -ARFLAGS = ru - -#INCLUDES = $(depth)/$(builddir) include $(outdir) $($(PACKAGE)_INCLUDES) $(MODULE_INCLUDES) -INCLUDES = include $(outdir) $($(PACKAGE)_INCLUDES) $(MODULE_INCLUDES) - -# urg: for windows ? -# LOADLIBES = $(MODULE_LIBES) $($(PACKAGE)_LIBES) $(EXTRA_LIBES) -lstdc++ -# +INCLUDES = $(src-dir)/include $(outdir) $($(PACKAGE)_INCLUDES) $(MODULE_INCLUDES) -# macro compiler: -# M4 = m4 -# - -# -LD_COMMAND = $(LD) $(LDFLAGS) -o $@ -# - -# dependencies: -# -depfile = $(outdir)/$(subst .o,.dep,$(notdir $@))# -DODEP=rm -f $(depfile); DEPENDENCIES_OUTPUT="$(depfile) $(outdir)/$(notdir $@)" -# - - -# generic target names: -# -ifdef NAME -EXECUTABLE = $(outdir)/$(NAME) -else -EXECUTABLE = -endif - -EXECUTABLES = $(notdir $(EXECUTABLE)) +DIST_FILES=$(EXTRA_DIST_FILES) GNUmakefile $(ALL_SOURCES) $(call src-wildcard,SConscript) +DOCDIR=$(depth)/$(outdir) -# - -#replace to do stripping of certain objects +#? STRIPDEBUG=true +STRIP=strip --strip-debug +DO_STRIP=true -DIST_FILES=$(EXTRA_DIST_FILES) GNUmakefile $(ALL_SOURCES) -DOCDIR=$(depth)/$(outdir) +LOOP=$(foreach i, $(SUBDIRS), $(MAKE) PACKAGE=$(PACKAGE) package=$(package) -C $(i) $@ &&) true +ETAGS_FLAGS = +CTAGS_FLAGS = -STRIP=strip --strip-debug -ifdef stablecc - STABLEOBS=$(addprefix $(outdir)/,$(stablecc:.cc=.o)) -endif +makeflags=$(patsubst %==, %, $(patsubst ---%,,$(patsubst ----%,,$(MAKEFLAGS:%=--%)))) -# substitute $(STRIP) in Site.make if you want stripping -DO_STRIP=true -LOOP=$(foreach i, $(SUBDIRS), $(MAKE) PACKAGE=$(PACKAGE) -C $(i) $@ &&) true +IN_FILES := $(call src-wildcard,*.in) +SOURCE_FILES += $(IN_FILES) -ETAGS_FLAGS=-CT -CTAGS_FLAGS=-h +# Preprocessed .in documentation _FILES: +OUTIN_FILES = $(addprefix $(outdir)/, $(IN_FILES:%.in=%)) -include $(stepdir)/files.make +ALL_SOURCES = $(SOURCE_FILES) +# Check if we are building for Cygwin +# +HOST_ARCH=$(shell $(CC) -dumpmachine) +ifeq ($(HOST_ARCH),i686-pc-cygwin) +CYGWIN_BUILD = yes +endif +ifeq ($(HOST_ARCH),i686-cygwin) +CYGWIN_BUILD = yes +endif