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