From: mattn Date: Fri, 19 Sep 2014 06:01:30 +0000 (+0900) Subject: Merge pull request #23 from mattn/win32 X-Git-Url: https://git.danieliu.xyz/?p=smdp.git;a=commitdiff_plain;h=1137e63ffbb08abc0daea19e32aa37e96afb0770 Merge pull request #23 from mattn/win32 Windows porting closes #23 --- diff --git a/Makefile b/Makefile index 3c1715e..f0cf1ec 100644 --- a/Makefile +++ b/Makefile @@ -19,16 +19,24 @@ # CFLAGS = -O3 -Wall -LDFLAGS = -s -LDLIBS = -lncursesw -OBJECTS = cstring.o cstack.o markdown.o parser.o viewer.o mdp.o -DESTDIR ?= /usr/bin ifeq ($(DEBUG),1) -CFLAGS := -Wall -g -O0 +CFLAGS := -O0 -Wall -g LDFLAGS := endif +ifeq (Windows_NT, $(OS)) +CURSES = pdcurses +CFLAGS += -DWIN32=1 +else +CURSES = ncursesw +endif + +LDFLAGS = -s +LDLIBS = -l$(CURSES) +OBJECTS = cstring.o cstack.o markdown.o parser.o viewer.o mdp.o +DESTDIR = /usr/bin + all: mdp mdp: $(OBJECTS) diff --git a/include/viewer.h b/include/viewer.h index dd786e4..b790085 100644 --- a/include/viewer.h +++ b/include/viewer.h @@ -32,7 +32,11 @@ * */ -#include +#if WIN32 == 1 +# include +#else +# include +#endif #include "parser.h" #include "cstack.h" diff --git a/viewer.c b/viewer.c index 14018da..c1a0188 100644 --- a/viewer.c +++ b/viewer.c @@ -22,7 +22,6 @@ */ #include // setlocale -#include #include #include // strchr #include