From db39c3921d7af6f39fcbcc52295d4b012a8fc264 Mon Sep 17 00:00:00 2001 From: aiafrasinei Date: Tue, 25 Dec 2018 12:08:02 +0200 Subject: [PATCH] Added makefile for visual studio --- sdl2/Makefile.vc | 130 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 130 insertions(+) create mode 100644 sdl2/Makefile.vc diff --git a/sdl2/Makefile.vc b/sdl2/Makefile.vc new file mode 100644 index 00000000..8e22c85d --- /dev/null +++ b/sdl2/Makefile.vc @@ -0,0 +1,130 @@ +# Visual C++ NMakefile for PDCurses library - Windows sdl2 VC++ 2.0+ +# +# 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 + +SDL2_INCLUDE = C:\SDL2-2.0.9\include +SDL2_LIB = C:\SDL2-2.0.9\lib\x64\SDL2.lib +SDL2_LIBMAIN = C:\SDL2-2.0.9\lib\x64\SDL2main.lib + +!ifndef PDCURSES_SRCDIR +PDCURSES_SRCDIR = .. +!endif + +!include $(PDCURSES_SRCDIR)\version.mif +!include $(PDCURSES_SRCDIR)\common\libobjs.mif + +osdir = $(PDCURSES_SRCDIR)\sdl2 + +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 +!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 + +CCLIBS = user32.lib advapi32.lib $(SDL2_LIB) $(SDL2_LIBMAIN) +# may need to add msvcrt.lib for VC 2.x, VC 5.0 doesn't want it +#CCLIBS = msvcrt.lib user32.lib advapi32.lib + +LIBEXE = lib -nologo + +LIBCURSES = pdcurses.lib +CURSESDLL = pdcurses.dll + +!ifdef DLL +DLLOPT = -DPDC_DLL_BUILD +PDCLIBS = $(CURSESDLL) +!else +PDCLIBS = $(LIBCURSES) +!endif + +BUILD = $(CC) -I$(PDCURSES_SRCDIR) -I$(SDL2_INCLUDE) -c $(CFLAGS) $(DLLOPT) \ +$(WIDEOPT) $(UTF8OPT) $(INFOPT) + +all: $(PDCLIBS) + +clean: + -$(RM) *.obj + -$(RM) *.lib + -$(RM) *.exe + -$(RM) *.dll + -$(RM) *.exp + -$(RM) *.res + +demos: $(DEMOS) + +DEMOOBJS = $(DEMOS:.exe=.obj) tui.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 $(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 + +{$(srcdir)\}.c{}.obj:: + $(BUILD) $< + +{$(osdir)\}.c{}.obj:: + $(BUILD) $< + +{$(demodir)\}.c{}.obj:: + $(BUILD) $< + +.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) -I$(demodir) $(demodir)\tuidemo.c + +PLATFORM1 = Visual C++ +PLATFORM2 = Microsoft Visual C/C++ for Windows sdl2 +ARCNAME = pdc$(VER)_vc_sdl2 + +!include $(PDCURSES_SRCDIR)\common\makedist.mif