Skip to content

Commit

Permalink
Switched out my Windows console code and switched in wmcbrine code (w…
Browse files Browse the repository at this point in the history
…ith minor additions of new functions)
  • Loading branch information
Bill-Gray committed Jan 14, 2020
1 parent 682e9ed commit 8e60c57
Show file tree
Hide file tree
Showing 15 changed files with 633 additions and 710 deletions.
27 changes: 0 additions & 27 deletions wincon/CMakeLists.txt

This file was deleted.

42 changes: 9 additions & 33 deletions wincon/Makefile.bcc
@@ -1,6 +1,6 @@
# Borland MAKE Makefile for PDCurses library - Windows console BC++ 7.0+
# Borland Makefile for PDCurses - Windows console
#
# Usage: make -f [path\]Makefile.bcc [DEBUG=] [WIDE=] [UTF8=]
# Usage: make -f [path\]Makefile.bcc [DEBUG=Y] [WIDE=Y] [UTF8=Y]
# [INFOEX=N] [target]
#
# where target can be any of:
Expand All @@ -14,29 +14,16 @@ RM = del
PDCURSES_SRCDIR = ..
!endif

!include $(PDCURSES_SRCDIR)\version.mif
!include $(PDCURSES_SRCDIR)\libobjs.mif
!include $(PDCURSES_SRCDIR)\common\libobjs.mif

osdir = $(PDCURSES_SRCDIR)\wincon

!ifdef OLD_BCC
CC = bcc32 -q -DNO_STDINT_H
!else
CC = bcc32c -q -Xdriver -Wno-deprecated-declarations
!endif
CC = bcc32c -q

!ifdef DEBUG
CFLAGS = -N -v -y -DPDCDEBUG
!else
CFLAGS = -O -DCHTYPE_32
!endif

!ifdef CHTYPE_32
CFLAGS = $(CFLAGS) -DCHTYPE_32
!endif

!ifdef CHTYPE_16
CFLAGS = $(CFLAGS) -DCHTYPE_16
CFLAGS = -O
!endif

!ifdef WIDE
Expand All @@ -51,14 +38,9 @@ UTF8OPT = -DPDC_FORCE_UTF8
INFOPT = -DHAVE_NO_INFOEX
!endif

!ifdef OLD_BCC
BUILD = $(CC) -I$(PDCURSES_SRCDIR) -c -Tpe $(CFLAGS) \
-w32 -w-par \
$(WIDEOPT) $(UTF8OPT) $(INFOPT)
!else
BUILD = $(CC) -I$(PDCURSES_SRCDIR) -c -Tpe $(CFLAGS) \
$(WIDEOPT) $(UTF8OPT)
!endif
BUILD_OS = $(BUILD) -Xdriver -Wno-deprecated-declarations

LIBEXE = tlib /C /E /0 /a

Expand All @@ -72,7 +54,7 @@ clean:
-$(RM) *.tds
-$(RM) *.exe

demos: $(DEMOS)
demos: $(LIBCURSES) $(DEMOS)

$(LIBCURSES) : $(LIBOBJS) $(PDCOBJS)
-$(RM) $@
Expand All @@ -84,13 +66,13 @@ $(LIBCURSES) : $(LIBOBJS) $(PDCOBJS)
$(BUILD) $<

{$(osdir)\}.c.obj:
$(BUILD) $<
$(BUILD_OS) $<

{$(demodir)\}.c.obj:
$(BUILD) $<

.c.obj:
$(BUILD) $<
$(BUILD_OS) $<

.obj.exe:
$(CC) -e$@ $** $(LIBCURSES)
Expand All @@ -103,9 +85,3 @@ tui.obj: $(demodir)\tui.c $(demodir)\tui.h $(PDCURSES_CURSES_H)

tuidemo.obj: $(demodir)\tuidemo.c $(PDCURSES_CURSES_H)
$(BUILD) -I$(demodir) $(demodir)\tuidemo.c

PLATFORM1 = Borland C++ Wincon
PLATFORM2 = Borland C/C++ 7.2 for Windows console
ARCNAME = pdc$(VER)_bcc_wincon

