150 lines
4.0 KiB
Makefile
150 lines
4.0 KiB
Makefile
#
|
|
# Makefile.in for the Tiny COBOL compiler runtime library
|
|
#
|
|
|
|
prefix=@prefix@
|
|
exec_prefix=@exec_prefix@
|
|
|
|
#
|
|
# Debug flags are set in htconfig.h
|
|
# -DPICTURE_TESTING -DDEBUG_RTS
|
|
#
|
|
CCX=@CC@
|
|
ASM=@AS@
|
|
INCLUDES=@INCLUDES@ -I/usr/include/mysql
|
|
CCXFLAGS=${INCLUDES} @CCXFLAGS@ -Wall -ggdb
|
|
CCXFLAGS1=${INCLUDES} @CCXFLAGS@ -Wall -fPIC -ggdb
|
|
ACXFLAGS=@ACXFLAGS@
|
|
|
|
RANLIB=@RANLIB@
|
|
AR=@AR@
|
|
|
|
INSTRC=@cobdir_default@
|
|
RCFILE=@rtoptfile_default@
|
|
|
|
INSTALL=@INSTALL@
|
|
INSTALL_DATA=@INSTALL_DATA@
|
|
|
|
MV = mv -f
|
|
RM = rm -f
|
|
MKDIR = mkdir -p
|
|
LNK = ln -sf
|
|
GREP = grep -v
|
|
|
|
MAKEDEPEND=@MAKEDEPEND@
|
|
LIBS=-ldl @htg_ld_args_m@ @htg_ld_args_db@ -lncurses -L/usr/lib/mysql -L/usr/lib
|
|
|
|
#
|
|
# Default install directory is set in htconfig.h
|
|
#
|
|
lib_dir=@exec_prefix@/lib
|
|
|
|
lib_version=@tcob_version@
|
|
|
|
lib_name1=htcobol
|
|
#lib_name2=htcobol2
|
|
|
|
STATIC_LIB1=lib${lib_name1}.a
|
|
#STATIC_LIB2=lib${lib_name2}.a
|
|
SHARED_LIB1=lib${lib_name1}.so.${lib_version}
|
|
#SHARED_LIB2=lib${lib_name2}.so.${lib_version}
|
|
|
|
SRC1 = mcmath.c general.c fileio.c \
|
|
pictures.c basicio.c strings.c screenio.c \
|
|
cobmove.c cobmove_f_.c cobmove_x_.c cobmove_e_.c \
|
|
cobmove_9_.c cobmove_b_.c cobmove_c_.c \
|
|
rterrors.c scr_curses.c intrinsic.c \
|
|
dyncall.c flckclient.c config.c screen.c
|
|
|
|
#SRC2 = dyncall.c
|
|
#SRC2 = dyncall_ltdl.c ltdl.c
|
|
|
|
OBJS1 = $(SRC1:.c=.o)
|
|
|
|
#OBJS2 = $(SRC2:.c=.o)
|
|
|
|
OBJD1 = $(SRC1:.c=.lo)
|
|
|
|
#OBJD2 = $(SRC2:.c=.lo)
|
|
|
|
#
|
|
# Rules for compiling .c .s sources
|
|
#
|
|
.SUFFIX: .c .o .lo
|
|
.c.o:
|
|
$(CCX) $(CCXFLAGS) -c $<
|
|
|
|
%.lo: %.c
|
|
$(CCX) $(CCXFLAGS1) -c $< -o $@
|
|
|
|
#
|
|
# Notes on building and using the shared htcobol library.
|
|
# - The linker will try to use the shared libraries by default.
|
|
# If not available it will try to use the static libraries.
|
|
# - When linking with a shared htcobol library, all other libraries must be
|
|
# named, whether they are used in the cobol program or not.
|
|
# (i.e. -lncurses -ldb)
|
|
# - To run a cobol program built with a shared htcobol library, and the
|
|
# htcobol library is not installed in one of the standard locations, use
|
|
# the $LD_LIBRARY_PATH environmental variable to add this path.
|
|
# (i.e. export LD_LIBRARY_PATH=this path:$LD_LIBRARY_PATH )
|
|
# - For testing purposes, it is recommended that only a static htcobol library
|
|
# be used, since gdb will not work properly with shared libraries.
|
|
#
|
|
|
|
all: static-libs shared-libs
|
|
#all: shared-libs
|
|
#all: static-libs
|
|
devel: static-libs
|
|
|
|
static-libs: ${STATIC_LIB1} # ${STATIC_LIB2}
|
|
|
|
shared-libs: ${SHARED_LIB1} # ${SHARED_LIB2}
|
|
|
|
# Rules for building the static library
|
|
#
|
|
${STATIC_LIB1}: ${OBJS1}
|
|
${AR} cr ${STATIC_LIB1} ${OBJS1}
|
|
${RANLIB} ${STATIC_LIB1}
|
|
|
|
${STATIC_LIB2}: ${OBJS2}
|
|
${AR} cr ${STATIC_LIB2} ${OBJS2}
|
|
${RANLIB} ${STATIC_LIB2}
|
|
|
|
# Rules for building the shared library
|
|
#
|
|
${SHARED_LIB1}: ${OBJD1}
|
|
${CCX} -shared -Wl,-soname,lib${lib_name1}.so.0 -o ${SHARED_LIB1} $(OBJD1) ${LIBS}
|
|
${LNK} $(SHARED_LIB1) lib$(lib_name1).so.0
|
|
${LNK} $(SHARED_LIB1) lib$(lib_name1).so
|
|
|
|
${SHARED_LIB2}: ${OBJD2}
|
|
${CCX} -shared -Wl,-soname,lib${lib_name2}.so.0 -o ${SHARED_LIB2} $(OBJD2) ${LIBS}
|
|
${LNK} $(SHARED_LIB2) lib$(lib_name2).so.0
|
|
${LNK} $(SHARED_LIB2) lib$(lib_name2).so
|
|
|
|
clean:
|
|
@${RM} ${OBJS} ${OBJD} ${STATIC_LIB1} ${STATIC_LIB2} \
|
|
lib$(lib_name1).so* lib$(lib_name2).so* \
|
|
core *.bak *.txt *.o *.lo
|
|
|
|
install: install-static install-shared
|
|
|
|
install-rts-config:
|
|
$(MKDIR) $(INSTRC)
|
|
${INSTALL_DATA} $(RCFILE) $(INSTRC)/$(RCFILE)
|
|
|
|
#install-static: ${STATIC_LIB1} # ${STATIC_LIB2}
|
|
install-static: ${STATIC_LIB1} install-rts-config
|
|
${INSTALL_DATA} ${STATIC_LIB1} ${lib_dir}/${STATIC_LIB1}
|
|
# ${INSTALL_DATA} ${STATIC_LIB2} ${lib_dir}/${STATIC_LIB2}
|
|
|
|
#install-shared: ${SHARED_LIB1} # ${SHARED_LIB2}
|
|
install-shared: ${SHARED_LIB1} install-rts-config
|
|
${INSTALL_DATA} ${SHARED_LIB1} ${lib_dir}/${SHARED_LIB1}
|
|
# ${INSTALL_DATA} ${SHARED_LIB2} ${lib_dir}/${SHARED_LIB2}
|
|
${LNK} ${lib_dir}/$(SHARED_LIB1) ${lib_dir}/lib$(lib_name1).so
|
|
# ${LNK} ${lib_dir}/$(SHARED_LIB2) ${lib_dir}/lib$(lib_name2).so
|
|
${LNK} ${lib_dir}/$(SHARED_LIB1) ${lib_dir}/lib$(lib_name1).so.0
|
|
# ${LNK} ${lib_dir}/$(SHARED_LIB2) ${lib_dir}/lib$(lib_name2).so.0
|