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

# User Rev Content
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 williamc 1.15
16 williamc 1.14 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 williamc 1.1
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 williamc 1.11 $(LOCALTOP)/$(workdir)/PackageReqs:$(ReqDependencies)
35 williamc 1.1 $(TOOL_HOME)/BuildPackageReqs $@ $?
36     endif
37    
38     #
39     # Get local mods
40     #
41     ifdef LatestBuildFile
42     include ${LatestBuildFile}
43     endif
44 williamc 1.17.2.2
45 williamc 1.1 #
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 williamc 1.17 -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.17.2.3 @if [ -d $(LOCALTOP)/$(ClassDir)/$@ ]; then \
88 williamc 1.17.2.2 cd $(LOCALTOP)/$(ClassDir)/$@; $(TOOL_HOME)/scram build; \
89 williamc 1.17.2.3 else echo SCRAM Warning : $@ does not exist; \
90 williamc 1.17.2.2 fi
91 williamc 1.1 endif
92    
93     #
94     # clientmakefile creation
95     #
96 williamc 1.11 $(clientmakefile): $(LOCALTOP)/.SCRAM/${SCRAM_ARCH}/clientsettings $(LOCALTOP)/.SCRAM/${SCRAM_ARCH}/clientsettings_reqs $(projdeps) $(TOOL_HOME)/ProcessSiteFile
97 williamc 1.1 @$(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 williamc 1.10 clean::
131 williamc 1.1 @echo Cleaning working folder $(workdir)
132 williamc 1.17.2.1 ifdef LOCALTOP
133     ifdef workdir
134 williamc 1.13 @rm -rf $(LOCALTOP)/$(workdir)/.* $(LOCALTOP)/$(workdir)/*
135 williamc 1.17.2.1 endif
136     endif
137 williamc 1.1
138     very_clean:
139     @echo Cleaning all working folders in $(INTwork)
140     @cd $(LOCALTOP)/$(INTwork)
141 williamc 1.17.2.1 ifdef LOCALTOP
142     ifdef workdir
143 williamc 1.1 @rm -rf $(LOCALTOP)/$(INTwork)/*.o
144 williamc 1.17.2.1 endif
145     endif
146 williamc 1.1 endif