ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/SCRAM/src/compilers.mk
Revision: 1.14.2.30
Committed: Fri Apr 28 14:33:29 2000 UTC (25 years ago) by williamc
Branch: V0_9branch
CVS Tags: V0_12_7, V0_12_6, V0_12_5, V0_12_4, V0_12_3, V0_12_2
Changes since 1.14.2.29: +9 -9 lines
Log Message:
Add CXXSharedFlags

File Contents

# User Rev Content
1 williamc 1.1 # Compiler Specific Details
2     #
3     #----------------------------------------------
4     # Some standard variables
5     #----------------------------------------------
6     # arlibname : name of library archive etc
7     # shlibname : name of shared object
8     # arlibobjs : name of objects destined for a library archive
9     # sharedlibobjs : name of objects detined for a shared object file
10     #
11     #
12     #
13     #----------------------------------------------
14     # Standard Defaults
15     # Override as necessary for specific compilers
16     #----------------------------------------------
17     CXX=CC
18     CXXDebugFlag=-g
19 williamc 1.14.2.12 CXXO2Flag=-O2
20     CXXOptimised=$(CXXO2Flag)
21     FCO2Flag=-O2
22     FCOptimised=$(FCO2Flag)
23 williamc 1.1 FCDebugFlag=-g
24 williamc 1.7 FC:=f77
25 williamc 1.1
26 williamc 1.14.2.24 # java
27     JAVAC:=javac
28     JAVACG:=javac_g
29     JAVAC_=$(JAVAC)
30     JAVAC_o=$(JAVAC) -O
31     JAVAC_d=$(JAVAC) -g
32     JAVAC_g=$(JAVACG) -O
33     JAVAC_gd=$(JAVACG) -g
34    
35 williamc 1.1 ArchiveSuffix = a
36     ArchiveTool = ar -rc $@ $^
37     ArchiveCCTool = $(ArchiveTool)
38 williamc 1.14.2.18 DebugArchiveCCTool = $(ArchiveTool)
39 williamc 1.14.2.12 SCClinkCmd=$(CXX) $(CXXFLAGS) $(CXXOptimised) $(LDFLAGS) $< -o $@
40 williamc 1.14 SCClinkCmd_d=$(CXX) $(CXXFLAGS) $(CXXDebugFlag) $(LDFLAGS) $< -o $@
41 williamc 1.11 CClinkCmd=$(SCClinkCmd) $(LDLIBS)
42 williamc 1.14 CClinkCmdDebug=$(SCClinkCmd_d) $(LDLIBS_D)
43 williamc 1.14.2.14 CClinkCmdDebugLocal=$(SCClinkCmd_d) $(LDLIBS_D_L)
44 williamc 1.14.2.16 CClinkCmdInsure=$(Insure) $(CXXFLAGS) $(CXXDebugFlag) $(LDFLAGS) $< -o $@ $(LDLIBS_Insure)
45 williamc 1.1
46     SharedCCObjectFlags = -PIC
47     SharedFCObjectFlags = -PIC
48     SharedSuffix =so
49     SharedCCTool = @echo No Shared Library support
50 williamc 1.14.2.13 DebugSharedCCTool = $(SharedCCTool)
51     InsureSharedCCTool = $(DebugSharedCCTool)
52 williamc 1.14.2.22 DependencyCCTool = $(CXX) -M $(CPPFLAGS) $(DependIncludes) $^ > $@
53 williamc 1.14.2.7 PreProcessorCCTool = $(CXX) -P $(CPPFLAGS) $^
54 williamc 1.1
55     #----------------------------------------------
56     # Sun 4.2 CC
57     #----------------------------------------------
58     ifeq ($(CCcompiler),Sun-CC-4.2)
59 williamc 1.14.2.27 CXX=eval `scram runtime -sh`; CC
60 williamc 1.14.2.3 templatedblib=-ptr$(template_dir) -ptr$(RELEASETOP)/$(workdir)/$(template_dir)
61 williamc 1.14.2.19 templatedoblib=-ptrtmpl_o -ptr$(RELEASETOP)/$(workdir)/tmpl_o
62 williamc 1.14.2.11 templatedshlib=-ptr$(templatesh_dir) -ptr$(RELEASETOP)/$(workdir)/$(templatesh_dir)
63 williamc 1.14.2.13 templateddshlib=-ptr$(templateshd_dir) -ptr$(RELEASETOP)/$(workdir)/$(templateshd_dir)
64     templatedinsureshlib=-ptr$(templateshi_dir) -ptr$(RELEASETOP)/$(workdir)/$(templateshi_dir)
65 williamc 1.14.2.4 templatedbin=-ptr$(RELEASETOP)/$(workdir)/$(template_dir)
66 williamc 1.14.2.3 templatedbo=-ptr$(template_dir)
67 williamc 1.14.2.4 SCClinkCmd+=$(templatedbin)
68     SCClinkCmd_d+=$(templatedbin)
69 williamc 1.14.2.3 CXXFLAGS+=$(templatedbo)
70 williamc 1.14.2.18 template_dir=$(shell echo $@ | sed -e 's/.*\(_.*\)\..*/tmpl\1/' -e 's/.*\.o/tmpl/' -e 's/.*\.a/tmpl/' -e 's/.*\.exe/tmpl/')
71 williamc 1.14.2.11 templatesh_dir=tmpl_pic
72 williamc 1.14.2.13 templateshd_dir=tmpl_picd
73 williamc 1.14.2.15 templateshi_dir=tmpl_picInsure
74 williamc 1.14.2.18 ArchiveCCTool = $(CXX) -xar -o $@ $^ $(templatedoblib)
75     DebugArchiveCCTool = $(CXX) -xar -o $@ $^ $(templatedblib)
76 williamc 1.14.2.30 SharedCCTool = $(CXX) -G $(CXXSharedFlags) -o $@ $^ $(templatedshlib)
77     DebugSharedCCTool = $(CXX) -G $(CXXSharedFlags) $(CXXDebugFlag) -o $@ $^ $(templateddshlib)
78     InsureSharedCCTool = $(CXX) -G $(CXXSharedFlags) $(CXXDebugFlag) -o $@ $^ $(templatedinsureshlib)
79 williamc 1.14.2.22 DependencyCCTool = $(CXX) -xM1 $(CPPFLAGS) $(DependIncludes) $^ > $@
80     ifdef defaultcompilerlib$(DependIncludes)
81     PRIORITY_LIBDIR s+=/opt/SUNWspro/SC4.2/lib
82 williamc 1.14.2.20 endif
83 williamc 1.4 ifdef f77
84     extralib+=M77 F77 sunmath m
85     endif
86 williamc 1.14.2.9 ifdef MultiThreaded
87 williamc 1.14.2.8 CXXFLAGS+=-mt
88     endif
89 williamc 1.1 endif
90    
91     #----------------------------------------------
92     # aCC HP-UX
93     #----------------------------------------------
94     ifeq ($(CCcompiler),aCC)
95     CXX=aCC
96     SharedCCObjectFlags = +Z
97     SharedSuffix=sl
98     SharedCCTool=aCC -b $^ -o $@
99 williamc 1.14.2.13 DebugSharedCCTool=aCC $(CXXDebugFlag) -b $^ -o $@
100 williamc 1.4 ifdef f77
101     LIBDIR+=/opt/fortran/lib
102     extralib+=cl isamstub U77 /usr/lib/libdld.sl
103     endif
104 williamc 1.1 endif
105    
106     #----------------------------------------------
107     # gcc Linux
108     #----------------------------------------------
109     ifeq ($(CCcompiler),gcc)
110     CXX=c++
111     SharedCCObjectFlags = -fPIC
112 williamc 1.14.2.30 SharedCCTool = gcc $(CXXSharedFlags) $^ -o $@ -shared -Wl,-soname,$@
113     DebugSharedCCTool = gcc $(CXXSharedFlags) $(CXXDebugFlag) $^ -o $@ -shared -Wl,-soname,$@
114 williamc 1.4 ifdef f77
115     extralib+=f2c m
116     endif
117 williamc 1.1 endif
118    
119     #----------------------------------------------
120     # egcs Linux
121     #----------------------------------------------
122     ifeq ($(CCcompiler),egcs)
123 williamc 1.14.2.26 CXX=eval `scram runtime -sh`; c++
124 williamc 1.1 SharedCCObjectFlags = -fPIC
125 williamc 1.14.2.30 SharedCCTool = $(CXX) $(CXXSharedFlags) $^ -o $@ -shared -Wl,-soname,$@
126     DebugSharedCCTool = $(CXX) $(CXXSharedFlags) $(CXXDebugFlag) $^ -o $@ -shared -Wl,-soname,$@
127 williamc 1.14.2.28 PreProcessorCCTool = $(CXX) -E $(CPPFLAGS) $^ -o $@
128 williamc 1.4 ifdef f77
129     extralib+=g2c m
130     endif
131 williamc 1.7 endif
132    
133     #----------------------------------------------
134 williamc 1.14.2.21 # gcc2.95 Linux
135     #----------------------------------------------
136     ifeq ($(CCcompiler),gcc2.95)
137     CXX=c++
138     SharedCCObjectFlags = -fPIC
139 williamc 1.14.2.30 SharedCCTool = $(CXX) $(CXXSharedFlags) $^ -o $@ -shared -Wl,-soname,$@
140     DebugSharedCCTool = $(CXX) $(CXXSharedFlags) $(CXXDebugFlag) $^ -o $@ -shared -Wl,-soname,$@
141 williamc 1.14.2.29 PreProcessorCCTool = $(CXX) -E $(CPPFLAGS) $^ -o $@
142 williamc 1.14.2.21 ifdef f77
143     extralib+=g2c m
144     endif
145     endif
146    
147     #----------------------------------------------
148 williamc 1.7 # GNU g77 Fortran compiler
149     #----------------------------------------------
150     ifeq ($(F77compiler),g77)
151 williamc 1.14.2.21 SharedFCObjectFlags = -fPIC
152 williamc 1.7 FC:=g77
153 williamc 1.1 endif
154 williamc 1.8
155 williamc 1.14.2.10 #----------------------------------------------
156     # HP-UX Fortran compiler fort77
157     #----------------------------------------------
158     ifeq ($(F77compiler),fort77)
159     FC:=fort77
160     SharedFCObjectFlags = +Z
161     endif
162 williamc 1.8
163     #-----------------------------------------------
164     # Insure++
165     #-----------------------------------------------
166     Insure:=insure
167 williamc 1.9 .psrc :
168 williamc 1.14.2.23 if [ -f .psrc ]; then \
169     rm .psrc; \
170     fi;
171 williamc 1.9 echo insure++.compiler_cpp $(CXX) >> .psrc
172     echo insure++.temp_directory /tmp >> .psrc
173     echo insure++.compiler_default cpp >> .psrc
174     echo insure++.summarize leaks >> .psrc
175 williamc 1.14.2.5
176     #-----------------------------------------------
177     # Macabe
178     #-----------------------------------------------
179     ifdef MCCABE_EXTENSIONS
180     include mccabe.mk
181     endif