ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/SCRAM/src/basics.mk
Revision: 1.17.2.24.2.1.2.1
Committed: Mon Oct 23 10:13:34 2000 UTC (24 years, 6 months ago) by williamc
Branch: V0_15branch
Changes since 1.17.2.24.2.1: +2 -1 lines
Log Message:
Add ProductStore mechanism

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