ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/SCRAM/src/basics.mk
Revision: 1.17.2.3
Committed: Wed Apr 28 16:01:59 1999 UTC (26 years ago) by williamc
Branch: V0_9branch
CVS Tags: V0_9_14, V0_9_13, V0_9_12, V0_9_11, V0_9_10, V0_9_9, V0_9_8, V0_9_7, V0_9_6, V0_9_5, V0_9_4, V0_9_3, V0_9_2
Changes since 1.17.2.2: +2 -2 lines
Log Message:
Trap missing directories before cd ing into them

File Contents

# Content
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 # -- storage of libraries
14 librarystore:=$(LOCALTOP)/$(INTlib)
15
16 libsavaillocal=$(notdir $(wildcard $(librarystore)/*))
17 libsavailbase=$(notdir $(wildcard $(RELEASETOP)/$(INTlib)/*))
18 libsavail=$(sort $(libsavailbase) $(libsavaillocal))
19 libslocal=$(foreach var,$(lib),$(filter lib$(var).a, $(libsavail)))
20 libslocal_I=$(foreach var,$(lib_I),$(filter lib$(var).a, $(libsavail)))
21 libslocal_d=$(foreach var,$(lib_d),$(filter lib$(var).a, $(libsavail)))
22
23 #
24 # Pointing to file storage locations for the various types
25 #
26 # -- src code and unspecified types
27 VPATH:=$(LOCALTOP)/$(ClassDir):$(RELEASETOP)/$(ClassDir)
28 # -- .o files will be kept in the working directory
29 vpath %.o $(LOCALTOP)/$(workdir):$(RELEASETOP)/$(workdir)
30
31 #
32 ifdef ReqDependencies
33 always:$(LOCALTOP)/$(workdir)/PackageReqs
34 $(LOCALTOP)/$(workdir)/PackageReqs:$(ReqDependencies)
35 $(TOOL_HOME)/BuildPackageReqs $@ $?
36 endif
37
38 #
39 # Get local mods
40 #
41 ifdef LatestBuildFile
42 include ${LatestBuildFile}
43 endif
44
45 #
46 # get build requirements Class
47 #
48 ifdef DefaultBuildFile
49 include ${DefaultBuildFile}
50 endif
51
52 #
53 # Site settings
54 #
55 clientmakefile=$(LOCALTOP)/$(INTwork)/clientmakefile
56 -include $(clientmakefile)
57
58 #
59 # get build targets
60 #
61 include ${TOOL_HOME}/compilers.mk
62 include ${TOOL_HOME}/toolrules.mk
63
64
65 #
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 #
77 # Dependency information
78 #
79 -include dependencies.mk
80
81 #
82 # Process Subdirs
83 #
84 ifdef SUBDIRS
85 $(SUBDIRS)::
86 @echo ------- Building ---- $@ -----------
87 @if [ -d $(LOCALTOP)/$(ClassDir)/$@ ]; then \
88 cd $(LOCALTOP)/$(ClassDir)/$@; $(TOOL_HOME)/scram build; \
89 else echo SCRAM Warning : $@ does not exist; \
90 fi
91 endif
92
93 #
94 # clientmakefile creation
95 #
96 $(clientmakefile): $(LOCALTOP)/.SCRAM/${SCRAM_ARCH}/clientsettings $(LOCALTOP)/.SCRAM/${SCRAM_ARCH}/clientsettings_reqs $(projdeps) $(TOOL_HOME)/ProcessSiteFile
97 @$(TOOL_HOME)/ProcessSiteFile $< $@ $(projdeps)
98
99 HELPINCLUDEMAKEFILES := ${DefaultBuildFile} ${TOOL_HOME}/toolrules.mk
100
101 #
102 #
103 # -- Some error trapping and debug targets
104 #
105
106 dummy:
107
108
109 help:
110 @echo "Available Targets"
111 @echo "-----------------"
112 @cat $(HELPINCLUDEMAKEFILES) | grep ':' | grep -v '^[\%\$$]' | \
113 grep -v ':=' | grep -v 'vpath'
114
115 exit:
116 @echo "Please Use the orcabuild script. Do not use gmake directly."
117 @exit 1
118
119 echo_%:
120 @echo "$(subst echo_,,$@) = $($(subst echo_,,$@))"
121
122 #
123 # clean targets
124 #
125
126 # make sure the variables will be set before rm -r by ensuring that
127 # it has come through the wrapper script
128
129 ifdef DefaultMakefile
130 clean::
131 @echo Cleaning working folder $(workdir)
132 ifdef LOCALTOP
133 ifdef workdir
134 @rm -rf $(LOCALTOP)/$(workdir)/.* $(LOCALTOP)/$(workdir)/*
135 endif
136 endif
137
138 very_clean:
139 @echo Cleaning all working folders in $(INTwork)
140 @cd $(LOCALTOP)/$(INTwork)
141 ifdef LOCALTOP
142 ifdef workdir
143 @rm -rf $(LOCALTOP)/$(INTwork)/*.o
144 endif
145 endif
146 endif