ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/SCRAM/src/basics.mk
Revision: 1.35
Committed: Fri Jul 19 15:43:30 2002 UTC (22 years, 10 months ago) by sashby
Branch: MAIN
Changes since 1.34: +2 -1 lines
Log Message:
Changes to src makefiles.

File Contents

# User Rev Content
1 williamc 1.21 # useful make internals
2     empty:=
3     space:=$(empty) $(empty)
4    
5     #
6     # reset make default variables
7     #
8     CXX:=
9     FC:=
10    
11 williamc 1.1 #
12     # Preliminaries
13     #
14 sashby 1.33 LIBDIR=$(LOCALTOP)/lib/$(SCRAM_ARCH) $(RELEASETOP)/lib/$(SCRAM_ARCH) $(PRIORITY_LIBDIR)
15 williamc 1.18 CXXFLAGS+=$(CXXUSERFLAGS)
16     JAVA_CLASSDIR=$(LOCALTOP)/lib/$(SCRAM_ARCH)
17 sashby 1.26 UNAME:=$(shell uname)
18 williamc 1.1 #
19     # Make sure nobody tries to run this directly through gmake
20     #
21     ifndef DefaultMakefile
22     all: exit
23     endif
24    
25 williamc 1.18 # Quiet setting for <Build> tags
26     QUIET = no
27     ifeq ($(QUIET),yes)
28     _quietbuild_ = @echo "Creating $<...";
29     _quietstamp_ = @
30     else
31     _quietbuild_ =
32     _quietstamp_ = @
33     endif
34    
35     #
36     # Generic scram build target
37     #
38     scrambuild_% :
39     @dir=$(subst scrambuild_,,$@); \
40     if [ -d $(LOCALTOP)/$(INTsrc)/$$dir ]; then \
41     echo "------- Building ---- $$dir -----------"; \
42 sashby 1.24 cd $(LOCALTOP)/$(INTsrc)/$$dir; $(SCRAM) build; \
43 williamc 1.18 fi
44    
45 williamc 1.21 #
46     # Get local mods
47     #
48     ifdef LatestBuildFile
49     include ${LatestBuildFile}
50     endif
51    
52     #
53     # get build requirements Class
54     #
55     ifdef DefaultBuildFile
56     include ${DefaultBuildFile}
57     endif
58 williamc 1.18
59 williamc 1.14 # -- storage of libraries
60 williamc 1.21 librarystore:=$(SCRAMSTORE_lib)
61 sashby 1.32 debuglibrarystore:=$(librarystore)/debug
62 sashby 1.35 insurelibrarystore:=$(librarystore)/insure
63     archivelibrarystore:=$(librarystore)/archive
64 williamc 1.20 INTlib:=$(SCRAMSTORENAME_lib)
65 williamc 1.14 libsavaillocal=$(notdir $(wildcard $(librarystore)/*))
66     libsavailbase=$(notdir $(wildcard $(RELEASETOP)/$(INTlib)/*))
67     libsavail=$(sort $(libsavailbase) $(libsavaillocal))
68     libslocal=$(foreach var,$(lib),$(filter lib$(var).a, $(libsavail)))
69     libslocal_I=$(foreach var,$(lib_I),$(filter lib$(var).a, $(libsavail)))
70     libslocal_d=$(foreach var,$(lib_d),$(filter lib$(var).a, $(libsavail)))
71 williamc 1.1
72     #
73     # Pointing to file storage locations for the various types
74     #
75     # -- src code and unspecified types
76     VPATH:=$(LOCALTOP)/$(ClassDir):$(RELEASETOP)/$(ClassDir)
77     # -- .o files will be kept in the working directory
78     vpath %.o $(LOCALTOP)/$(workdir):$(RELEASETOP)/$(workdir)
79    
80     #
81     ifdef ReqDependencies
82     always:$(LOCALTOP)/$(workdir)/PackageReqs
83 williamc 1.11 $(LOCALTOP)/$(workdir)/PackageReqs:$(ReqDependencies)
84 williamc 1.18 $(SCRAMPERL) $(TOOL_HOME)/BuildPackageReqs $@ $?
85 williamc 1.1 endif
86    
87 williamc 1.18
88 williamc 1.9 #
89 williamc 1.18 # Group Settings
90     #
91     ifdef SCRAM_GROUPSDIR
92     -include $(SCRAM_GROUPSDIR)
93     endif
94    
95 williamc 1.21 # -- compilers.mk - to be removed when contents of compiler.mk expunged
96     include ${TOOL_HOME}/compilers.mk
97    
98 sashby 1.26 # -- Try adding SWIG stuff here
99     export TOPDIR=$(RELEASETOP)/src
100     export USERDIR=$(LOCALTOP)/src
101     # Set base of ANAPHE distro:
102     ifeq ($(UNAME),Linux)
103     export LHCXX_BASE=/afs/cern.ch/sw/lhcxx/specific/redhat61/gcc-2.95.2
104 sashby 1.27 # Also need a OBJY thing here:
105     export OBJY_VERS=6.1
106     export OBJY_DIR=$(LHCXX_BASE)/Objectivity/$(OBJY_VERS)
107 sashby 1.26 endif
108 sashby 1.27
109 sashby 1.26 export LHCXXTOP=/afs/cern.ch/sw/lhcxx
110     export BFARCH
111    
112     PYDIRS = $(wildcard $(USERDIR)/*/*/python/)
113 sashby 1.23
114 sashby 1.26 #
115 williamc 1.9 # Site settings
116     #
117     clientmakefile=$(LOCALTOP)/$(INTwork)/clientmakefile
118 williamc 1.17 -include $(clientmakefile)
119 williamc 1.1
120     #
121     # get build targets
122     #
123     include ${TOOL_HOME}/toolrules.mk
124    
125     #
126     # -- Some tool setups which dont yet have a home
127     #
128 williamc 1.18 CPPFLAGS += $(addprefix -I,$(PRIORITY_INCLUDE)) $(INCLUDEPATH)
129 williamc 1.1
130     #
131     # now add our includepath
132     #
133 sashby 1.34 INCLUDEPATH+=-I$(LOCALTOP)/${INTsrc} -I$(RELEASETOP)/${INTsrc}
134 williamc 1.1
135 williamc 1.5 #
136     # Dependency information
137     #
138 williamc 1.9 -include dependencies.mk
139 williamc 1.5
140 williamc 1.1 #
141     # Process Subdirs
142     #
143     ifdef SUBDIRS
144 williamc 1.12 $(SUBDIRS)::
145 williamc 1.1 @echo ------- Building ---- $@ -----------
146 williamc 1.18 @if [ -d $(LOCALTOP)/$(ClassDir)/$@ ]; then \
147 sashby 1.24 cd $(LOCALTOP)/$(ClassDir)/$@; $(SCRAM) build; \
148 williamc 1.18 else echo SCRAM Warning : $@ does not exist; \
149     fi
150 williamc 1.1 endif
151    
152     #
153     # -- Some error trapping and debug targets
154     #
155    
156     dummy:
157    
158    
159 williamc 1.18 .PHONY: help clean
160     help::
161     @echo "--------------------------------------------------------"
162     ifndef BINMODE
163     help::
164     @echo "General Targets"
165     @echo "---------------"
166     @echo "clean - clean out the corresponding working directory"
167     @echo "echo_VAR - debugging only, prints out the value of the scram variable VAR"
168 williamc 1.1 @echo "-----------------"
169 williamc 1.18 endif
170 williamc 1.1
171     exit:
172 williamc 1.18 @echo "Please Use Scram. Do not use gmake directly."
173 williamc 1.1 @exit 1
174    
175     echo_%:
176     @echo "$(subst echo_,,$@) = $($(subst echo_,,$@))"
177    
178 williamc 1.18
179     #
180     # Other non-critical targets
181     #
182    
183     TAGS:
184     etags -o TAGS $(files) $(binfiles)
185    
186     tags:
187     ctags -o tags $(files) $(binfiles)
188    
189     #
190 williamc 1.1 #
191     # clean targets
192     #
193    
194     # make sure the variables will be set before rm -r by ensuring that
195     # it has come through the wrapper script
196    
197     ifdef DefaultMakefile
198 williamc 1.10 clean::
199 williamc 1.1 @echo Cleaning working folder $(workdir)
200 williamc 1.18 ifdef LOCALTOP
201     ifdef workdir
202     @rm -rf $(LOCALTOP)/$(workdir)/*
203     endif
204     endif
205 williamc 1.1
206     very_clean:
207     @echo Cleaning all working folders in $(INTwork)
208     @cd $(LOCALTOP)/$(INTwork)
209 williamc 1.18 ifdef LOCALTOP
210     ifdef workdir
211     @rm -rf $(LOCALTOP)/$(INTwork)/*
212     endif
213 williamc 1.1 endif
214 williamc 1.18 endif
215 williamc 1.21
216     #
217     # datestamp files
218     #
219 sashby 1.26 .PHONY: datestamp_config datestamp python
220 williamc 1.21
221     scramds_%::
222 williamc 1.22 @$(SCRAMPERL) $(SCRAM_HOME)/src/scramds $*.ds
223 williamc 1.21
224     #
225     # rather than tracing all the dependency root - just check all local .ds files
226     #
227     dsfiles=$(wildcard *.ds)
228     releasedsfiles=$(wildcard $(RELEASETOP)/$(workdir)/*.ds)
229    
230     datestamp_config:
231     @if [ "$(dsfiles)" = "" ]; then \
232     if [ "$(releasedsfiles)" != "" ]; then \
233     cp $(releasedsfiles) $(LOCALTOP)/$(workdir); \
234     fi; \
235     fi
236    
237     datestamp: $(addprefix scramds_, $(basename $(dsfiles)))
238 sashby 1.25
239 sashby 1.26 #
240     python: $(PYDIRS)
241     ifdef PYDIRS
242     $(PYDIRS)::
243     @echo "---- Building Python ----"
244     @echo "-> Dir: " $@
245     @echo
246     @if [ -d $@ ]; then \
247     cd $@; \
248 sashby 1.27 $(MAKE) -ef $(TOOL_HOME)/Py-main.mk all; \
249 sashby 1.26 else echo SCRAM Warning : $@ does not exist; \
250     fi
251     endif
252 sashby 1.25
253    
254 sashby 1.26 root:
255     @echo
256     @echo "---- Root not yet integrated into SCRAM ----"
257     @echo