ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/SCRAM/src/basics.mk
Revision: 1.17.2.23
Committed: Thu May 18 13:16:52 2000 UTC (25 years ago) by williamc
Branch: V0_9branch
CVS Tags: V0_12_8
Changes since 1.17.2.22: +11 -0 lines
Log Message:
Add scrambuild target

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