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