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