You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
PDCursesMod/gl/Makefile.vc

130 lines
2.8 KiB
Makefile

# Visual C++ Makefile for PDCurses - OpenGL
#
# Usage: nmake -f [path\]Makefile.vc [DEBUG=Y] [DLL=Y] [WIDE=Y] [UTF8=Y]
# [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)\gl
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)\pdcgl.h
CC = cl.exe -nologo
!ifndef PLATFORM
PLATFORM = $(VSCMD_ARG_TGT_ARCH)
!endif
!ifdef DEBUG
CFLAGS = -Z7 -W4 -DPDCDEBUG -D_CRT_SECURE_NO_DEPRECATE
LDFLAGS = -debug -pdb:none
!else
CFLAGS = -Ox -W4 -D_CRT_SECURE_NO_DEPRECATE
LDFLAGS =
!endif
!ifdef WIDE
WIDEOPT = -DPDC_WIDE
!endif
!ifdef UTF8
WIDEOPT = -DPDC_FORCE_UTF8
!endif
!ifdef WIDEOPT
TTF_INCLUDE = -I$(TTFBASE)\include
TTF_LIB = $(TTFBASE)\lib\$(PLATFORM)\SDL2_ttf.lib
!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) shell32.lib
!else
PDCLIBS = $(LIBCURSES)
CCLIBS = $(SDL2_LIBMAIN) $(SDL2_LIB) $(TTF_LIB) shell32.lib
!endif
BUILD = $(CC) -I$(PDCURSES_SRCDIR) \
-c $(CFLAGS) $(DLLOPT) $(WIDEOPT) $(INFOPT)
all: $(PDCLIBS)
clean:
-$(RM) *.obj
-$(RM) $(LIBCURSES)
-$(RM) *.exe
-$(RM) $(CURSESDLL)
-$(RM) *.exp
-$(RM) pdcurses.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 pdcurses.lib
$(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