1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171
|
#
# try ./configure first to fill in all the definitions corresponding
# to your system, but you always can edit the sections below manually.
#
CC= @CC@
CFLAGS= @CFLAGS@
RANLIB= @RANLIB@
INSTALL= @INSTALL@
#
# how to compile, link, and name shared libraries
#
SHLIB_LD= @SHLIB_LD@
SHLIB_CFLAGS= @SHLIB_CFLAGS@
SHLIB_SUFFIX= @SHLIB_SUFFIX@
SHLD_FLAGS= @DL_LD_FLAGS@
DL_LIBS= @DL_LIBS@
SHLIB_LD_LIBS = @SHLIB_LD_LIBS@
#
# where to install shells, libraries, and includes
#
INST_OTCLSH= @prefix@/bin
INST_OWISH= @prefix@/bin
INST_OLIB= @prefix@/lib
INST_OLIBSH= @INST_OLIBSH@
INST_OINC= @prefix@/include
#
# ------------ you shouldn't need to configure below here -----------------
#
INCLUDES = \
-I. \
@V_INCLUDES@ \
@V_INCLUDE_X11@ \
-I@includedir@ \
@V_INCLUDE@
DEFINES = \
@V_DEFINE@
LIB = @V_LIBS@ \
@V_LIB_X11@ @V_LIB@ -lm
OTCLLIB= -L. -lotcl
CP= cp -f
RM= rm -f
MV= mv -f
CFILES = otcl.c otclAppInit.c otkAppInit.c
.c.o:
$(CC) -c $(CFLAGS) $(DEFINES) $(INCLUDES) $<
all: libotcl.a libotcl$(SHLIB_SUFFIX) otclsh owish
#
# compile an appinit with tcl and otcl and link against
# libotcl.a plus required tcl libs to give a standalone binary
#
otclsh: otclAppInit.c libotcl.a
rm -f libotcl$(SHLIB_SUFFIX)
$(CC) -o otclsh $(SHLD_FLAGS) $(CFLAGS) $(INCLUDES) otclAppInit.c \
$(OTCLLIB) $(LIB)
#
# compile an appinit with tcl/tk and otcl and link against
# libotcl.a plus required tcl/tk libs to give a standalone binary
#
owish: otkAppInit.c libotcl.a
rm -f libotcl$(SHLIB_SUFFIX)
$(CC) -o owish $(SHLD_FLAGS) $(CFLAGS) $(INCLUDES) otkAppInit.c \
$(OTCLLIB) $(LIB)
#
# compile otcl.c and link it into a library archive
# INCLUDES give a path to tclInt.h (plus tk and X11)
#
libotcl.a: otcl.c
rm -f libotcl.a otcl.o
$(CC) -c $(CFLAGS) $(DEFINES) $(INCLUDES) otcl.c
ar cq libotcl.a otcl.o
$(RANLIB) libotcl.a
#
# compile otcl.c and link it into a shared object
# INCLUDES give a path to tclInt.h (plus tk and X11)
#
libotcl$(SHLIB_SUFFIX): otcl.c
rm -f libotcl$(SHLIB_SUFFIX) otcl.o so_locations
$(CC) -c $(CFLAGS) $(DEFINES) $(SHLIB_CFLAGS) $(INCLUDES) otcl.c
$(SHLIB_LD) -o libotcl$(SHLIB_SUFFIX) otcl.o
test: otclsh owish
./otclsh lib/test.tcl
./owish lib/test.tcl
dirs:
for d in $(INST_OWISH) $(INST_OTCLSH) $(INST_OLIB) $(INST_OLIBSH) $(INST_OINC); do \
if [ ! -d $$d ]; then \
mkdir -p $$d ;\
fi;\
done
install: owish otclsh libotcl.a libotcl$(SHLIB_SUFFIX) otcl.h dirs
$(INSTALL) owish $(INST_OWISH)
$(INSTALL) otclsh $(INST_OTCLSH)
$(INSTALL) libotcl.a $(INST_OLIB)
$(RANLIB) $(INST_OLIB)/libotcl.a
$(INSTALL) libotcl$(SHLIB_SUFFIX) $(INST_OLIBSH)
$(INSTALL) -m 644 otcl.h $(INST_OINC)
clean:
rm -f owish otclsh libotcl.a libotcl$(SHLIB_SUFFIX) \
otcl.o otkAppInit.o otclAppInit.o \
config.status config.log config.cache \
core so_locations *.core Makefile
# To be compatible with ns/nam
distclean: clean
binclean:
rm -f otcl.o otkAppInit.o otclAppInit.o \
config.status config.log config.cache \
core so_locations
srctar:
@cwd=`pwd` ; dir=`basename $$cwd` ; \
name=otcl-`cat VERSION | tr A-Z a-z` ; \
tar=otcl-src-`cat VERSION`.tar.gz ; \
list="" ; \
for i in `cat FILES` ; do list="$$list $$name/$$i" ; done; \
echo \
"(rm -f $$tar; cd .. ; ln -s $$dir $$name)" ; \
(rm -f $$tar; cd .. ; ln -s $$dir $$name) ; \
echo \
"(cd .. ; tar cfh $$tar [lots of files])" ; \
(cd .. ; tar cfhz - $$list) > $$tar ; \
echo \
"rm ../$$name; chmod 444 $$tar" ; \
rm ../$$name; chmod 444 $$tar
depend: $(CFILES)
@echo Making dependencies for $(srcdir){$(CFILES)}
@$(CC) -MM $(CFLAGS) $(INCLUDES) $(DEFINES) $(CFILES) > makedep
@echo '/^# DO NOT DELETE THIS LINE/+1,$$d' > eddep
@echo '$$r makedep' >> eddep
@echo 'w' >>eddep
@$(CP) Makefile Makefile.bak
@ed - Makefile < eddep
@$(RM) eddep makedep
@echo '# DEPENDENCIES MUST END AT END OF FILE' >> Makefile
@echo '# IF YOU PUT STUFF HERE IT WILL GO AWAY' >> Makefile
@echo '# see make depend above' >> Makefile
# DO NOT DELETE THIS LINE
# DEPENDENCIES MUST END AT END OF FILE
# IF YOU PUT STUFF HERE IT WILL GO AWAY
# see make depend above
|