!include $(PDCURSES_SRCDIR)\makedist.mif
4 changes: 2 additions & 2 deletions wincon/Makefile.dmc
Expand Up @@ -24,7 +24,7 @@ CC = dmc

CFLAGS = -c -o+space -Nc

CPPFLAGS = -I$(PDCURSES_SRCDIR) -DPDC_WIDE -DPDC_FORCE_UTF8 -DHAVE_NO_INFOEX
CPPFLAGS = -I$(PDCURSES_SRCDIR) -DPDC_WIDE -DPDC_FORCE_UTF8

LINK = dmc
LIBEXE = lib
Expand All @@ -33,7 +33,7 @@ LIBCURSES = pdcurses.lib

BUILD = $(CC) $(CFLAGS) $(CPPFLAGS)

DEMOS = testcurs.exe ozdemo.exe newtest.exe xmas.exe tuidemo.exe \
DEMOS = testcurs.exe ozdemo.exe xmas.exe tuidemo.exe \
firework.exe ptest.exe rain.exe worm.exe

all: $(LIBCURSES) $(DEMOS)
Expand Down
20 changes: 7 additions & 13 deletions wincon/Makefile.mng
@@ -1,9 +1,8 @@
# GNU MAKE Makefile for PDCurses library - Windows console MinGW GCC
# GNU MAKE Makefile for PDCurses library - WIN32 MinGW GCC
#
# Usage: make -f [path\]Makefile.mng [DEBUG=Y] [DLL=Y] [WIDE=Y] [UTF8=Y]
# [INFOEX=N] [tgt]
# Usage: make -f [path\]Makefile.mng [DEBUG=Y] [DLL=Y] [WIDE=Y] [UTF8=Y] [target]
#
# where tgt can be any of:
# where target can be any of:
# [all|demos|pdcurses.a|testcurs.exe...]

O = o
Expand All @@ -13,7 +12,7 @@ ifndef PDCURSES_SRCDIR
endif

include $(PDCURSES_SRCDIR)/version.mif
include $(PDCURSES_SRCDIR)/libobjs.mif
include $(PDCURSES_SRCDIR)/common/libobjs.mif

uname_S := $(shell uname -s 2>/dev/null)

Expand Down Expand Up @@ -91,10 +90,6 @@ ifeq ($(UTF8),Y)
CFLAGS += -DPDC_FORCE_UTF8
endif

ifeq ($(INFOEX),N)
PDCCFLAGS += -DHAVE_NO_INFOEX
endif

LINK = $(PREFIX)gcc

ifeq ($(DLL),Y)
Expand Down Expand Up @@ -151,14 +146,14 @@ $(LIBOBJS) : %.o: $(srcdir)/%.c
$(CC) -c $(CFLAGS) $<

$(PDCOBJS) : %.o: $(osdir)/%.c
$(CC) -c $(CFLAGS) $(PDCCFLAGS) $<
$(CC) -c $(CFLAGS) $<

firework.exe ozdemo.exe newtest.exe ptest.exe rain.exe testcurs.exe \
firework.exe newdemo.exe newtest.exe ptest.exe rain.exe testcurs.exe \
version.exe worm.exe xmas.exe: %.exe: $(demodir)/%.c
$(CC) $(CFLAGS) -o$@ $< $(LIBCURSES) $(EXELIBS)

tuidemo.exe: tuidemo.o tui.o
$(LINK) $(LDFLAGS) -o$@ tuidemo.o tui.o $(LIBCURSES) $(EXELIBS)
$(LINK) $(LDFLAGS) -o$@ tuidemo.o tui.o $(LIBCURSES)

tui.o: $(demodir)/tui.c $(demodir)/tui.h $(PDCURSES_CURSES_H)
$(CC) -c $(CFLAGS) -I$(demodir) -o$@ $<
Expand All @@ -170,4 +165,3 @@ PLATFORM1 = MinGW WinCon
PLATFORM2 = MinGW for WinCon
ARCNAME = pdc$(VER)_ming_wcon

