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