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