5
|
1 # |
|
2 # Common configuration rules for all of octave's Makefiles. |
|
3 # |
|
4 # John W. Eaton |
|
5 # jwe@che.utexas.edu |
|
6 # Department of Chemical Engineering |
|
7 # The University of Texas at Austin |
|
8 |
|
9 SHELL = /bin/sh |
|
10 |
|
11 #### Start of system configuration section. #### |
|
12 |
236
|
13 # The top of the directory tree where the sources live. |
404
|
14 top_srcdir = @top_srcdir@ |
236
|
15 |
5
|
16 LEX = @LEX@ |
|
17 LFLAGS = @LFLAGS@ |
|
18 LEXLIB = @LEXLIB@ |
|
19 |
|
20 YACC = @YACC@ |
|
21 YFLAGS = -dv |
|
22 |
|
23 INSTALL = @INSTALL@ |
169
|
24 INSTALL_PROGRAM = @INSTALL_PROGRAM@ |
5
|
25 INSTALL_DATA = @INSTALL_DATA@ |
|
26 |
|
27 RANLIB = @RANLIB@ |
|
28 |
|
29 RUNTEST = @RUNTEST@ |
|
30 |
|
31 DEFAULT_PAGER = @DEFAULT_PAGER@ |
|
32 |
|
33 # Fortran to C translator and associated flags. |
|
34 |
|
35 F2C = @F2C@ |
|
36 F2CFLAGS = @F2CFLAGS@ |
|
37 |
|
38 # Fortran compiler flags. |
|
39 |
|
40 FFLAGS = @FFLAGS@ |
|
41 |
|
42 # cc and associated flags. |
|
43 |
236
|
44 # Clean up INCFLAGS a bit if we are not compiling in a separate |
|
45 # directory. |
|
46 ifeq ($(srcdir),.) |
|
47 TMP_IF_1 = -I. |
|
48 else |
|
49 TMP_IF_1 = -I. -I$(srcdir) |
|
50 endif |
404
|
51 ifeq ($(TOPDIR),$(top_srcdir)) |
236
|
52 TMP_IF_2 = -I$(TOPDIR) -I$(TOPDIR)/liboctave |
|
53 else |
|
54 TMP_IF_2 = -I$(TOPDIR) -I$(TOPDIR)/liboctave \ |
404
|
55 -I$(top_srcdir) -I$(top_srcdir)/liboctave |
236
|
56 endif |
|
57 INCFLAGS = $(TMP_IF_1) $(TMP_IF_2) |
|
58 |
5
|
59 LIBFLAGS = -L$(TOPDIR) |
236
|
60 |
5
|
61 DEFS = @DEFS@ |
236
|
62 UGLY_DEFS = @UGLY_DEFS@ |
5
|
63 |
|
64 CC = @CC@ |
|
65 CFLAGS = @CFLAGS@ |
325
|
66 GCC_IEEE_FP_FLAG = @GCC_IEEE_FP_FLAG@ |
|
67 ALL_CFLAGS = $(INCFLAGS) $(DEFS) $(GCC_IEEE_FP_FLAG) $(CFLAGS) |
|
68 UGLY_ALL_CFLAGS = $(INCFLAGS) $(UGLY_DEFS) $(GCC_IEEE_FP_FLAG) $(CFLAGS) |
5
|
69 |
198
|
70 CXX = @CXX@ |
|
71 CXXFLAGS = @CXXFLAGS@ |
281
|
72 EXTERNAL_TEMPLATES = @EXTERNAL_TEMPLATES@ |
324
|
73 ALL_CXXFLAGS = $(INCFLAGS) $(DEFS) $(EXTERNAL_TEMPLATES) \ |
325
|
74 $(GCC_IEEE_FP_FLAG) $(CXXFLAGS) |
324
|
75 UGLY_ALL_CXXFLAGS = $(INCFLAGS) $(UGLY_DEFS) $(EXTERNAL_TEMPLATES) \ |
325
|
76 $(GCC_IEEE_FP_FLAG) $(CXXFLAGS) |
5
|
77 |
|
78 LDFLAGS = @LDFLAGS@ |
325
|
79 ALL_LDFLAGS = $(LIBFLAGS) $(GCC_IEEE_FP_FLAG) $(LDFLAGS) |
5
|
80 |
|
81 FLIBS = @FLIBS@ |
|
82 |
|
83 # A shell command to extract the version number from version.h. |
|
84 getversion = sed -e '/version_string/!d' -e 's/[^0-9.]*\([0-9.]*\).*/\1/' -e q |
|
85 |
|
86 # The version number. TOPDIR is something like `.' or `..' or `../..' |
|
87 # and gets us back up to the top level of the source tree. |
|
88 version = `$(getversion) $(srcdir)/$(TOPDIR)/src/version.h` |
|
89 |
|
90 # Common prefix for installation directories. |
|
91 # NOTE: This directory must exist when you start installation. |
|
92 prefix = /usr/local |
|
93 |
|
94 # Directory in which to put host dependent programs and libraries |
|
95 exec_prefix = $(prefix) |
|
96 |
|
97 # Where to install the executables. |
|
98 bindir = $(exec_prefix)/bin |
|
99 |
|
100 # Where to put libraries like libcruft.a, liboctave.a, and libreadline.a |
|
101 libdir = $(exec_prefix)/lib |
|
102 |
|
103 # Where octave will look for M-files |
|
104 libsubdir = $(libdir)/octave/$(version) |
|
105 |
|
106 # Where to put the manual pages. |
|
107 mandir = $(prefix)/man/man1 |
|
108 # Extension (not including `.') for the installed manual page filenames. |
|
109 manext = 1 |
|
110 |
|
111 # Where to put the info files. |
|
112 infodir = $(prefix)/info |
|
113 |
|
114 # Where to put extra data files, system-wide startup files, etc. |
|
115 datadir = $(prefix)/lib/octave |
|
116 |
|
117 # Where to put installed include files. |
308
|
118 includedir = $(prefix)/include/octave |
5
|
119 |
|
120 # The type of computer we are running on. |
|
121 target_host_type = @target_host_type@ |
|
122 |
|
123 # The following pattern rules and the substitution functions require |
|
124 # GNU make. If you don't have it, get it! |
|
125 |
|
126 @DEFAULT_DOT_C_FROM_DOT_F@ |
|
127 |
|
128 @DEFAULT_DOT_O_FROM_DOT_F@ |
|
129 |
|
130 # How to make .o files from .c files: |
|
131 |
|
132 .c.o: |
|
133 $(CC) -c $(CPPFLAGS) $(ALL_CFLAGS) $< |
|
134 |
|
135 .cc.o: |
|
136 $(CXX) -c $(CPPFLAGS) $(ALL_CXXFLAGS) $< |
308
|
137 |
|
138 # Here is a rule for generating dependencies for .cc files: |
|
139 |
|
140 %.d: %.cc |
|
141 rm -f $@ |
|
142 -if test "$(srcdir)" = "." ; then \ |
|
143 $(CXX) -MM $(CPPFLAGS) $(ALL_CXXFLAGS) $< | \ |
|
144 sed -e 's/$*\.o/& $@/g' > $@.tmp && \ |
|
145 mv $@.tmp $@ ; \ |
|
146 else \ |
|
147 $(CXX) -MM $(CPPFLAGS) $(ALL_CXXFLAGS) $< | \ |
|
148 sed -e 's/$*\.o/& $@/g' -e 's,$(srcdir)/,,g' > $@.tmp && \ |
|
149 mv $@.tmp $@ ; \ |
|
150 fi |
|
151 |
|
152 # And one for .c files.too: |
|
153 |
|
154 %.d: %.c |
|
155 rm -f $@ |
|
156 -if test "$(srcdir)" = "." ; then \ |
|
157 $(CC) -MM $(CPPFLAGS) $(ALL_CFLAGS) $< | \ |
|
158 sed -e 's/$*\.o/& $@/g' > $@.tmp && \ |
|
159 mv $@.tmp $@ ; \ |
|
160 else \ |
|
161 $(CC) -MM $(CPPFLAGS) $(ALL_CFLAGS) $< | \ |
|
162 sed -e 's/$*\.o/& $@/g' -e 's,$(srcdir)/,,g' > $@.tmp && \ |
|
163 mv $@.tmp $@ ; \ |
|
164 fi |