ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/SCRAM/src/basics.mk
Revision: 1.17.2.24
Committed: Wed May 31 13:26:30 2000 UTC (24 years, 11 months ago) by williamc
Branch: V0_9branch
CVS Tags: V0_14_0, V0_12_12_4, V0_12_12_3, V0_12_12_2, V0_12_12_1, V0_12_12_0, PlayGround_0, V0_12_12, V0_12_11, V0_12_9b, V0_12_10, V0_12_9
Branch point for: HPWbranch
Changes since 1.17.2.23: +11 -0 lines
Log Message:
Add quiet rules

File Contents

# User Rev Content
1 williamc 1.1 #
2     # Preliminaries
3     #
4 williamc 1.17.2.8 LIBDIR=$(LOCALTOP)/lib/$(SCRAM_ARCH) $(RELEASETOP)/lib/$(SCRAM_ARCH) $(PRIORITY_LIBDIR)
5 williamc 1.17.2.7 CXXFLAGS+=$(CXXUSERFLAGS)
6 williamc 1.17.2.21 JAVA_CLASSDIR=$(LOCALTOP)/lib/$(SCRAM_ARCH)
7 williamc 1.17.2.6
8 williamc 1.1 #
9     # Make sure nobody tries to run this directly through gmake
10     #
11     ifndef DefaultMakefile
12     all: exit
13     endif
14    
15 williamc 1.17.2.24
16     # Quiet setting for <Build> tags
17     QUIET = no
18     ifeq ($(QUIET),yes)
19     _quietbuild_ = @echo "Creating $<...";
20     _quietstamp_ = @
21     else
22     _quietbuild_ =
23     _quietstamp_ = @
24     endif
25    
26 williamc 1.17.2.23 #
27     # Generic scram build target
28     #
29     scrambuild_% :
30     @dir=$(subst scrambuild_,,$@); \
31     if [ -d $(LOCALTOP)/$(INTsrc)/$$dir ]; then \
32     echo "------- Building ---- $$dir -----------"; \
33     cd $(LOCALTOP)/$(INTsrc)/$$dir; $(TOOL_HOME)/scram build; \
34     fi
35    
36    
37 williamc 1.17.2.9
38 williamc 1.14 # -- storage of libraries
39     librarystore:=$(LOCALTOP)/$(INTlib)
40 williamc 1.15
41 williamc 1.14 libsavaillocal=$(notdir $(wildcard $(librarystore)/*))
42     libsavailbase=$(notdir $(wildcard $(RELEASETOP)/$(INTlib)/*))
43     libsavail=$(sort $(libsavailbase) $(libsavaillocal))
44     libslocal=$(foreach var,$(lib),$(filter lib$(var).a, $(libsavail)))
45     libslocal_I=$(foreach var,$(lib_I),$(filter lib$(var).a, $(libsavail)))
46     libslocal_d=$(foreach var,$(lib_d),$(filter lib$(var).a, $(libsavail)))
47 williamc 1.1
48     #
49     # Pointing to file storage locations for the various types
50     #
51     # -- src code and unspecified types
52     VPATH:=$(LOCALTOP)/$(ClassDir):$(RELEASETOP)/$(ClassDir)
53     # -- .o files will be kept in the working directory
54     vpath %.o $(LOCALTOP)/$(workdir):$(RELEASETOP)/$(workdir)
55    
56     #
57     ifdef ReqDependencies
58     always:$(LOCALTOP)/$(workdir)/PackageReqs
59 williamc 1.11 $(LOCALTOP)/$(workdir)/PackageReqs:$(ReqDependencies)
60 williamc 1.1 $(TOOL_HOME)/BuildPackageReqs $@ $?
61     endif
62    
63 williamc 1.17.2.9
64 williamc 1.1 #
65     # Get local mods
66     #
67     ifdef LatestBuildFile
68     include ${LatestBuildFile}
69     endif
70 williamc 1.17.2.2
71 williamc 1.1 #
72     # get build requirements Class
73     #
74     ifdef DefaultBuildFile
75     include ${DefaultBuildFile}
76     endif
77    
78 williamc 1.9 #
79 williamc 1.17.2.12 # Group Settings
80     #
81 williamc 1.17.2.13 ifdef SCRAM_GROUPSDIR
82     -include $(SCRAM_GROUPSDIR)
83     endif
84 williamc 1.17.2.12
85 williamc 1.9 # Site settings
86     #
87     clientmakefile=$(LOCALTOP)/$(INTwork)/clientmakefile
88 williamc 1.17.2.11 -include $(clientmakefile)
89 williamc 1.17.2.9
90 williamc 1.1 #
91     # get build targets
92     #
93 williamc 1.9 include ${TOOL_HOME}/compilers.mk
94 williamc 1.1 include ${TOOL_HOME}/toolrules.mk
95    
96 williamc 1.9
97 williamc 1.1 #
98     # -- Some tool setups which dont yet have a home
99     #
100 williamc 1.17.2.8 CPPFLAGS += $(addprefix -I,$(PRIORITY_INCLUDE)) $(INCLUDEPATH)
101 williamc 1.1
102    
103     #
104     # now add our includepath
105     #
106     INCLUDEPATH+=-I$(LOCALTOP)/${INTsrc} -I$(RELEASETOP)/${INTsrc}
107    
108 williamc 1.5 #
109     # Dependency information
110     #
111 williamc 1.9 -include dependencies.mk
112 williamc 1.5
113 williamc 1.17.2.11 #dependencies.mk :: $(clientmakefile)
114 williamc 1.1 #
115     # Process Subdirs
116     #
117     ifdef SUBDIRS
118 williamc 1.12 $(SUBDIRS)::
119 williamc 1.1 @echo ------- Building ---- $@ -----------
120 williamc 1.17.2.3 @if [ -d $(LOCALTOP)/$(ClassDir)/$@ ]; then \
121 williamc 1.17.2.2 cd $(LOCALTOP)/$(ClassDir)/$@; $(TOOL_HOME)/scram build; \
122 williamc 1.17.2.3 else echo SCRAM Warning : $@ does not exist; \
123 williamc 1.17.2.2 fi
124 williamc 1.1 endif
125    
126    
127 williamc 1.17.2.14 #HELPINCLUDEMAKEFILES := ${DefaultBuildFile} ${TOOL_HOME}/toolrules.mk
128 williamc 1.1
129     #
130     #
131     # -- Some error trapping and debug targets
132     #
133    
134     dummy:
135    
136    
137 williamc 1.17.2.19 .PHONY: help clean
138 williamc 1.17.2.15 help::
139 williamc 1.17.2.16 @echo "--------------------------------------------------------"
140     ifndef BINMODE
141     help::
142     @echo "General Targets"
143     @echo "---------------"
144     @echo "clean - clean out the corresponding working directory"
145 williamc 1.17.2.17 @echo "echo_VAR - debugging only, prints out the value of the scram variable VAR"
146 williamc 1.1 @echo "-----------------"
147 williamc 1.17.2.16 endif
148 williamc 1.1
149     exit:
150 williamc 1.17.2.14 @echo "Please Use Scram. Do not use gmake directly."
151 williamc 1.1 @exit 1
152    
153     echo_%:
154     @echo "$(subst echo_,,$@) = $($(subst echo_,,$@))"
155 williamc 1.17.2.14
156 williamc 1.1
157     #
158 williamc 1.17.2.5 # Other non-critical targets
159     #
160    
161     TAGS:
162     etags -o TAGS $(files) $(binfiles)
163    
164     tags:
165     ctags -o tags $(files) $(binfiles)
166    
167     #
168     #
169 williamc 1.1 # clean targets
170     #
171    
172     # make sure the variables will be set before rm -r by ensuring that
173     # it has come through the wrapper script
174    
175     ifdef DefaultMakefile
176 williamc 1.10 clean::
177 williamc 1.1 @echo Cleaning working folder $(workdir)
178 williamc 1.17.2.1 ifdef LOCALTOP
179     ifdef workdir
180 williamc 1.17.2.4 @rm -rf $(LOCALTOP)/$(workdir)/*
181 williamc 1.17.2.1 endif
182     endif
183 williamc 1.1
184     very_clean:
185     @echo Cleaning all working folders in $(INTwork)
186     @cd $(LOCALTOP)/$(INTwork)
187 williamc 1.17.2.1 ifdef LOCALTOP
188     ifdef workdir
189 williamc 1.17.2.9 @rm -rf $(LOCALTOP)/$(INTwork)/*
190 williamc 1.17.2.1 endif
191     endif
192 williamc 1.1 endif
193 williamc 1.17.2.20
194     #
195     # datestamp files
196     #
197 williamc 1.17.2.22 .PHONY: datestamp_config datestamp
198    
199 williamc 1.17.2.20 scramds_%::
200     @$(SCRAM_HOME)/src/scramds $*.ds $*
201    
202     #
203     # rather than tracing all the dependency root - just check all local .ds files
204     #
205     dsfiles=$(wildcard *.ds)
206     releasedsfiles=$(wildcard $(RELEASETOP)/$(workdir)/*.ds)
207    
208 williamc 1.17.2.22 datestamp_config:
209 williamc 1.17.2.20 @if [ "$(dsfiles)" = "" ]; then \
210     if [ "$(releasedsfiles)" != "" ]; then \
211     cp $(releasedsfiles) $(LOCALTOP)/$(workdir); \
212     fi; \
213     fi
214    
215 williamc 1.17.2.22 datestamp: $(addprefix scramds_, $(basename $(dsfiles)))