include $(PDCURSES_SRCDIR)/makedist.mif
124 changes: 48 additions & 76 deletions wincon/Makefile.vc
@@ -1,103 +1,82 @@
# Visual C++ & Intel(R) NMakefile for PDCurses library - Windows console VC++ 2.0+
# Visual C++ Makefile for PDCurses - Windows console
#
# Usage: nmake -f [path\]Makefile.vc [DEBUG=Y] [DLL=Y] [WIDE=Y] [UTF8=Y]
# [ICC=] [CHTYPE_32=] [IX86=] [CHTYPE_16=] [INFOEX=N] [target]
# [INFOEX=N] [target]
#
# where target can be any of:
# [all|demos|pdcurses.lib|testcurs.exe...]
# CHTYPE_## is used to override the default 64-bit chtypes in favor
# of "traditional" 32- or 16-bit chtypes. (Untested for Windows console)
# IX86 is used to build 32-bit code instead of 64-bit
# ICC is used to invoke Intel (R) tools icl.exe and xilink.exe, instead of
# MS tools cl.exe and link.exe

O = obj
E = .exe
RM = del

!ifndef PDCURSES_SRCDIR
PDCURSES_SRCDIR = ..
!endif

!ifdef IX86
PLATFORM=IX86
!else
PLATFORM=X64
!endif

!include $(PDCURSES_SRCDIR)\version.mif
!include $(PDCURSES_SRCDIR)\libobjs.mif
!include $(PDCURSES_SRCDIR)\common\libobjs.mif

osdir = $(PDCURSES_SRCDIR)\wincon
osdir = $(PDCURSES_SRCDIR)\wincon
common = $(PDCURSES_SRCDIR)\common

PDCURSES_WIN_H = $(osdir)\pdcwin.h
PDCURSES_WIN_H = $(osdir)\pdcwin.h

!ifdef ICC
CC = icl.exe -nologo
LINK = xilink.exe -nologo
!else
CC = cl.exe -nologo
LINK = link.exe -nologo
!endif
CC = cl.exe -nologo

!ifdef DEBUG
CFLAGS = -Z7 -DPDCDEBUG
LDFLAGS = -debug -pdb:none
CFLAGS = -Z7 -DPDCDEBUG
LDFLAGS = -debug -pdb:none
!else
CFLAGS = -O1
LDFLAGS =
CFLAGS = -O1
LDFLAGS =
!endif

!ifdef WIDE
WIDEOPT = -DPDC_WIDE
WIDEOPT = -DPDC_WIDE
!endif

!ifdef UTF8
UTF8OPT = -DPDC_FORCE_UTF8
UTF8OPT = -DPDC_FORCE_UTF8
!endif

!ifdef INFOEX
INFOPT = -DHAVE_NO_INFOEX
!endif

!ifdef CHTYPE_32
CHTYPE_FLAGS= -DCHTYPE_32
!endif

!ifdef CHTYPE_16
CHTYPE_FLAGS= -DCHTYPE_16
!endif
SHL_LD = link $(LDFLAGS) -nologo -dll -machine:$(PLATFORM) -out:pdcurses.dll

SHL_LD = link $(LDFLAGS) /NOLOGO /DLL /MACHINE:$(PLATFORM) /OUT:pdcurses.dll
LINK = link.exe -nologo

CCLIBS = user32.lib advapi32.lib
# may need to add msvcrt.lib for VC 2.x, VC 5.0 doesn't want it
#CCLIBS = msvcrt.lib user32.lib advapi32.lib
CCLIBS = user32.lib advapi32.lib
# may need to add msvcrt for older compilers
#CCLIBS = msvcrt.lib user32.lib advapi32.lib

LIBEXE = lib -nologo
LIBEXE = lib -nologo

LIBCURSES = pdcurses.lib
CURSESDLL = pdcurses.dll
LIBCURSES = pdcurses.lib
CURSESDLL = pdcurses.dll

!ifdef DLL
DLLOPT = -DPDC_DLL_BUILD
PDCLIBS = $(CURSESDLL)
DLLOPT = -DPDC_DLL_BUILD
PDCLIBS = $(CURSESDLL)
!else
PDCLIBS = $(LIBCURSES)
PDCLIBS = $(LIBCURSES)
!endif

