ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/SCRAM/src/basics.mk
Revision: 1.16
Committed: Tue Apr 6 07:50:31 1999 UTC (26 years, 1 month ago) by williamc
Branch: MAIN
CVS Tags: V0_7
Changes since 1.15: +0 -2 lines
Log Message:
Get library dependencies working

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     #
45     # get build requirements Class
46     #
47     ifdef DefaultBuildFile
48     include ${DefaultBuildFile}
49     endif
50    
51 williamc 1.9 #
52     # Site settings
53     #
54     clientmakefile=$(LOCALTOP)/$(INTwork)/clientmakefile
55     include $(clientmakefile)
56 williamc 1.1
57     #
58     # get build targets
59     #
60 williamc 1.9 include ${TOOL_HOME}/compilers.mk
61 williamc 1.1 include ${TOOL_HOME}/toolrules.mk
62    
63 williamc 1.9
64 williamc 1.1 #
65     # -- Some tool setups which dont yet have a home
66     #
67     CPPFLAGS += $(INCLUDEPATH)
68    
69    
70     #
71     # now add our includepath
72     #
73     INCLUDEPATH+=-I$(LOCALTOP)/${INTsrc} -I$(RELEASETOP)/${INTsrc}
74    
75 williamc 1.5 #
76     # Dependency information
77     #
78 williamc 1.9 -include dependencies.mk
79 williamc 1.5
80 williamc 1.1 #
81     # Process Subdirs
82     #
83     ifdef SUBDIRS
84 williamc 1.12 $(SUBDIRS)::
85 williamc 1.1 @echo ------- Building ---- $@ -----------
86 williamc 1.8 @cd $(LOCALTOP)/$(ClassDir)/$@; $(TOOL_HOME)/scram build
87 williamc 1.1 endif
88    
89     #
90     # clientmakefile creation
91     #
92 williamc 1.11 $(clientmakefile): $(LOCALTOP)/.SCRAM/${SCRAM_ARCH}/clientsettings $(LOCALTOP)/.SCRAM/${SCRAM_ARCH}/clientsettings_reqs $(projdeps) $(TOOL_HOME)/ProcessSiteFile
93 williamc 1.1 @$(TOOL_HOME)/ProcessSiteFile $< $@ $(projdeps)
94    
95     HELPINCLUDEMAKEFILES := ${DefaultBuildFile} ${TOOL_HOME}/toolrules.mk
96    
97     #
98     #
99     # -- Some error trapping and debug targets
100     #
101    
102     dummy:
103    
104    
105     help:
106     @echo "Available Targets"
107     @echo "-----------------"
108     @cat $(HELPINCLUDEMAKEFILES) | grep ':' | grep -v '^[\%\$$]' | \
109     grep -v ':=' | grep -v 'vpath'
110    
111     exit:
112     @echo "Please Use the orcabuild script. Do not use gmake directly."
113     @exit 1
114    
115     echo_%:
116     @echo "$(subst echo_,,$@) = $($(subst echo_,,$@))"
117    
118     #
119     # clean targets
120     #
121    
122     # make sure the variables will be set before rm -r by ensuring that
123     # it has come through the wrapper script
124    
125     ifdef DefaultMakefile
126 williamc 1.10 clean::
127 williamc 1.1 @echo Cleaning working folder $(workdir)
128 williamc 1.13 @rm -rf $(LOCALTOP)/$(workdir)/.* $(LOCALTOP)/$(workdir)/*
129 williamc 1.1
130     very_clean:
131     @echo Cleaning all working folders in $(INTwork)
132     @cd $(LOCALTOP)/$(INTwork)
133     @rm -rf $(LOCALTOP)/$(INTwork)/*.o
134     endif