(file) Return to Rules.mk CVS log (file) (dir) Up to [Development] / JSOC / proj / globalhs

File: [Development] / JSOC / proj / globalhs / Rules.mk (download)
Revision: 1.9, Mon Mar 17 22:26:14 2014 UTC (9 years, 2 months ago) by arta
Branch: MAIN
CVS Tags: Ver_8-4
Changes since 1.8: +7 -1 lines
Modify top-level Rules.mk so that make does not choke if the users tree is detached from CVS.

# $Header: /home/cvsuser/cvsroot/JSOC/proj/globalhs/Rules.mk,v 1.9 2014/03/17 23:26:14 arta Exp $

sp 		:= $(sp).x
dirstack_$(sp)	:= $(d)
d		:= $(dir)

# any modules specified in proj/globalhs/apps must appear in this list.
# one might think to add the libraries in proj/globalhs/libs as well, 
# but it's actually unnecessary because they are forced to be recompiled
# every time the modules that use them are recompiled, whether they are 
# out of date or not.  see the phony targets in the corresponding Rules.mk files.
GLOBALHSMODLIST := jv2ts jretile jtsfiddle jtsslice jpkbgn jrebinsmooth undistortmdi mkylms

define GHSWARNING1

WARNING: proj/globalhs is not tagged consistently. A build of any target 
in proj/globalhs will fail. The output of script 
proj/globalhs/scripts/checkglobalhstags is "$(GLOBALHS_TAG)".

To skip tag checking (FOR DEVELOPMENT ONLY!), specify GLOBALHSTAGOVERRIDE 
in either your environment or on the make command line. The value of 
GLOBALHSTAGOVERRIDE must contain the string "globalhs". This value will 
be compiled into the modules and written to ancillary dataseries as CVSTAG.

To automatically create a consistent tag (FOR PRODUCTION ONLY!), one may run 
proj/globalhs/scripts/setglobalhstags. This script will add a tag in cvs 
for every file comprising the globalhs source code, so use it with care.

endef

define GHSWARNING2

WARNING: GLOBALHSTAGOVERRIDE should contain the string "globalhs". 
The value given was "$(GLOBALHSTAGOVERRIDE)". 
A build of any target in proj/globalhs will fail.
Note that the value of GLOBALHSTAGOVERRIDE will be compiled into
the modules and written to ancillary dataseries as CVSTAG.

endef

ifeq ($(GLOBALHSTAGOVERRIDE),)
  ifeq ($(MAKECMDGOALS),)
    GLOBALHS_TAG := $(shell $(SRCDIR)/proj/globalhs/scripts/checkglobalhstags $(SRCDIR))
    ifeq ($(GLOBALHS_TAG),)
      GLOBALHS_TAG := globalhs
    endif
    TAGCHECK := $(findstring globalhs,$(GLOBALHS_TAG))
    ifeq ($(TAGCHECK),)
      $(warning $(GHSWARNING1))
    endif
  else
    GHSMODLIST_SOCK := $(GLOBALHSMODLIST:%=%_sock)
    GHSTARGETLIST   := all universe targets globalhs $(GLOBALHSMODLIST) $(GHSMODLIST_SOCK)
# if we added '%' before all the words in GLOBALHSMODLIST, the following would work even if someone specified the full path to the modules.
# if we added '%' after, it would also work if someone wanted to compile the .o files.
# i'm not doing so at this time because inserting literal %'s is too much hassle for functionality we don't even use.
    GHSTARGETTEST   := $(filter $(GHSTARGETLIST),$(MAKECMDGOALS))
    ifneq ($(GHSTARGETTEST),)
      GLOBALHS_TAG := $(shell $(SRCDIR)/proj/globalhs/scripts/checkglobalhstags $(SRCDIR))
      ifeq ($(GLOBALHS_TAG),)
        GLOBALHS_TAG := globalhs
      endif
      TAGCHECK := $(findstring globalhs,$(GLOBALHS_TAG))
      ifeq ($(TAGCHECK),)
        $(warning $(GHSWARNING1))
      endif
    endif
  endif
else
  GLOBALHS_TAG := $(GLOBALHSTAGOVERRIDE)
  TAGCHECK := $(findstring globalhs,$(GLOBALHS_TAG))
  ifeq ($(TAGCHECK),)
    $(warning $(GHSWARNING2))
  endif
endif

# Subdirectories. Directory-specific rules are optional here. The
# order does NOT matter.
dir	:= $(d)/libs
-include		$(SRCDIR)/$(dir)/Rules.mk
dir	:= $(d)/apps
-include		$(SRCDIR)/$(dir)/Rules.mk

# Standard things
d		:= $(dirstack_$(sp))
sp		:= $(basename $(sp))

Karen Tian
Powered by
ViewCVS 0.9.4