ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/SCRAM/src/toolrules.mk
Revision: 1.3
Committed: Mon Mar 22 17:21:20 1999 UTC (26 years, 1 month ago) by williamc
Branch: MAIN
Changes since 1.2: +8 -4 lines
Log Message:
Solve TEMPLATE conflcit problem on SUN

File Contents

# User Rev Content
1 williamc 1.1 # Some Pre-Defined Rules For Building Stuff
2     #
3     include compilers.mk
4 williamc 1.2 lib : dependencies.mk
5     bin : dependencies.mk
6 williamc 1.1
7     #------------------------------------------------
8     # Default Behaviours - interpreted from makefile
9     #------------------------------------------------
10    
11     # -- storage of libraries
12     librarystore:=$(LOCALTOP)/$(INTlib)
13     vpath %.$(SharedSuffix) $(librarystore):$(RELEASETOP)/$(INTlib)
14     vpath %.$(ArchiveSuffix) $(librarystore):$(RELEASETOP)/$(INTlib)
15    
16     # -- library names
17    
18     ifdef libname
19     ifndef arlibname
20     arlibname=$(libname)
21     endif
22     ifndef shlibname
23     shlibname=$(libname)
24     endif
25     endif
26    
27     # -- Libray type defaults
28    
29     ifdef DefaultShared
30     lib : $(shlibname).$(SharedSuffix)
31     MakeLib=yes
32     endif
33     ifdef DefaultDebugShared
34     lib : $(shlibname)_d.$(SharedSuffix)
35     MakeLib=yes
36     endif
37     ifdef DefaultArchive
38     lib : $(arlibname).$(ArchiveSuffix)
39     MakeLib=yes
40     endif
41     ifdef DefaultDebugArchive
42     lib : $(arlibname)_d.$(ArchiveSuffix)
43     MakeLib=yes
44     endif
45    
46     ifdef MakeLib
47     all: lib
48     endif
49    
50     #------------------------------------------------
51     # Set up some system variables
52     # - all begin with S
53     #------------------------------------------------
54    
55     Sarchivelibobjs:=$(addsuffix .o,$(archivefiles))
56     Sarchivelibdebugobjs:=$(addsuffix _d.o,$(archivefiles))
57     Ssharedlibobjs:=$(addsuffix _pic.o,$(sharedfiles))
58     Ssharedlibdebugobjs:=$(addsuffix _picd.o,$(sharedfiles))
59    
60     #------------------------------------------------
61     # Rules Start Here
62     #------------------------------------------------
63    
64     # Implicit Rules first
65     # -- Standard Shared Objects
66     %_pic.o : %.cpp
67     $(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $(SharedCCObjectFlags) $< -o $@
68     %_pic.o : %.C
69     $(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $(SharedCCObjectFlags) $< -o $@
70     %_pic.o : %.cc
71     $(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $(SharedCCObjectFlags) $< -o $@
72     %_pic.o : %.F
73     $(FC) -c $(CPPFLAGS) $(FFLAGS) $(SharedFCObjectFlags) $< -o $@
74     %_pic.o : %.f
75     $(FC) -c $(CPPFLAGS) $(FFLAGS) $(SharedFCObjectFlags) $< -o $@
76    
77     # -- Debug Shared Objects
78     %_picd.o : %.cc
79     $(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $(CXXDebugFlag) $(SharedCCObjectFlags) $< -o $@
80    
81     %_picd.o : %.C
82     $(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $(CXXDebugFlag) $(SharedCCObjectFlags) $< -o $@
83    
84     %_picd.o : %.cpp
85     $(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $(CXXDebugFlag) $(SharedCCObjectFlags) $< -o $@
86    
87     %_picd.o : %.F
88     $(FC) -c $(CPPFLAGS) $(FFLAGS) $(FCDebugFlag) $(SharedFCObjectFlags) $< -o $@
89    
90     %_picd.o : %.f
91     $(FC) -c $(CPPFLAGS) $(FFLAGS) $(FCDebugFlag) $(SharedFCObjectFlags) $< -o $@
92     # -- Standard Archive Libs
93     # Already built in
94    
95     # -- Debug Archive Libs
96     %_d.o : %.cpp
97     $(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $(CXXDebugFlag) $< -o $@
98    
99     %_d.o : %.cc
100     $(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $(CXXDebugFlag) $< -o $@
101    
102     %_d.o : %.C
103     $(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $(CXXDebugFlag) $< -o $@
104    
105     %_d.o : %.F
106     $(FC) -c $(CPPFLAGS) $(FFLAGS) $(FCDebugFlag) $< -o $@
107    
108     %_d.o : %.f
109     $(FC) -c $(CPPFLAGS) $(FFLAGS) $(FCDebugFlag) $< -o $@
110    
111     # Some nice generic target names for the user
112    
113     shared : $(shlibname).$(SharedSuffix)
114     shared_debug : $(shlibname)_d.$(SharedSuffix)
115     archive : $(arlibname).$(ArchiveSuffix)
116     archive_debug : $(arlibname)_d.$(ArchiveSuffix)
117    
118     # Now more specific rules
119    
120     # -- Standard Shared Objects Libs
121 williamc 1.3 $(shlibname)_pic.$(SharedSuffix) : $(Ssharedlibobjs)
122 williamc 1.1 $(SharedCCTool)
123 williamc 1.3
124     $(shlibname).$(SharedSuffix) : $(shlibname)_pic.$(SharedSuffix)
125     @mv $< $(librarystore)/$@
126 williamc 1.1
127     # -- Debug Shared Objects Libs
128 williamc 1.3 $(shlibname)_picd.$(SharedSuffix) : $(Ssharedlibdebugobjs)
129 williamc 1.1 $(SharedCCTool)
130 williamc 1.3
131     $(shlibname)_picd.$(SharedSuffix) : $(Ssharedlibdebugobjs)
132     @mv $< $(librarystore)/$@
133 williamc 1.1
134     # -- Standard Archive Libs
135     $(arlibname).$(ArchiveSuffix) : $(Sarchivelibobjs)
136     $(ArchiveCCTool)
137     @mv $@ $(librarystore)
138    
139     # -- Debug Archive Libs
140     $(arlibname)_d.$(ArchiveSuffix) : $(Sarchivelibdebugobjs)
141     $(ArchiveCCTool)
142     @mv $@ $(librarystore)
143 williamc 1.2
144     # -- Dependencies
145     dependencies.mk: $(files)
146     @$(DependencyCCTool)
147     @$(TOOL_HOME)/DependencyMangler $@