1 |
williamc |
1.1 |
#
|
2 |
|
|
# Preliminaries
|
3 |
|
|
#
|
4 |
williamc |
1.3 |
LIBDIR:=$(LOCALTOP)/lib/$(SCRAM_ARCH) $(RELEASETOP)/lib/$(SCRAM_ARCH)
|
5 |
williamc |
1.1 |
|
6 |
|
|
#
|
7 |
|
|
# Make sure nobody tries to run this directly through gmake
|
8 |
|
|
#
|
9 |
|
|
ifndef DefaultMakefile
|
10 |
|
|
all: exit
|
11 |
|
|
endif
|
12 |
|
|
|
13 |
williamc |
1.14 |
# -- storage of libraries
|
14 |
|
|
librarystore:=$(LOCALTOP)/$(INTlib)
|
15 |
|
|
vpath %.$(SharedSuffix) $(librarystore):$(RELEASETOP)/$(INTlib)
|
16 |
|
|
vpath %.$(ArchiveSuffix) $(librarystore):$(RELEASETOP)/$(INTlib)
|
17 |
|
|
libsavaillocal=$(notdir $(wildcard $(librarystore)/*))
|
18 |
|
|
libsavailbase=$(notdir $(wildcard $(RELEASETOP)/$(INTlib)/*))
|
19 |
|
|
libsavail=$(sort $(libsavailbase) $(libsavaillocal))
|
20 |
|
|
libslocal=$(foreach var,$(lib),$(filter lib$(var).a, $(libsavail)))
|
21 |
|
|
libslocal_I=$(foreach var,$(lib_I),$(filter lib$(var).a, $(libsavail)))
|
22 |
|
|
libslocal_d=$(foreach var,$(lib_d),$(filter lib$(var).a, $(libsavail)))
|
23 |
williamc |
1.1 |
|
24 |
|
|
#
|
25 |
|
|
# Pointing to file storage locations for the various types
|
26 |
|
|
#
|
27 |
|
|
# -- src code and unspecified types
|
28 |
|
|
VPATH:=$(LOCALTOP)/$(ClassDir):$(RELEASETOP)/$(ClassDir)
|
29 |
|
|
# -- .o files will be kept in the working directory
|
30 |
|
|
vpath %.o $(LOCALTOP)/$(workdir):$(RELEASETOP)/$(workdir)
|
31 |
|
|
|
32 |
|
|
#
|
33 |
|
|
ifdef ReqDependencies
|
34 |
|
|
always:$(LOCALTOP)/$(workdir)/PackageReqs
|
35 |
williamc |
1.11 |
$(LOCALTOP)/$(workdir)/PackageReqs:$(ReqDependencies)
|
36 |
williamc |
1.1 |
$(TOOL_HOME)/BuildPackageReqs $@ $?
|
37 |
|
|
endif
|
38 |
|
|
|
39 |
|
|
#
|
40 |
|
|
# Get local mods
|
41 |
|
|
#
|
42 |
|
|
ifdef LatestBuildFile
|
43 |
|
|
include ${LatestBuildFile}
|
44 |
|
|
endif
|
45 |
|
|
#
|
46 |
|
|
# get build requirements Class
|
47 |
|
|
#
|
48 |
|
|
ifdef DefaultBuildFile
|
49 |
|
|
include ${DefaultBuildFile}
|
50 |
|
|
endif
|
51 |
|
|
|
52 |
williamc |
1.9 |
#
|
53 |
|
|
# Site settings
|
54 |
|
|
#
|
55 |
|
|
clientmakefile=$(LOCALTOP)/$(INTwork)/clientmakefile
|
56 |
|
|
include $(clientmakefile)
|
57 |
williamc |
1.1 |
|
58 |
|
|
#
|
59 |
|
|
# get build targets
|
60 |
|
|
#
|
61 |
williamc |
1.9 |
include ${TOOL_HOME}/compilers.mk
|
62 |
williamc |
1.1 |
include ${TOOL_HOME}/toolrules.mk
|
63 |
|
|
|
64 |
williamc |
1.9 |
|
65 |
williamc |
1.1 |
#
|
66 |
|
|
# -- Some tool setups which dont yet have a home
|
67 |
|
|
#
|
68 |
|
|
CPPFLAGS += $(INCLUDEPATH)
|
69 |
|
|
|
70 |
|
|
|
71 |
|
|
#
|
72 |
|
|
# now add our includepath
|
73 |
|
|
#
|
74 |
|
|
INCLUDEPATH+=-I$(LOCALTOP)/${INTsrc} -I$(RELEASETOP)/${INTsrc}
|
75 |
|
|
|
76 |
williamc |
1.5 |
#
|
77 |
|
|
# Dependency information
|
78 |
|
|
#
|
79 |
williamc |
1.9 |
-include dependencies.mk
|
80 |
williamc |
1.5 |
|
81 |
williamc |
1.1 |
#
|
82 |
|
|
# Process Subdirs
|
83 |
|
|
#
|
84 |
|
|
ifdef SUBDIRS
|
85 |
williamc |
1.12 |
$(SUBDIRS)::
|
86 |
williamc |
1.1 |
@echo ------- Building ---- $@ -----------
|
87 |
williamc |
1.8 |
@cd $(LOCALTOP)/$(ClassDir)/$@; $(TOOL_HOME)/scram build
|
88 |
williamc |
1.1 |
endif
|
89 |
|
|
|
90 |
|
|
#
|
91 |
|
|
# clientmakefile creation
|
92 |
|
|
#
|
93 |
williamc |
1.11 |
$(clientmakefile): $(LOCALTOP)/.SCRAM/${SCRAM_ARCH}/clientsettings $(LOCALTOP)/.SCRAM/${SCRAM_ARCH}/clientsettings_reqs $(projdeps) $(TOOL_HOME)/ProcessSiteFile
|
94 |
williamc |
1.1 |
@$(TOOL_HOME)/ProcessSiteFile $< $@ $(projdeps)
|
95 |
|
|
|
96 |
|
|
HELPINCLUDEMAKEFILES := ${DefaultBuildFile} ${TOOL_HOME}/toolrules.mk
|
97 |
|
|
|
98 |
|
|
#
|
99 |
|
|
#
|
100 |
|
|
# -- Some error trapping and debug targets
|
101 |
|
|
#
|
102 |
|
|
|
103 |
|
|
dummy:
|
104 |
|
|
|
105 |
|
|
|
106 |
|
|
help:
|
107 |
|
|
@echo "Available Targets"
|
108 |
|
|
@echo "-----------------"
|
109 |
|
|
@cat $(HELPINCLUDEMAKEFILES) | grep ':' | grep -v '^[\%\$$]' | \
|
110 |
|
|
grep -v ':=' | grep -v 'vpath'
|
111 |
|
|
|
112 |
|
|
exit:
|
113 |
|
|
@echo "Please Use the orcabuild script. Do not use gmake directly."
|
114 |
|
|
@exit 1
|
115 |
|
|
|
116 |
|
|
echo_%:
|
117 |
|
|
@echo "$(subst echo_,,$@) = $($(subst echo_,,$@))"
|
118 |
|
|
|
119 |
|
|
#
|
120 |
|
|
# clean targets
|
121 |
|
|
#
|
122 |
|
|
|
123 |
|
|
# make sure the variables will be set before rm -r by ensuring that
|
124 |
|
|
# it has come through the wrapper script
|
125 |
|
|
|
126 |
|
|
ifdef DefaultMakefile
|
127 |
williamc |
1.10 |
clean::
|
128 |
williamc |
1.1 |
@echo Cleaning working folder $(workdir)
|
129 |
williamc |
1.13 |
@rm -rf $(LOCALTOP)/$(workdir)/.* $(LOCALTOP)/$(workdir)/*
|
130 |
williamc |
1.1 |
|
131 |
|
|
very_clean:
|
132 |
|
|
@echo Cleaning all working folders in $(INTwork)
|
133 |
|
|
@cd $(LOCALTOP)/$(INTwork)
|
134 |
|
|
@rm -rf $(LOCALTOP)/$(INTwork)/*.o
|
135 |
|
|
endif
|