2
|
1 # |
|
2 # Makefile for octave's src directory |
|
3 # |
|
4 # John W. Eaton |
|
5 # jwe@che.utexas.edu |
|
6 # Department of Chemical Engineering |
|
7 # The University of Texas at Austin |
|
8 |
|
9 TOPDIR = .. |
|
10 |
|
11 include $(TOPDIR)/Makeconf |
|
12 |
|
13 srcdir = @srcdir@ |
|
14 VPATH = @srcdir@:@srcdir@/../bsd-math |
|
15 |
|
16 LIBOBJS = @LIBOBJS@ |
|
17 |
|
18 # Cancel default rule for .c from .y and make .cc from .y instead. |
|
19 |
|
20 %.c : %.y |
|
21 |
|
22 %.cc : %.y |
|
23 $(YACC) $(YFLAGS) $< |
|
24 mv y.tab.c $(@F) |
|
25 |
|
26 # Likewise for .c from .l. |
|
27 |
|
28 %.c : %.l |
|
29 |
|
30 %.cc : %.l |
|
31 $(LEX) $(LFLAGS) $< > $(@F) |
|
32 |
|
33 # Here is a rule for generating dependencies for .cc files: |
|
34 |
|
35 %.d: %.cc |
|
36 rm -f $@ |
109
|
37 -if test "$(srcdir)" = "." ; then \ |
2
|
38 $(CXX) -MM $(CPPFLAGS) $(ALL_CXXFLAGS) $< | \ |
|
39 sed -e 's/$*\.o/& $@/g' > $@.tmp && \ |
|
40 mv $@.tmp $@ ; \ |
|
41 else \ |
|
42 $(CXX) -MM $(CPPFLAGS) $(ALL_CXXFLAGS) $< | \ |
|
43 sed -e 's/$*\.o/& $@/g' -e 's,$(srcdir)/,,g' > $@.tmp && \ |
|
44 mv $@.tmp $@ ; \ |
|
45 fi |
|
46 |
140
|
47 # And one for .c files.too: |
|
48 |
|
49 %.d: %.c |
|
50 rm -f $@ |
|
51 -if test "$(srcdir)" = "." ; then \ |
|
52 $(CC) -MM $(CPPFLAGS) $(ALL_CFLAGS) $< | \ |
|
53 sed -e 's/$*\.o/& $@/g' > $@.tmp && \ |
|
54 mv $@.tmp $@ ; \ |
|
55 else \ |
|
56 $(CC) -MM $(CPPFLAGS) $(ALL_CFLAGS) $< | \ |
|
57 sed -e 's/$*\.o/& $@/g' -e 's,$(srcdir)/,,g' > $@.tmp && \ |
|
58 mv $@.tmp $@ ; \ |
|
59 fi |
|
60 |
108
|
61 INCLUDES = arith-ops.h builtins.h dynamic-ld.h defaults.h.in \ |
221
|
62 defaults.h f-balance.h f-chol.h f-colloc.h f-dassl.h \ |
181
|
63 f-det.h f-eig.h f-expm.h f-fft.h f-fsolve.h f-fsqp.h f-givens.h \ |
108
|
64 f-hess.h f-ifft.h f-inv.h f-lpsolve.h f-lsode.h f-lu.h \ |
|
65 f-npsol.h f-qpsol.h f-qr.h f-quad.h f-qzval.h f-rand.h \ |
266
|
66 f-schur.h f-svd.h f-syl.h file-io.h fnmatch.h g-builtins.h \ |
|
67 getopt.h gripes.h help.h idx-vector.h input.h lex.h mappers.h \ |
140
|
68 missing-math.h octave.h octave-hist.h pager.h parse.h \ |
|
69 pr-output.h procstream.h sighandlers.h statdefs.h symtab.h \ |
154
|
70 sysdep.h t-builtins.h token.h tree-base.h tree-const.h tree.h \ |
140
|
71 unwind-prot.h user-prefs.h utils.h variables.h version.h \ |
|
72 xdiv.h xpow.h SLStack.h Stack.h |
2
|
73 |
221
|
74 SOURCES = arith-ops.cc builtins.cc dynamic-ld.cc f-chol.cc \ |
51
|
75 f-colloc.cc f-balance.cc f-dassl.cc f-det.cc f-eig.cc \ |
|
76 f-expm.cc f-fft.cc f-fsolve.cc f-fsqp.cc f-givens.cc \ |
|
77 f-hess.cc f-ifft.cc f-inv.cc f-lpsolve.cc f-lsode.cc f-lu.cc \ |
|
78 f-npsol.cc f-qpsol.cc f-qr.cc f-quad.cc f-qzval.cc f-rand.cc \ |
266
|
79 f-schur.cc f-svd.cc f-syl.cc file-io.cc fnmatch.c \ |
|
80 g-builtins.cc getopt.c getopt1.c gripes.cc help.cc \ |
|
81 idx-vector.cc input.cc lex.l mappers.cc octave.cc \ |
|
82 octave-hist.cc pager.cc parse.y pr-output.cc procstream.cc \ |
|
83 sighandlers.cc symtab.cc sysdep.cc t-builtins.cc tc-assign.cc \ |
|
84 tc-extras.cc tc-index.cc tc-inlines.cc token.cc tree.cc \ |
|
85 tree-const.cc tree-plot.cc unwind-prot.cc user-prefs.cc \ |
|
86 utils.cc variables.cc xdiv.cc xpow.cc SLStack.cc |
2
|
87 |
140
|
88 DEP_SOURCES_2 = $(patsubst %.l, %.cc, $(SOURCES)) |
|
89 DEP_SOURCES_1 = $(patsubst %.y, %.cc, $(DEP_SOURCES_2)) |
|
90 DEP_SOURCES = $(patsubst %.c, %.d, $(DEP_SOURCES_1)) |
2
|
91 MAKEDEPS = $(patsubst %.cc, %.d, $(DEP_SOURCES)) |
|
92 |
181
|
93 DLD_OBJECTS = f-balance.o f-chol.o f-colloc.o f-dassl.o f-det.o \ |
|
94 f-eig.o f-expm.o f-fft.o f-fsolve.o f-fsqp.o f-givens.o \ |
|
95 f-hess.o f-ifft.o f-inv.o f-lpsolve.o f-lsode.o f-lu.o \ |
|
96 f-npsol.o f-qpsol.o f-qr.o f-quad.o f-qzval.o f-rand.o \ |
|
97 f-schur.o f-svd.o f-syl.o |
2
|
98 |
266
|
99 OBJECTS = arith-ops.o builtins.o error.o file-io.o fnmatch.o \ |
|
100 g-builtins.o getopt.o getopt1.o gripes.o help.o idx-vector.o \ |
|
101 input.o lex.o mappers.o octave.o octave-hist.o pager.o \ |
|
102 parse.o pr-output.o procstream.o sighandlers.o symtab.o \ |
|
103 sysdep.o t-builtins.o tc-assign.o tc-extras.o tc-index.o \ |
|
104 token.o tree.o tree-const.o tree-plot.o unwind-prot.o \ |
|
105 user-prefs.o utils.o variables.o xdiv.o xpow.o SLStack.o \ |
2
|
106 @DYNAMIC_LD_OBJ@ |
|
107 |
181
|
108 OCTAVE_LIBS = ../liboctave.a ../libcruft.a ../libinfo.a \ |
|
109 ../libreadline.a @LIBDLD@ |
2
|
110 |
119
|
111 DISTFILES = Makefile.in move-if-change parse.cc lex.cc y.tab.h \ |
2
|
112 $(INCLUDES) $(SOURCES) |
|
113 |
10
|
114 all: defaults.h octave |
2
|
115 .PHONY: all |
|
116 |
|
117 octave: $(DLD_OBJECTS) $(OBJECTS) $(OCTAVE_LIBS) $(LIBOBJS) |
|
118 $(CXX) $(CPPFLAGS) $(ALL_CXXFLAGS) $(ALL_LDFLAGS) -o octave \ |
|
119 $(OBJECTS) @DLD_OBJECTS@ \ |
|
120 $(OCTAVE_LIBS) \ |
|
121 $(LIBOBJS) \ |
|
122 $(FLIBS) $(LEXLIB) -ltermcap -lm -lg++ |
|
123 |
|
124 check: all |
|
125 .PHONY: check |
|
126 |
|
127 install: all |
|
128 if test -d $(bindir) ; then true ; else $(TOPDIR)/mkpath $(bindir) ; fi |
|
129 rm -f $(bindir)/octave |
|
130 $(INSTALL) octave $(bindir)/octave-$(version) |
|
131 ln $(bindir)/octave-$(version) $(bindir)/octave |
|
132 .PHONY: install |
|
133 |
|
134 uninstall: |
|
135 rm -f $(bindir)/octave |
|
136 .PHONY: uninstall |
|
137 |
|
138 tags: $(SOURCES) |
|
139 ctags $(SOURCES) |
|
140 |
|
141 TAGS: $(SOURCES) |
|
142 etags $(SOURCES) |
|
143 |
|
144 clean: |
|
145 rm -f *.a *.o |
|
146 .PHONY: clean |
|
147 |
|
148 mostlyclean: |
|
149 rm -f *.o |
|
150 .PHONY: mostlyclean |
|
151 |
|
152 distclean: clean |
|
153 rm -f Makefile octave .fname *.d |
|
154 .PHONY: distclean |
|
155 |
|
156 realclean: distclean |
|
157 rm -f tags TAGS y.tab.c y.tab.h yy.lex.c lex.cc parse.cc *.d |
|
158 .PHONY: realclean |
|
159 |
|
160 local-dist: parse.cc lex.cc |
|
161 ln $(DISTFILES) ../`cat ../.fname`/src |
|
162 rm -f parse.cc lex.cc y.tab.h |
|
163 .PHONY: local-dist |
|
164 |
|
165 dist: parse.cc lex.cc |
|
166 ln $(DISTFILES) ../`cat ../.fname`/src |
|
167 rm -f parse.cc lex.cc y.tab.h |
|
168 .PHONY: dist |
|
169 |
|
170 # Special rules -- these files need special things to be defined. |
|
171 |
10
|
172 defaults.h: ../Makeconf defaults.h.in |
|
173 @echo "Making defaults.h from defaults.h.in..." |
25
|
174 @(sed < $(srcdir)/defaults.h.in > defaults.h.tmp \ |
27
|
175 -e 's;%DEFAULT_PAGER%;\"${DEFAULT_PAGER}\";' \ |
|
176 -e 's;%OCTAVE_HOME%;\"${prefix}\";') |
10
|
177 @$(srcdir)/move-if-change defaults.h.tmp defaults.h |
2
|
178 |
|
179 include $(MAKEDEPS) |