ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/SCRAM/src/basics.mk
Revision: 1.17.2.9
Committed: Tue Oct 5 12:48:54 1999 UTC (25 years, 7 months ago) by williamc
Branch: V0_9branch
CVS Tags: V0_9_38
Changes since 1.17.2.8: +5 -6 lines
Log Message:
rm clientmakefile rules to a seperate process and ensure dependecies.mk is dependent

File Contents

# Content
1 #
2 # Preliminaries
3 #
4 LIBDIR=$(LOCALTOP)/lib/$(SCRAM_ARCH) $(RELEASETOP)/lib/$(SCRAM_ARCH) $(PRIORITY_LIBDIR)
5
6 CXXFLAGS+=$(CXXUSERFLAGS)
7
8 #
9 # Make sure nobody tries to run this directly through gmake
10 #
11 ifndef DefaultMakefile
12 all: exit
13 endif
14
15
16 # -- storage of libraries
17 librarystore:=$(LOCALTOP)/$(INTlib)
18
19 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
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 $(LOCALTOP)/$(workdir)/PackageReqs:$(ReqDependencies)
38 $(TOOL_HOME)/BuildPackageReqs $@ $?
39 endif
40
41
42 #
43 # Get local mods
44 #
45 ifdef LatestBuildFile
46 include ${LatestBuildFile}
47 endif
48
49 #
50 # get build requirements Class
51 #
52 ifdef DefaultBuildFile
53 include ${DefaultBuildFile}
54 endif
55
56 #
57 # Site settings
58 #
59 clientmakefile=$(LOCALTOP)/$(INTwork)/clientmakefile
60 -include $(clientmakefile)
61
62
63 #
64 # get build targets
65 #
66 include ${TOOL_HOME}/compilers.mk
67 include ${TOOL_HOME}/toolrules.mk
68
69
70 #
71 # -- Some tool setups which dont yet have a home
72 #
73 CPPFLAGS += $(addprefix -I,$(PRIORITY_INCLUDE)) $(INCLUDEPATH)
74
75
76 #
77 # now add our includepath
78 #
79 INCLUDEPATH+=-I$(LOCALTOP)/${INTsrc} -I$(RELEASETOP)/${INTsrc}
80
81 #
82 # Dependency information
83 #
84 dependencies.mk : $(clientmakefile)
85 -include dependencies.mk
86
87 #
88 # Process Subdirs
89 #
90 ifdef SUBDIRS
91 $(SUBDIRS)::
92 @echo ------- Building ---- $@ -----------
93 @if [ -d $(LOCALTOP)/$(ClassDir)/$@ ]; then \
94 cd $(LOCALTOP)/$(ClassDir)/$@; $(TOOL_HOME)/scram build; \
95 else echo SCRAM Warning : $@ does not exist; \
96 fi
97 endif
98
99
100 HELPINCLUDEMAKEFILES := ${DefaultBuildFile} ${TOOL_HOME}/toolrules.mk
101
102 #
103 #
104 # -- Some error trapping and debug targets
105 #
106
107 dummy:
108
109
110 help:
111 @echo "Available Targets"
112 @echo "-----------------"
113 @cat $(HELPINCLUDEMAKEFILES) | grep ':' | grep -v '^[\%\$$]' | \
114 grep -v ':=' | grep -v 'vpath'
115
116 exit:
117 @echo "Please Use the orcabuild script. Do not use gmake directly."
118 @exit 1
119
120 echo_%:
121 @echo "$(subst echo_,,$@) = $($(subst echo_,,$@))"
122
123 #
124 # Other non-critical targets
125 #
126
127 TAGS:
128 etags -o TAGS $(files) $(binfiles)
129
130 tags:
131 ctags -o tags $(files) $(binfiles)
132
133 #
134 #
135 # clean targets
136 #
137
138 # make sure the variables will be set before rm -r by ensuring that
139 # it has come through the wrapper script
140
141 ifdef DefaultMakefile
142 clean::
143 @echo Cleaning working folder $(workdir)
144 ifdef LOCALTOP
145 ifdef workdir
146 @rm -rf $(LOCALTOP)/$(workdir)/*
147 endif
148 endif
149
150 very_clean:
151 @echo Cleaning all working folders in $(INTwork)
152 @cd $(LOCALTOP)/$(INTwork)
153 ifdef LOCALTOP
154 ifdef workdir
155 @rm -rf $(LOCALTOP)/$(INTwork)/*
156 endif
157 endif
158 endif