1 tplarson 1.11 # $Header: /home/cvsuser/cvsroot/JSOC/proj/globalhs/Rules.mk,v 1.10 2014/05/22 15:44:57 tplarson Exp $
|
2 tplarson 1.2
|
3 tplarson 1.1 sp := $(sp).x
4 dirstack_$(sp) := $(d)
5 d := $(dir)
6
|
7 tplarson 1.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 tplarson 1.10 # 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 tplarson 1.11 GLOBALHSMODLIST := jv2ts jretile jtsfiddle jtsslice jpkbgn jrebinsmooth undistortmdi mkylms inv2d.x
16 GLOBALHSLIBLIST := libdtgf.a libinv2d.a libpkbgn.a libpkbgn360d.a libprojection.a
|
17 tplarson 1.7
|
18 tplarson 1.8 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. The value of
26 GLOBALHSTAGOVERRIDE must contain the string "globalhs". This value will
27 be compiled into the modules and written to ancillary dataseries as CVSTAG.
28
29 To automatically create a consistent tag (FOR PRODUCTION ONLY!), one may run
30 proj/globalhs/scripts/setglobalhstags. This script will add a tag in cvs
31 for every file comprising the globalhs source code, so use it with care.
32
33 endef
34
35 define GHSWARNING2
36
37 WARNING: GLOBALHSTAGOVERRIDE should contain the string "globalhs".
38 The value given was "$(GLOBALHSTAGOVERRIDE)".
39 tplarson 1.8 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 tplarson 1.11 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. The
49 value of GLOBALHSTAGOVERRIDE must contain the string "globalhs". This value will
50 be compiled into the modules and written to ancillary dataseries as CVSTAG. This
51 option is FOR DEVELOPMENT ONLY!
52
53 endef
54
55
|
56 tplarson 1.6 ifeq ($(GLOBALHSTAGOVERRIDE),)
57 ifeq ($(MAKECMDGOALS),)
58 GLOBALHS_TAG := $(shell $(SRCDIR)/proj/globalhs/scripts/checkglobalhstags $(SRCDIR))
|
59 tplarson 1.11 ifeq ($(GLOBALHS_TAG),)
60 $(warning $(GHSWARNING3))
61 endif
|
62 tplarson 1.6 TAGCHECK := $(findstring globalhs,$(GLOBALHS_TAG))
63 ifeq ($(TAGCHECK),)
|
64 tplarson 1.8 $(warning $(GHSWARNING1))
|
65 tplarson 1.6 endif
66 else
67 GHSMODLIST_SOCK := $(GLOBALHSMODLIST:%=%_sock)
|
68 tplarson 1.11 GHSTARGETLIST := all universe targets globalhs $(GLOBALHSMODLIST) $(GHSMODLIST_SOCK) $(GHSLIBLIST)
|
69 tplarson 1.7 # if we added '%' before all the words in GLOBALHSMODLIST, the following would work even if someone specified the full path to the modules.
70 # if we added '%' after, it would also work if someone wanted to compile the .o files.
71 # i'm not doing so at this time because inserting literal %'s is too much hassle for functionality we don't even use.
72 GHSTARGETTEST := $(filter $(GHSTARGETLIST),$(MAKECMDGOALS))
|
73 tplarson 1.6 ifneq ($(GHSTARGETTEST),)
74 GLOBALHS_TAG := $(shell $(SRCDIR)/proj/globalhs/scripts/checkglobalhstags $(SRCDIR))
|
75 tplarson 1.11 ifeq ($(GLOBALHS_TAG),)
76 $(warning $(GHSWARNING3))
77 endif
|
78 tplarson 1.6 TAGCHECK := $(findstring globalhs,$(GLOBALHS_TAG))
79 ifeq ($(TAGCHECK),)
|
80 tplarson 1.8 $(warning $(GHSWARNING1))
|
81 tplarson 1.6 endif
82 endif
83 endif
84 else
85 GLOBALHS_TAG := $(GLOBALHSTAGOVERRIDE)
|
86 arta 1.4 TAGCHECK := $(findstring globalhs,$(GLOBALHS_TAG))
87 ifeq ($(TAGCHECK),)
|
88 tplarson 1.8 $(warning $(GHSWARNING2))
|
89 arta 1.4 endif
|
90 tplarson 1.2 endif
91
|
92 tplarson 1.1 # Subdirectories. Directory-specific rules are optional here. The
|
93 tplarson 1.2 # order does NOT matter.
94 dir := $(d)/libs
95 -include $(SRCDIR)/$(dir)/Rules.mk
|
96 tplarson 1.1 dir := $(d)/apps
97 -include $(SRCDIR)/$(dir)/Rules.mk
98
99 # Standard things
100 d := $(dirstack_$(sp))
101 sp := $(basename $(sp))
|