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