home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
octa21eb.zip
/
octave
/
PATOS2.ZIP
/
src
/
makefile.os2
next >
Wrap
Makefile
|
1999-04-30
|
9KB
|
219 lines
# Makefile for octave's src directory
# Modified by Klaus Gebhardt, 1994 - 1999
TOPDIR = ..
include $(TOPDIR)/Makeconf.os2
srcdir = .
OV_INCLUDES := ov-re-mat.h ov-cx-mat.h ov-ch-mat.h ov-list.h \
ov-struct.h ov-scalar.h ov-range.h ov-complex.h ov-va-args.h \
ov-colon.h ov-base.h ov-base-mat.h ov-base-scalar.h \
ov-str-mat.h ov-bool-mat.h ov-bool.h ov-file.h ov.h \
ov-fcn.h ov-builtin.h ov-mapper.h ov-usr-fcn.h ov-typeinfo.h
PT_INCLUDES := pt.h pt-all.h pt-arg-list.h pt-assign.h pt-binop.h \
pt-check.h pt-cmd.h pt-colon.h pt-const.h pt-decl.h \
pt-except.h pt-exp.h pt-id.h pt-idx.h pt-indir.h \
pt-jump.h pt-loop.h pt-mat.h pt-misc.h pt-plot.h \
pt-pr-code.h pt-select.h pt-stmt.h pt-unop.h pt-walk.h
INCLUDES := BaseSLList.h Map.h Pix.h SLList.h SLStack.h Stack.h \
defun-dld.h defun-int.h defun.h dirfns.h dynamic-ld.h error.h \
file-io.h fn-cache.h gripes.h help.h input.h lex.h load-save.h \
oct-fstrm.h oct-hist.h oct-iostrm.h oct-map.h oct-obj.h \
oct-prcstrm.h oct-stdstrm.h oct-stream.h \
oct-strstrm.h oct-lvalue.h oct.h ops.h pager.h parse.h \
pr-output.h sighandlers.h symtab.h sysdep.h \
systime.h token.h toplev.h unwind-prot.h utils.h \
variables.h version.h xdiv.h xpow.h $(OV_INCLUDES) $(PT_INCLUDES)
OV_SRC := ov-base.cc ov-base-mat.cc ov-base-scalar.cc ov-ch-mat.cc \
ov-list.cc ov-re-mat.cc ov-cx-mat.cc ov-range.cc ov-scalar.cc \
ov-complex.cc ov-str-mat.cc ov-struct.cc ov-va-args.cc \
ov-colon.cc ov-bool-mat.cc ov-bool.cc ov-file.cc ov.cc ov-fcn.cc \
ov-builtin.cc ov-mapper.cc ov-usr-fcn.cc ov-typeinfo.cc
PT_SRC := pt.cc pt-arg-list.cc pt-assign.cc pt-binop.cc pt-check.cc \
pt-cmd.cc pt-colon.cc pt-const.cc pt-decl.cc pt-except.cc \
pt-exp.cc pt-id.cc pt-idx.cc pt-indir.cc pt-jump.cc \
pt-loop.cc pt-mat.cc pt-misc.cc pt-plot.cc pt-pr-code.cc \
pt-select.cc pt-stmt.cc pt-unop.cc
SOURCES := BaseSLList.cc Map.cc SLList.cc SLStack.cc Stack.cc \
data.cc defaults.cc defun.cc dirfns.cc dynamic-ld.cc \
error.cc file-io.cc fn-cache.cc gripes.cc help.cc input.cc \
lex.l load-save.cc mappers.cc matherr.c oct-fstrm.cc \
oct-hist.cc oct-iostrm.cc oct-map.cc oct-obj.cc oct-prcstrm.cc \
oct-stdstrm.cc oct-stream.cc oct-strstrm.cc \
oct-lvalue.cc pager.cc parse.y pr-output.cc \
sighandlers.cc strcasecmp.c strncase.c strfns.cc \
strftime.c symtab.cc syscalls.cc sysdep.cc system.c token.cc \
toplev.cc unwind-prot.cc utils.cc variables.cc xdiv.cc \
xpow.cc $(OV_SRC) $(PT_SRC)
OBJECTS_4 := $(SOURCES)
OBJECTS_3 := $(patsubst %.l, %.obj, $(OBJECTS_4))
OBJECTS_2 := $(patsubst %.y, %.obj, $(OBJECTS_3))
OBJECTS_1 := $(patsubst %.c, %.obj, $(OBJECTS_2))
OBJECTS := $(patsubst %.cc, %.obj, $(OBJECTS_1))
# Some stupid egreps don't like empty elements in alternation patterns,
# so we have to repeat ourselves because some stupid egreps don't like
# empty elements in alternation patterns.
DEFUN_PATTERN = "^[ \t]*DEFU(N|N_DLD|N_TEXT)[ \t]*\\("
DEF_5 := $(SOURCES)
DEF_4 := $(addprefix $(srcdir)/, $(DEF_5))
DEF_3 := $(notdir $(shell egrep -l $(DEFUN_PATTERN) $(DEF_4)))
DEF_2 := $(patsubst %.y, %.df, $(DEF_3))
DEF_1 := $(patsubst %.l, %.df, $(DEF_2))
DEF_FILES := $(patsubst %.cc, %.df, $(DEF_1))
DEFVAR_PATTERN = "^[ \t]*DEF(VAR|CONST)[ \t]*\\("
VAR_5 := $(SOURCES)
VAR_4 := $(addprefix $(srcdir)/, $(VAR_5))
VAR_3 := $(notdir $(shell egrep -l $(DEFVAR_PATTERN) $(VAR_4)))
VAR_2 := $(patsubst %.y, %, $(VAR_3))
VAR_1 := $(patsubst %.l, %, $(VAR_2))
VAR_FILES := $(patsubst %.cc, %, $(VAR_1))
###############################################################################
all: defaults.h oct-conf.h remove-procstream ../dll/octave1.dll ../octave.exe
.PHONY: all
###############################################################################
EXE_SRC = octave.cc builtins.cc ops.cc
EXE_OBJ_1 = $(patsubst %.c, %.o, $(EXE_SRC))
EXE_OBJ = $(patsubst %.cc, %.o, $(EXE_OBJ_1))
LIB_CRFT = -L$(MSTDIR)/libcruft -lcruft1 -lcruft2 -lcruft3 -lcruft4
LIB_OCTV = -L$(MSTDIR)/liboctave -loctave2
STD_LIBS = -lreadline -lgnuinfo -lkpathsea -lxmalloc -lstdcpp2 -gpp2 \
-lsocket -ldlfcn
OCT_LIBS = octave1.a $(LIB_CRFT) $(LIB_OCTV) $(STD_LIBS)
LNK_FILES = $(EXE_OBJ) $(OCT_LIBS)
DEP_CRFTA = $(MSTDIR)/libcruft/cruft1.a $(MSTDIR)/libcruft/cruft2.a \
$(MSTDIR)/libcruft/cruft3.a $(MSTDIR)/libcruft/cruft4.a
DEP_OCTVA = $(MSTDIR)/liboctave/octave2.a
DEP_A = $(DEP_CRFTA) $(DEP_OCTVA)
OCTAVE1 = octave1.def octave1-src.lib octti-src.lib octop-src.lib octdld-src.lib
DLL_LIBS = $(LIB_CRFT) $(LIB_OCTV) $(STD_LIBS)
DLL_FILES = $(OCTAVE1) $(DLL_LIBS)
DEP_CRFTL = $(MSTDIR)/libcruft/cruft1.lib $(MSTDIR)/libcruft/cruft2.lib \
$(MSTDIR)/libcruft/cruft3.lib $(MSTDIR)/libcruft/cruft4.lib
DEP_OCTVL = $(MSTDIR)/liboctave/octave2.lib
DEP_LIB = $(DEP_CRFTL) $(DEP_OCTVL)
###############################################################################
# The executable and the dll.
###############################################################################
octave1-src.lib: $(OBJECTS)
@rm -f $@
emxomfar -p64 $(ARFLAGS) $@ $(OBJECTS)
octave1.def: octave1-src.lib octdld-src.lib octti-src.lib octop-src.lib
@echo LIBRARY octave1 INITINSTANCE TERMINSTANCE > $@
@echo DESCRIPTION 'octave1.dll, (c) Klaus Gebhardt 1995-1996' >> $@
@echo. >> $@
@echo DATA >> $@
@echo MULTIPLE NONSHARED >> $@
@echo. >> $@
@echo EXPORTS >> $@
emxexp -o00001 -n octave1-src.lib >> $@
emxexp -o10001 -n octdld-src.lib >> $@
emxexp -o20001 -n octti-src.lib >> $@
emxexp -o30001 -n octop-src.lib >> $@
../dll/octave1.dll: subdirs $(OCTAVE1) octave1.a octave1.lib $(DEP_LIB)
$(CC) -o $@ $(DLL_FILES) -Zdll -Zomf -Zcrtdll
octave: $(EXE_OBJ) octave.def octave1.a makefile.os2 $(DEP_A)
$(CC) -o $@ octave.def $(LNK_FILES) -Zcrtdll -Zstack 0x10000
../octave.exe: octave
emxbind -bq $(EMX09CDIR)/bin/emxl $< $@
emxbind -sq $@
###############################################################################
# The subdirectories.
###############################################################################
subdirs: mkdefs.cmd mkops.cmd defun-int.h defun-dld.h defun.h
cd DLD-FUNCTIONS & make -f makefile.os2
cd OPERATORS & make -f makefile.os2
cd TEMPLATE-INST & make -f makefile.os2
###############################################################################
# builtins.cc
###############################################################################
$(DEF_FILES): mkdefs.cmd defun-int.h defun-dld.h defun.h # defaults.h
builtins.cc: $(DEF_FILES) mkbuiltins.cmd
@echo making $@
@h:/bin/echo ""$(DEF_FILES) > def-files
@cat def-files-dld >> def-files
@h:/bin/echo ""$(VAR_FILES) > var-files
@cat var-files-dld >> var-files
@-mkbuiltins def-files var-files > $@
###############################################################################
# OS/2 or EMX specific parts.
###############################################################################
defaults.h: ../defaults.emx
cp ../defaults.emx defaults.h
oct-conf.h: ../oct-conf.emx
cp ../oct-conf.emx oct-conf.h
mkdefs.cmd: mkdefs
echo extproc ksh .\\/$@ > $@
echo shift >> $@
echo #Generated by makefile.os2. Do not edit! >> $@
sed -e "s/#!\\/bin\\/sh//" $< >> $@
mkops.cmd: mkops
echo extproc ksh .\\/$@ > $@
echo shift >> $@
echo #Generated by makefile.os2. Do not edit! >> $@
sed -e "s/#!\\/bin\\/sh//" $< >> $@
mkbuiltins.cmd: mkbuiltins
echo extproc ksh .\\/$@ > $@
echo shift >> $@
echo #Generated by makefile.os2. Do not edit! >> $@
sed -e "s/#!\\/bin\\/sh//" $< >> $@
remove-procstream:
rm -f procstream.* oct-procbuf.*
###############################################################################
# Clean the directories.
###############################################################################
clean: remove-procstream
rm -f *.a *.lib *.o *.obj *.df
rm -f lex.cc parse.cc y.tab.h builtins.cc defaults.h oct-conf.h
rm -f def-files def-files-dld var-files var-files-dld
rm -f octave ../octave.exe ../dll/octave1.dll
cd DLD-FUNCTIONS & make -f makefile.os2 clean
cd OPERATORS & make -f makefile.os2 clean
cd TEMPLATE-INST & make -f makefile.os2 clean
lex.cc: lex.l lex.h y.tab.h
y.tab.h: parse.cc
parse.cc: parse.y parse.h