ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/SCRAM/src/compilers.mk
Revision: 1.14.2.12
Committed: Tue Sep 14 11:51:09 1999 UTC (25 years, 8 months ago) by williamc
Branch: V0_9branch
Changes since 1.14.2.11: +5 -1 lines
Log Message:
Add Optimisation as defualt for non-debug

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     ArchiveSuffix = a
27     ArchiveTool = ar -rc $@ $^
28     ArchiveCCTool = $(ArchiveTool)
29 williamc 1.14.2.12 SCClinkCmd=$(CXX) $(CXXFLAGS) $(CXXOptimised) $(LDFLAGS) $< -o $@
30 williamc 1.14 SCClinkCmd_d=$(CXX) $(CXXFLAGS) $(CXXDebugFlag) $(LDFLAGS) $< -o $@
31 williamc 1.11 CClinkCmd=$(SCClinkCmd) $(LDLIBS)
32 williamc 1.14 CClinkCmdDebug=$(SCClinkCmd_d) $(LDLIBS_D)
33     CClinkCmdInsure=$(SCClinkCmd_d) $(LDLIBS_Insure)
34 williamc 1.1
35     SharedCCObjectFlags = -PIC
36     SharedFCObjectFlags = -PIC
37     SharedSuffix =so
38     SharedCCTool = @echo No Shared Library support
39 williamc 1.14.2.1 DependencyCCTool = $(CXX) -M $(CPPFLAGS) $^ > $@
40 williamc 1.14.2.7 PreProcessorCCTool = $(CXX) -P $(CPPFLAGS) $^
41 williamc 1.1
42     #----------------------------------------------
43     # Sun 4.2 CC
44     #----------------------------------------------
45     ifeq ($(CCcompiler),Sun-CC-4.2)
46 williamc 1.10 CXX=CC
47 williamc 1.14.2.3 templatedblib=-ptr$(template_dir) -ptr$(RELEASETOP)/$(workdir)/$(template_dir)
48 williamc 1.14.2.11 templatedshlib=-ptr$(templatesh_dir) -ptr$(RELEASETOP)/$(workdir)/$(templatesh_dir)
49 williamc 1.14.2.4 templatedbin=-ptr$(RELEASETOP)/$(workdir)/$(template_dir)
50 williamc 1.14.2.3 templatedbo=-ptr$(template_dir)
51 williamc 1.14.2.4 SCClinkCmd+=$(templatedbin)
52     SCClinkCmd_d+=$(templatedbin)
53 williamc 1.14.2.3 CXXFLAGS+=$(templatedbo)
54 williamc 1.6 template_dir=$(shell echo $@ | sed -e 's/.*\(_.*\)\..*/tmpl\1/' -e 's/.*.o/tmpl/' -e 's/.*.a/tmpl/' -e 's/.*.exe/tmpl/')
55 williamc 1.14.2.11 templatesh_dir=tmpl_pic
56 williamc 1.14.2.3 ArchiveCCTool = $(CXX) -xar -o $@ $^ $(templatedblib)
57 williamc 1.14.2.11 SharedCCTool = $(CXX) -G -o $@ $^ $(templatedshlib)
58 williamc 1.10 DependencyCCTool = $(CXX) -xM1 $(CPPFLAGS) $^ > $@
59 williamc 1.4 ifdef f77
60     extralib+=M77 F77 sunmath m
61     endif
62 williamc 1.14.2.9 ifdef MultiThreaded
63 williamc 1.14.2.8 CXXFLAGS+=-mt
64     endif
65 williamc 1.1 endif
66    
67     #----------------------------------------------
68     # aCC HP-UX
69     #----------------------------------------------
70     ifeq ($(CCcompiler),aCC)
71     CXX=aCC
72     SharedCCObjectFlags = +Z
73     SharedSuffix=sl
74     SharedCCTool=aCC -b $^ -o $@
75 williamc 1.4 ifdef f77
76     LIBDIR+=/opt/fortran/lib
77     extralib+=cl isamstub U77 /usr/lib/libdld.sl
78     endif
79 williamc 1.1 endif
80    
81     #----------------------------------------------
82     # gcc Linux
83     #----------------------------------------------
84     ifeq ($(CCcompiler),gcc)
85     CXX=c++
86     SharedCCObjectFlags = -fPIC
87     SharedCCTool = gcc $^ -o $@ -shared -Wl,-soname,$@
88 williamc 1.4 ifdef f77
89     extralib+=f2c m
90     endif
91 williamc 1.1 endif
92    
93     #----------------------------------------------
94     # egcs Linux
95     #----------------------------------------------
96     ifeq ($(CCcompiler),egcs)
97     CXX=c++
98     SharedCCObjectFlags = -fPIC
99     SharedCCTool = $(CXX) $^ -o $@ -shared -Wl,-soname,$@
100 williamc 1.4 ifdef f77
101     extralib+=g2c m
102     endif
103 williamc 1.7 endif
104    
105     #----------------------------------------------
106     # GNU g77 Fortran compiler
107     #----------------------------------------------
108     ifeq ($(F77compiler),g77)
109     FC:=g77
110 williamc 1.1 endif
111 williamc 1.8
112 williamc 1.14.2.10 #----------------------------------------------
113     # HP-UX Fortran compiler fort77
114     #----------------------------------------------
115     ifeq ($(F77compiler),fort77)
116     FC:=fort77
117     SharedFCObjectFlags = +Z
118     endif
119 williamc 1.8
120     #-----------------------------------------------
121     # Insure++
122     #-----------------------------------------------
123     Insure:=insure
124 williamc 1.9 .psrc :
125     -@rm .psrc
126     echo insure++.compiler_cpp $(CXX) >> .psrc
127     echo insure++.temp_directory /tmp >> .psrc
128     echo insure++.compiler_default cpp >> .psrc
129     echo insure++.summarize leaks >> .psrc
130 williamc 1.14.2.5
131     #-----------------------------------------------
132     # Macabe
133     #-----------------------------------------------
134     ifdef MCCABE_EXTENSIONS
135     include mccabe.mk
136     endif