1 |
# $Header: /home/cvsuser/cvsroot/JSOC/proj/globalhs/Rules.mk,v 1.15 2015/05/20 19:17:10 tplarson Exp $ |
2 |
|
3 |
sp := $(sp).x |
4 |
dirstack_$(sp) := $(d) |
5 |
d := $(dir) |
6 |
|
7 |
# any modules specified in proj/globalhs/apps must appear in this list. |
8 |
# one might think to add the libraries in proj/globalhs/libs as well, |
9 |
# but it's actually unnecessary because they are forced to be recompiled |
10 |
# every time the modules that use them are recompiled, whether they are |
11 |
# out of date or not. see the phony targets in the corresponding Rules.mk files. |
12 |
# UPDATE: i'm adding the libraries after all, just in case someone wants to |
13 |
# specify them as a target on the commandline. for the globalhs modules, |
14 |
# this is never needed. |
15 |
GLOBALHSMODLIST := jv2ts jretile jtsfiddle jtsslice jpkbgn jpkbgn360d jrebinsmooth undistortmdi mkylms inv2d.x |
16 |
GLOBALHSLIBLIST := libdtgf.a libinv2d.a libpkbgn.a libpkbgn360d.a libprojection.a |
17 |
|
18 |
define GHSWARNING1 |
19 |
|
20 |
WARNING: proj/globalhs is not tagged consistently. A build of any target |
21 |
in proj/globalhs will fail. The output of script |
22 |
proj/globalhs/scripts/checkglobalhstags is "$(GLOBALHS_TAG)". |
23 |
|
24 |
To skip tag checking (FOR DEVELOPMENT ONLY!), specify GLOBALHSTAGOVERRIDE |
25 |
in either your environment or on the make command line. This value will |
26 |
be compiled into the modules and written to ancillary dataseries as CVSTAG. |
27 |
|
28 |
To automatically create a consistent tag (FOR PRODUCTION ONLY!), one may run |
29 |
proj/globalhs/scripts/setglobalhstags. This script will add a tag in cvs |
30 |
for every file comprising the globalhs source code, so use it with care. |
31 |
|
32 |
endef |
33 |
|
34 |
#the following is no longer used, GLOBALHSTAGOVERRIDE can be any string |
35 |
define GHSWARNING2 |
36 |
|
37 |
WARNING: GLOBALHSTAGOVERRIDE should contain the string "globalhs". |
38 |
The value given was "$(GLOBALHSTAGOVERRIDE)". |
39 |
A build of any target in proj/globalhs will fail. |
40 |
Note that the value of GLOBALHSTAGOVERRIDE will be compiled into |
41 |
the modules and written to ancillary dataseries as CVSTAG. |
42 |
|
43 |
endef |
44 |
|
45 |
define GHSWARNING3 |
46 |
|
47 |
WARNING: the script proj/globalhs/scripts/checkglobalhstags gave no output (something |
48 |
crashed). You can force the build to succeed by specifying GLOBALHSTAGOVERRIDE. This |
49 |
value will be compiled into the modules and written to ancillary dataseries as CVSTAG. |
50 |
This option is FOR DEVELOPMENT ONLY! |
51 |
|
52 |
endef |
53 |
|
54 |
# commented lines below are to accomodate removal of globalhs from the default build |
55 |
|
56 |
ifeq ($(GLOBALHSTAGOVERRIDE),) |
57 |
# ifeq ($(MAKECMDGOALS),) |
58 |
# GLOBALHS_TAG := $(shell $(SRCDIR)/proj/globalhs/scripts/checkglobalhstags $(SRCDIR)) |
59 |
# ifeq ($(GLOBALHS_TAG),) |
60 |
# $(error $(GHSWARNING3)) |
61 |
# endif |
62 |
# TAGCHECK := $(findstring globalhs,$(GLOBALHS_TAG)) |
63 |
# ifeq ($(TAGCHECK),) |
64 |
# $(error $(GHSWARNING1)) |
65 |
# endif |
66 |
# else |
67 |
GHSMODLIST_SOCK := $(GLOBALHSMODLIST:%=%_sock) |
68 |
GHSTARGETLIST := globalhs $(GLOBALHSMODLIST) $(GHSMODLIST_SOCK) $(GLOBALHSLIBLIST) |
69 |
# GHSTARGETLIST := all universe targets globalhs $(GLOBALHSMODLIST) $(GHSMODLIST_SOCK) $(GLOBALHSLIBLIST) |
70 |
# if we added '%' before all the words in GLOBALHSMODLIST, the following would work even if someone specified the full path to the modules. |
71 |
# if we added '%' after, it would also work if someone wanted to compile the .o files. |
72 |
# i'm not doing so at this time because inserting literal %'s is too much hassle for functionality we don't even use. |
73 |
GHSTARGETTEST := $(filter $(GHSTARGETLIST),$(MAKECMDGOALS)) |
74 |
ifneq ($(GHSTARGETTEST),) |
75 |
GLOBALHS_TAG := $(shell $(SRCDIR)/proj/globalhs/scripts/checkglobalhstags $(SRCDIR)) |
76 |
ifeq ($(GLOBALHS_TAG),) |
77 |
$(error $(GHSWARNING3)) |
78 |
endif |
79 |
TAGCHECK := $(findstring globalhs,$(GLOBALHS_TAG)) |
80 |
ifeq ($(TAGCHECK),) |
81 |
$(error $(GHSWARNING1)) |
82 |
endif |
83 |
endif |
84 |
# endif |
85 |
else |
86 |
GLOBALHS_TAG := $(GLOBALHSTAGOVERRIDE) |
87 |
# TAGCHECK := $(findstring globalhs,$(GLOBALHS_TAG)) |
88 |
# ifeq ($(TAGCHECK),) |
89 |
# $(error $(GHSWARNING2)) |
90 |
# endif |
91 |
endif |
92 |
|
93 |
# Subdirectories. Directory-specific rules are optional here. The |
94 |
# order does NOT matter. |
95 |
dir := $(d)/libs |
96 |
-include $(SRCDIR)/$(dir)/Rules.mk |
97 |
dir := $(d)/apps |
98 |
-include $(SRCDIR)/$(dir)/Rules.mk |
99 |
|
100 |
# Standard things |
101 |
d := $(dirstack_$(sp)) |
102 |
sp := $(basename $(sp)) |