BUILD = $(CC) -I$(PDCURSES_SRCDIR) -c $(CFLAGS) $(CHTYPE_FLAGS) $(DLLOPT) \
$(WIDEOPT) $(UTF8OPT)
BUILD = $(CC) -I$(PDCURSES_SRCDIR) -c $(CFLAGS) $(DLLOPT) \
$(WIDEOPT) $(UTF8OPT) $(INFOPT)

all: $(PDCLIBS)
all: $(PDCLIBS)

clean:
-del *.obj
-del *.lib
-del *.exe
-del *.dll
-del *.exp
-del *.res
-$(RM) *.obj
-$(RM) *.lib
-$(RM) *.exe
-$(RM) *.dll
-$(RM) *.exp
-$(RM) *.res

demos: $(DEMOS)
demos: $(PDCLIBS) $(DEMOS)

DEMOOBJS = $(DEMOS:.exe=.obj) tui.obj

Expand All @@ -106,43 +85,36 @@ $(PDCOBJS) : $(PDCURSES_WIN_H)
$(DEMOOBJS) : $(PDCURSES_CURSES_H)
$(DEMOS) : $(LIBCURSES)
panel.obj : $(PANEL_HEADER)
terminfo.obj: $(TERM_HEADER)

!ifndef DLL
$(LIBCURSES) : $(LIBOBJS) $(PDCOBJS)
$(LIBEXE) -out:$@ $(LIBOBJS) $(PDCOBJS)
$(LIBEXE) -out:$@ $(LIBOBJS) $(PDCOBJS)
!endif

$(CURSESDLL) : $(LIBOBJS) $(PDCOBJS) pdcurses.obj
$(SHL_LD) $(LIBOBJS) $(PDCOBJS) pdcurses.obj $(CCLIBS)
$(SHL_LD) $(LIBOBJS) $(PDCOBJS) pdcurses.obj $(CCLIBS)

pdcurses.res pdcurses.obj: $(osdir)\pdcurses.rc $(osdir)\pdcurses.ico
rc /r /fopdcurses.res $(osdir)\pdcurses.rc
cvtres /MACHINE:$(PLATFORM) /NOLOGO /OUT:pdcurses.obj pdcurses.res
pdcurses.res pdcurses.obj: $(common)\pdcurses.rc
rc -r -fopdcurses.res $(common)\pdcurses.rc
cvtres -machine:$(PLATFORM) -nologo -out:pdcurses.obj pdcurses.res

{$(srcdir)\}.c{}.obj::
$(BUILD) $<
$(BUILD) $<

{$(osdir)\}.c{}.obj::
$(BUILD) $<
$(BUILD) $<

{$(demodir)\}.c{}.obj::
$(BUILD) $<
$(BUILD) $<

.obj.exe:
$(LINK) $(LDFLAGS) $< $(LIBCURSES) $(CCLIBS)
$(LINK) $(LDFLAGS) $< $(LIBCURSES) $(CCLIBS)

tuidemo.exe: tuidemo.obj tui.obj
$(LINK) $(LDFLAGS) $*.obj tui.obj $(LIBCURSES) $(CCLIBS)
$(LINK) $(LDFLAGS) $*.obj tui.obj $(LIBCURSES) $(CCLIBS)

tui.obj: $(demodir)\tui.c $(demodir)\tui.h
$(BUILD) -I$(demodir) $(demodir)\tui.c
$(BUILD) -I$(demodir) $(demodir)\tui.c

tuidemo.obj: $(demodir)\tuidemo.c
$(BUILD) -I$(demodir) $(demodir)\tuidemo.c

PLATFORM1 = Visual C++
PLATFORM2 = Microsoft Visual C/C++ for Windows console
ARCNAME = pdc$(VER)_vc_wincon

!include $(PDCURSES_SRCDIR)\makedist.mif
$(BUILD) -I$(demodir) $(demodir)\tuidemo.c

0 comments on commit 8e60c57

Please sign in to comment.