Files: mscomm.{c,h,def,rc,bmp} -> kpcomctl.{c,h,def,rc,bmp}
Output: mscomm.vbx -> kpcomctl.vbx
Types: MsCommDataT -> KpComCtlDataT, MsCommCtlProc -> KpComCtlProc
LIBRARY name: MSCOMM -> KPCOMCTL
VB control name: MSComm -> KPComCtl
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
87 lines
2.6 KiB
Makefile
87 lines
2.6 KiB
Makefile
# makefile - KPComCtl VBX control for MSVC 1.52
|
|
#
|
|
# Build: nmake
|
|
# Clean: nmake clean
|
|
#
|
|
# Prerequisites:
|
|
# - MSVC 1.52 (cl, link, rc in PATH)
|
|
# - VBAPI.LIB (from VBX CDK, or generate with: implib vbapi.lib vbapi.def)
|
|
#
|
|
# High-speed serial note:
|
|
# The stock Windows 3.1 COMM.DRV enables the 16550 FIFO for receive only,
|
|
# with a trigger level of 14 (leaving only 2 bytes of headroom). This causes
|
|
# overruns at baud rates above 9600 under load. For reliable operation at
|
|
# 57600 or 115200, install KPCOMM.DRV (built from ..\drv\) or CyberCom
|
|
# V1.1.0.0P (..\drivers\CYBERCOM.DRV).
|
|
#
|
|
# Install (KPCOMM):
|
|
# 1. Copy ..\drv\KPCOMM.DRV to \WINDOWS\SYSTEM
|
|
# 2. Edit SYSTEM.INI [boot] section: comm.drv=kpcomm.drv
|
|
# 3. Add to [386Enh] section: COM1FIFO=1 (for each port in use)
|
|
# 4. Restart Windows
|
|
|
|
CC = cl
|
|
LINK = link
|
|
RC = rc
|
|
|
|
# Compiler flags:
|
|
# -c Compile only
|
|
# -W3 Warning level 3
|
|
# -ASw Small model, SS!=DS (Windows DLL)
|
|
# -Gsw No stack probes, Windows prolog/epilog
|
|
# -Ow Safe optimizations for Windows
|
|
# -Zp2 Pack structures on 2-byte boundaries
|
|
# -Ze Enable Microsoft extensions
|
|
CFLAGS = -c -W3 -ASw -Gsw -Ow -Zp2 -Ze
|
|
|
|
# Linker flags:
|
|
# /NOD No default libraries
|
|
# /NOE No extended dictionary search
|
|
# /AL:16 Segment alignment 16
|
|
LFLAGS = /NOD /NOE /AL:16
|
|
|
|
# Libraries
|
|
# sdllcew Small model DLL C runtime (emulated math, Windows)
|
|
# libw Windows API import library
|
|
# commdlg Common dialog import library
|
|
# vbapi VB API import library
|
|
LIBS = sdllcew libw commdlg vbapi
|
|
|
|
# Output
|
|
TARGET = kpcomctl.vbx
|
|
|
|
# Objects
|
|
OBJS = kpcomctl.obj serial.obj
|
|
|
|
# -----------------------------------------------------------------------
|
|
# Build rules
|
|
# -----------------------------------------------------------------------
|
|
all: $(TARGET)
|
|
|
|
$(TARGET): $(OBJS) kpcomctl.def kpcomctl.res vbapi.lib
|
|
$(LINK) $(LFLAGS) $(OBJS), $(TARGET),,$(LIBS), kpcomctl.def
|
|
$(RC) kpcomctl.res $(TARGET)
|
|
|
|
kpcomctl.obj: kpcomctl.c kpcomctl.h vbapi.h serial.h
|
|
$(CC) $(CFLAGS) kpcomctl.c
|
|
|
|
serial.obj: serial.c serial.h
|
|
$(CC) $(CFLAGS) serial.c
|
|
|
|
kpcomctl.res: kpcomctl.rc kpcomctl.h kpcomctl.bmp
|
|
$(RC) -r kpcomctl.rc
|
|
|
|
# -----------------------------------------------------------------------
|
|
# Generate VBAPI.LIB from vbapi.def if not present
|
|
# -----------------------------------------------------------------------
|
|
vbapi.lib: vbapi.def
|
|
implib vbapi.lib vbapi.def
|
|
|
|
# -----------------------------------------------------------------------
|
|
# Clean
|
|
# -----------------------------------------------------------------------
|
|
clean:
|
|
-del *.obj
|
|
-del *.res
|
|
-del *.vbx
|
|
-del *.map
|