tinycobol/lib/Makefile.mingw.in

148 lines
3.4 KiB
Makefile

#
# Makefile.in for the TinyCOBOL compiler runtime library (MinGW)
#
prefix=@prefix@
exec_prefix=${prefix}
MV=@MV@
RM=@RM@
MKDIR=@MKDIR@
#
# Debug flags are set in htconfig.h
# -DPICTURE_TESTING -DDEBUG_RTS
#
CCX=@CC@
ASM=@AS@
INCLUDES=@INCLUDES@
CCXFLAGS=${INCLUDES} -Wall
CCXFLAGS1=${INCLUDES} -Wall
ACXFLAGS=-D -as
MAKEDEPEND=@MAKEDEPEND@
WRES=@WINDRES@
WRESFLAGS=-O coff
RANLIB=@RANLIB@
AR=@AR@
INSTBIN=@cobbin_default@
INSTLIB=@coblib_default@
INSTRC=@cobdir_default@
RCFILE=@rtoptfile_default@
INSTALL=@INSTALL@
INSTALL_DATA=@INSTALL_DATA@
#
LIBS=@LIBS@ @htg_ld_args_db@ @htg_ld_args_curses@
#
lib_version=@tcob_version@
lib_name1=htcobol
STATIC_LIB1=lib${lib_name1}.a
DLL_LIB1=${lib_name1}.dll
DLL_IMLIB1=${lib_name1}.dll.a
DLL_DEF1=${lib_name1}.def
SRC1 = mcmath.c cobmove.c general.c fileio.c \
pictures.c basicio.c strings.c screenio.c \
cobmove_9_.c cobmove_b_.c cobmove_c_.c cobmove_e_.c \
cobmove_f_.c cobmove_x_.c rterrors.c scr_curses.c intrinsic.c \
dyncall.c config.c
# dyncall.c config.c fixnumeric.c imath.c
SRC2 = flckclient.c
SRC3 = htcobolrt.rc
OBJS1 = $(SRC1:.c=.o) @tc_use_lockserver_src_opt@
#OBJS1 = $(SRC1:.c=.o)
OBJS2 = $(SRC3:.rc=.o)
#
# Rules for compiling .c .s sources
#
.SUFFIX: .c .o
.c.o:
$(CCX) $(CCXFLAGS) -c $<
#
# Notes on building and using the htcobol DLL.
# - The linker will try to use the DLL by default.
# If not available it will try to use the static libraries.
# - When linking with the htcobol DLL, all other libraries (DLL's) must be
# named, whether or not they are used in the cobol program.
# (i.e. -lpdcurses -ldb)
# - To run a cobol program built with the htcobol DLL, and the
# htcobol DLL location must be included in the PATH or be located in the CWD.
# - For testing purposes, it is recommended that only a static htcobol library
# be used, since gdb will not work properly with DLL's.
#
#all: static-libs
all: static-libs @tc_shared_libs_opt@
#all: static-libs shared-libs
devel: static-libs shared-libs
static-libs: ${STATIC_LIB1}
shared-libs: ${DLL_LIB1}
# Rules for building the DLL resources
#
htcobolrt.o: htcobolrt.rc
$(WRES) $(WRESFLAGS) $< $@
# Rules for building the static library
#
${STATIC_LIB1}: ${OBJS1}
${AR} cr ${STATIC_LIB1} ${OBJS1}
${RANLIB} ${STATIC_LIB1}
# Rules for building the shared library (DLL)
#
${DLL_LIB1}: ${OBJS1} $(OBJS2)
${CCX} -shared -Wl,--out-implib,${DLL_IMLIB1},--output-def,${DLL_DEF1} -o ${DLL_LIB1} $(OBJS1) $(OBJS2) ${LIBS}
# ${CCX} -shared -Wl,--out-implib,${lib_name1}.dll.a,--output-def,${lib_name1}.def -o ${DLL_LIB1} $(OBJS1) $(OBJS2) ${LIBS}
clean:
@${RM} ${OBJS} ${STATIC_LIB1} ${DLL_LIB1} ${DLL_DEF1} ${DLL_IMLIB1} \
core *.bak *.o
install: install-rts-config install-static-libs @tc_shared_libs_install_opt@
#install: install-rts-config install-static-libs install-shared-libs
install-rts-config: install-dir
# $(MKDIR) $(INSTRC)
${INSTALL_DATA} $(RCFILE) $(INSTRC)\$(RCFILE)
install-static-libs: ${STATIC_LIB1}
${INSTALL_DATA} ${STATIC_LIB1} ${INSTLIB}\${STATIC_LIB1}
install-shared-libs: ${DLL_LIB1}
${INSTALL_DATA} ${DLL_LIB1} ${INSTBIN}\${DLL_LIB1}
${INSTALL_DATA} ${DLL_IMLIB1} ${INSTLIB}\${DLL_IMLIB1}
install-dir:
$(MKDIR) $(INSTRC)
uninstall: uninstall-rts-config uninstall-static-libs uninstall-shared-libs
uninstall-rts-config:
$(RM) $(INSTRC)\$(RCFILE)
uninstall-static-libs:
$(RM) ${INSTLIB}\${STATIC_LIB1}
uninstall-shared-libs:
$(RM) ${INSTBIN}\${DLL_LIB1}
$(RM) ${INSTLIB}\${DLL_IMLIB1}