xaizek / vifm-pdcurses (License: mostly public domain) (since 2019-03-20)
PDCurses 3.4 with vifm-specific patches applied (a couple were upstreamed)
<root> / sdl2 / Makefile.vc (3f451d7d61477a4f6e4e88a18f97c92a36eb5437) (2,793B) (mode 100644) [raw]
# Visual C++ Makefile for PDCurses - SDL2
#
# Usage: nmake -f [path\]Makefile.vc [DEBUG=Y] [DLL=Y] [WIDE=Y] [UTF8=Y]
#        [INFOEX=N] [target]
#
# where target can be any of:
# [all|demos|pdcurses.lib|testcurs.exe...]

O = obj
E = .exe
RM = del

!ifndef PDCURSES_SRCDIR
PDCURSES_SRCDIR = ..
!endif

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

!include $(common)\libobjs.mif
!include $(osdir)\versions.mif

SDL2_INCLUDE = -I$(SDLBASE)\include
SDL2_LIB = $(SDLBASE)\lib\$(PLATFORM)\SDL2.lib
SDL2_LIBMAIN = $(SDLBASE)\lib\$(PLATFORM)\SDL2main.lib

PDCURSES_WIN_H	= $(osdir)\pdcsdl.h

CC		= cl.exe -nologo

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

!ifdef WIDE
WIDEOPT		= -DPDC_WIDE
TTF_INCLUDE	= -I$(TTFBASE)\include
TTF_LIB		= $(TTFBASE)\lib\$(PLATFORM)\SDL2_ttf.lib
!endif

!ifdef UTF8
UTF8OPT		= -DPDC_FORCE_UTF8
!endif

!ifdef INFOEX
INFOPT		= -DHAVE_NO_INFOEX
!endif

SHL_LD = link $(LDFLAGS) -nologo -dll -machine:$(PLATFORM) -out:pdcurses.dll

LINK		= link.exe -nologo -subsystem:windows

LIBEXE		= lib -nologo

LIBCURSES	= pdcurses.lib
CURSESDLL	= pdcurses.dll

!ifdef DLL
DLLOPT		= -DPDC_DLL_BUILD
PDCLIBS		= $(CURSESDLL)
LIBLIBS		= $(SDL2_LIB) $(TTF_LIB)
CCLIBS		= $(SDL2_LIBMAIN) $(SDL2_LIB)
!else
PDCLIBS		= $(LIBCURSES)
CCLIBS		= $(SDL2_LIBMAIN) $(SDL2_LIB) $(TTF_LIB)
!endif

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

all:	$(PDCLIBS)

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

demos:	$(PDCLIBS) $(DEMOS) sdltest.exe

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

$(LIBOBJS) $(PDCOBJS) : $(PDCURSES_HEADERS)
$(PDCOBJS) : $(PDCURSES_WIN_H)
$(DEMOOBJS) : $(PDCURSES_CURSES_H)
$(DEMOS) : $(LIBCURSES)
panel.obj : $(PANEL_HEADER)

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

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

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) $<

{$(osdir)\}.c{}.obj::
	$(BUILD) -Dmain=SDL_main $(SDL2_INCLUDE) $(TTF_INCLUDE) $<

{$(demodir)\}.c{}.obj::
	$(BUILD) -Dmain=SDL_main $<

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

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

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

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

sdltest.exe: sdltest.obj
	$(LINK) $(LDFLAGS) $*.obj $(LIBCURSES) $(LIBLIBS) $(CCLIBS)
Hints

Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://code.reversed.top/user/xaizek/vifm-pdcurses

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@code.reversed.top/user/xaizek/vifm-pdcurses

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a pull request:
... clone the repository ...
... make some changes and some commits ...
git push origin master